Skip to content
Snippets Groups Projects
Commit 99020b36 authored by Raymond Toy's avatar Raymond Toy
Browse files

Clean up not-inline-allocation.

src/lisp/x86-assem.S:
o Remove the (now) unused alloc_to_<reg> functions.

src/compiler/x86/macros.lisp:
o Simplify the not-inline-allocation to use the same routines as
  inline allocation.
parent f9f78a47
No related branches found
No related tags found
No related merge requests found
......@@ -183,31 +183,20 @@
(defun not-inline-allocation (alloc-tn size)
;; C call to allocate via dispatch routines. Each destination has a
;; special entry point. The size may be a register or a constant.
(ecase (tn-offset alloc-tn)
(load-size alloc-tn alloc-tn size)
(case (tn-offset alloc-tn)
(#.eax-offset
(load-size alloc-tn eax-tn size)
(inst call (make-fixup (extern-alien-name "alloc_to_eax")
(inst call (make-fixup (extern-alien-name #-sse2 "alloc_overflow_x87"
#+sse2 "alloc_overflow_sse2")
:foreign)))
(#.ecx-offset
(load-size alloc-tn ecx-tn size)
(inst call (make-fixup (extern-alien-name "alloc_to_ecx")
:foreign)))
(#.edx-offset
(load-size alloc-tn edx-tn size)
(inst call (make-fixup (extern-alien-name "alloc_to_edx")
:foreign)))
(#.ebx-offset
(load-size alloc-tn ebx-tn size)
(inst call (make-fixup (extern-alien-name "alloc_to_ebx")
:foreign)))
(#.esi-offset
(load-size alloc-tn esi-tn size)
(inst call (make-fixup (extern-alien-name "alloc_to_esi")
:foreign)))
(#.edi-offset
(load-size alloc-tn edi-tn size)
(inst call (make-fixup (extern-alien-name "alloc_to_edi")
:foreign))))
(t
(inst push eax-tn) ; Save any value in eax
(inst mov eax-tn alloc-tn)
(inst call (make-fixup (extern-alien-name #-sse2 "alloc_overflow_x87"
#+sse2 "alloc_overflow_sse2")
:foreign))
(inst mov alloc-tn eax-tn) ; Save allocated address in alloc-tn
(inst pop eax-tn)))
(values))
;;;
......
......@@ -458,101 +458,6 @@ ENDFUNC(fastcopy16)
#endif
/*
Allocate bytes and return the start of the allocated space
in the specified destination register.
In the general case the size will be in the destination register.
All registers must be preserved except the destination.
The C conventions will preserve ebx, esi, edi, and ebp.
So only eax, ecx, and edx need special care here. */
FUNCDEF(alloc_to_eax)
STACK_PROLOGUE(12)
movl %ecx, 8(%esp) # Save ecx and edx as C could destroy them.
movl %edx, 4(%esp)
movl %eax, (%esp) # Push the size
call GNAME(alloc)
movl 4(%esp), %edx # Restore ecx and edx.
movl 8(%esp), %ecx
STACK_EPILOGUE
ret
ENDFUNC(alloc_to_eax)
FUNCDEF(alloc_to_ecx)
STACK_PROLOGUE(12)
movl %eax, 8(%esp) # Save eax and edx as C could destroy them.
movl %edx, 4(%esp)
movl %ecx, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%ecx # setup the destination.
movl 4(%esp), %edx # Restore eax and edx.
movl 8(%esp), %eax
STACK_EPILOGUE
ret
ENDFUNC(alloc_to_ecx)
FUNCDEF(alloc_to_edx)
STACK_PROLOGUE(12)
movl %eax, 8(%esp) # Save eax and ecx as C could destroy them.
movl %ecx, 4(%esp)
movl %edx, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%edx # setup the destination.
movl 4(%esp), %ecx # Restore eax and ecx.
movl 8(%esp), %eax
STACK_EPILOGUE
ret
ENDFUNC(alloc_to_edx)
FUNCDEF(alloc_to_ebx)
STACK_PROLOGUE(16)
movl %eax, 12(%esp) # Save eax, ecx, and edx as C could destroy them.
movl %ecx, 8(%esp)
movl %edx, 4(%esp)
movl %ebx, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%ebx # setup the destination.
movl 4(%esp), %edx # Restore eax, ecx and edx.
movl 8(%esp), %ecx
movl 12(%esp), %eax
STACK_EPILOGUE
ret
ENDFUNC(alloc_to_ebx)
FUNCDEF(alloc_to_esi)
STACK_PROLOGUE(16)
movl %eax, 12(%esp) # Save eax, ecx, and edx as C could destroy them.
movl %ecx, 8(%esp)
movl %edx, 4(%esp)
movl %esi, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%esi # setup the destination.
movl 4(%esp), %edx # Restore eax, ecx and edx.
movl 8(%esp), %ecx
movl 12(%esp), %eax
STACK_EPILOGUE
ret
ENDFUNC(alloc_to_esi)
FUNCDEF(alloc_to_edi)
STACK_PROLOGUE(16)
movl %eax, 12(%esp) # Save eax, ecx, and edx as C could destroy them.
movl %ecx, 8(%esp)
movl %edx, 4(%esp)
movl %edi, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%edi # setup the destination.
movl 4(%esp), %edx # Restore eax, ecx and edx.
movl 8(%esp), %ecx
movl 12(%esp), %eax
STACK_EPILOGUE
ret
ENDFUNC(alloc_to_edi)
#ifdef GENCGC
/*
* alloc_overflow_x87 and alloc_overflow_sse2 must not be called from
* C because it doesn't follow C conventions.
......@@ -595,8 +500,6 @@ FUNCDEF(alloc_overflow_sse2)
ret
ENDFUNC(alloc_overflow_sse2)
#endif /* GENCGC */
#ifdef LINKAGE_TABLE
/* Call into C code to resolve a linkage entry. The initial code in the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment