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

Remove old inline allocation function and corresponding assembly routines.

parent 2e95a0bb
No related branches found
No related tags found
No related merge requests found
...@@ -137,47 +137,6 @@ ...@@ -137,47 +137,6 @@
(unless (and (tn-p size) (location= alloc-tn size)) (unless (and (tn-p size) (location= alloc-tn size))
(inst mov dst-tn size))) (inst mov dst-tn size)))
#+nil
(defun inline-allocation (alloc-tn size)
(let ((ok (gen-label)))
;;
;; Load the size first so that the size can be in the same
;; register as alloc-tn.
(load-size alloc-tn alloc-tn size)
;;
(inst add alloc-tn
(make-symbol-value-ea '*current-region-free-pointer*))
(inst cmp alloc-tn
(make-symbol-value-ea '*current-region-end-addr*))
(inst jmp :be OK)
;;
;; Dispatch to the appropriate overflow routine. There is a
;; routine for each destination.
(ecase (tn-offset alloc-tn)
(#.eax-offset
(inst call (make-fixup (extern-alien-name "alloc_overflow_eax")
:foreign)))
(#.ecx-offset
(inst call (make-fixup (extern-alien-name "alloc_overflow_ecx")
:foreign)))
(#.edx-offset
(inst call (make-fixup (extern-alien-name "alloc_overflow_edx")
:foreign)))
(#.ebx-offset
(inst call (make-fixup (extern-alien-name "alloc_overflow_ebx")
:foreign)))
(#.esi-offset
(inst call (make-fixup (extern-alien-name "alloc_overflow_esi")
:foreign)))
(#.edi-offset
(inst call (make-fixup (extern-alien-name "alloc_overflow_edi")
:foreign))))
(emit-label ok)
(inst xchg (make-symbol-value-ea '*current-region-free-pointer*)
alloc-tn))
(values))
;;#+nil
(defun inline-allocation (alloc-tn size) (defun inline-allocation (alloc-tn size)
(let ((ok (gen-label)) (let ((ok (gen-label))
(done (gen-label))) (done (gen-label)))
......
...@@ -553,124 +553,6 @@ ENDFUNC(alloc_to_edi) ...@@ -553,124 +553,6 @@ ENDFUNC(alloc_to_edi)
#ifdef GENCGC #ifdef GENCGC
/* Called from lisp when an inline allocation overflows.
Every register except the result needs to be preserved.
We depend on C to preserve ebx, esi, edi, and ebp.
But where necessary must save eax, ecx, edx. */
/* This routine handles an overflow with eax=crfp+size. So the
size=eax-crfp. */
FUNCDEF(alloc_overflow_eax)
STACK_PROLOGUE(12)
movl %ecx, 8(%esp) # Save ecx
movl %edx, 4(%esp) # Save edx
/* Calculate the size for the allocation. */
subl CURRENT_REGION_FREE_POINTER + SYMBOL_VALUE_OFFSET,%eax
movl %eax, (%esp) # Push the size
call GNAME(alloc)
movl 4(%esp), %edx # Restore edx.
movl 8(%esp), %ecx # Restore ecx.
STACK_EPILOGUE
addl $6,(%esp) # Adjust the return address to skip the next inst.
ret
ENDFUNC(alloc_overflow_eax)
/* This routine handles an overflow with ecx=crfp+size. So the
size=ecx-crfp. */
FUNCDEF(alloc_overflow_ecx)
STACK_PROLOGUE(12)
movl %eax, 8(%esp) # Save eax
movl %edx, 4(%esp) # Save edx
/* Calculate the size for the allocation. */
subl CURRENT_REGION_FREE_POINTER + SYMBOL_VALUE_OFFSET,%ecx
movl %ecx, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%ecx # setup the destination.
movl 4(%esp), %edx # Restore edx.
movl 8(%esp), %eax # Restore eax.
STACK_EPILOGUE
addl $6,(%esp) # Adjust the return address to skip the next inst.
ret
ENDFUNC(alloc_overflow_ecx)
/* This routine handles an overflow with edx=crfp+size. So the
size=edx-crfp. */
FUNCDEF(alloc_overflow_edx)
STACK_PROLOGUE(12)
movl %eax, 8(%esp) # Save eax
movl %ecx, 4(%esp) # Save ecx
/* Calculate the size for the allocation. */
subl CURRENT_REGION_FREE_POINTER + SYMBOL_VALUE_OFFSET,%edx
movl %edx, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%edx # setup the destination.
movl 4(%esp), %ecx # Restore ecx.
movl 8(%esp), %eax # Restore eax.
STACK_EPILOGUE
addl $6,(%esp) # Adjust the return address to skip the next inst.
ret
ENDFUNC(alloc_overflow_edx)
/* This routine handles an overflow with ebx=crfp+size. So the
size=ebx-crfp. */
FUNCDEF(alloc_overflow_ebx)
STACK_PROLOGUE(16)
movl %eax, 12(%esp) # Save eax
movl %ecx, 8(%esp) # Save ecx
movl %edx, 4(%esp) # Save edx
/* Calculate the size for the allocation. */
subl CURRENT_REGION_FREE_POINTER + SYMBOL_VALUE_OFFSET,%ebx
movl %ebx, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%ebx # setup the destination.
movl 4(%esp), %edx # Restore edx.
movl 8(%esp), %ecx # Restore ecx.
movl 12(%esp), %eax # Restore eax.
STACK_EPILOGUE
addl $6,(%esp) # Adjust the return address to skip the next inst.
ret
ENDFUNC(alloc_overflow_ebx)
/* This routine handles an overflow with esi=crfp+size. So the
size=esi-crfp. */
FUNCDEF(alloc_overflow_esi)
STACK_PROLOGUE(16)
movl %eax, 12(%esp) # Save eax
movl %ecx, 8(%esp) # Save ecx
movl %edx, 4(%esp) # Save edx
/* Calculate the size for the allocation. */
subl CURRENT_REGION_FREE_POINTER + SYMBOL_VALUE_OFFSET,%esi
movl %esi, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%esi # setup the destination.
movl 4(%esp), %edx # Restore edx.
movl 8(%esp), %ecx # Restore ecx.
movl 12(%esp), %eax # Restore eax.
STACK_EPILOGUE
addl $6,(%esp) # Adjust the return address to skip the next inst.
ret
ENDFUNC(alloc_overflow_esi)
/* This routine handles an overflow with edi=crfp+size. So the
size=edi-crfp. */
FUNCDEF(alloc_overflow_edi)
STACK_PROLOGUE(16)
movl %eax, 12(%esp) # Save eax
movl %ecx, 8(%esp) # Save ecx
movl %edx, 4(%esp) # Save edx
/* Calculate the size for the allocation. */
subl CURRENT_REGION_FREE_POINTER + SYMBOL_VALUE_OFFSET,%edi
movl %edi, (%esp) # Push the size
call GNAME(alloc)
movl %eax,%edi # setup the destination.
movl 4(%esp), %edx # Restore edx.
movl 8(%esp), %ecx # Restore ecx.
movl 12(%esp), %eax # Restore eax.
STACK_EPILOGUE
addl $6,(%esp) # Adjust the return address to skip the next inst.
ret
ENDFUNC(alloc_overflow_edi)
/* /*
* alloc_overflow_x87 and alloc_overflow_sse2 must not be called from * alloc_overflow_x87 and alloc_overflow_sse2 must not be called from
* C because it doesn't follow C conventions. * C because it doesn't follow C conventions.
...@@ -703,7 +585,9 @@ FUNCDEF(alloc_overflow_sse2) ...@@ -703,7 +585,9 @@ FUNCDEF(alloc_overflow_sse2)
movl %edx, 16(%esp) movl %edx, 16(%esp)
ldmxcsr 16(%esp) # Get new mxcsr value ldmxcsr 16(%esp) # Get new mxcsr value
movl %eax, (%esp) # Put size on stack for first arg to alloc() movl %eax, (%esp) # Put size on stack for first arg to alloc()
call GNAME(alloc) call GNAME(alloc)
movl 4(%esp), %edx # Restore edx and ecx registers. eax has the return value. movl 4(%esp), %edx # Restore edx and ecx registers. eax has the return value.
movl 8(%esp), %ecx movl 8(%esp), %ecx
ldmxcsr 12(%esp) ldmxcsr 12(%esp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment