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

Clean up and correct some comments.

parent 5a06638f
No related branches found
No related tags found
No related merge requests found
...@@ -140,22 +140,25 @@ ...@@ -140,22 +140,25 @@
(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)))
;;
;; Load the size first so that the size can be in the same ;; Load the size first so that the size can be in the same
;; register as alloc-tn. ;; register as alloc-tn.
(load-size alloc-tn alloc-tn size) (load-size alloc-tn alloc-tn size)
;;
;; Try inline allocation, incrementing the
;; current-region-free-pointer by the size. If we didn't pass the
;; end of the region, then inline allocation succeeded, and we're
;; done.
(inst add alloc-tn (inst add alloc-tn
(make-symbol-value-ea '*current-region-free-pointer*)) (make-symbol-value-ea '*current-region-free-pointer*))
(inst cmp alloc-tn (inst cmp alloc-tn
(make-symbol-value-ea '*current-region-end-addr*)) (make-symbol-value-ea '*current-region-end-addr*))
(inst jmp :be OK) (inst jmp :be OK)
;; Inline allocation didn't work so we need to call alloc, carefully. ;; Inline allocation didn't work so we need to call alloc,
;; carefully. Need to recompute the size because we can't just
;; Recompute the size. Can't just reload size because it might ;; reload size because it might have already been destroyed if
;; have already been destroyed if size = alloc-tn (which does ;; size = alloc-tn (which does happen).
;; happen).
(inst sub alloc-tn (make-symbol-value-ea '*current-region-free-pointer*)) (inst sub alloc-tn (make-symbol-value-ea '*current-region-free-pointer*))
(case (tn-offset alloc-tn) (case (tn-offset alloc-tn)
(#.eax-offset (#.eax-offset
...@@ -169,7 +172,7 @@ ...@@ -169,7 +172,7 @@
(inst call (make-fixup (extern-alien-name #-sse2 "alloc_overflow_x87" (inst call (make-fixup (extern-alien-name #-sse2 "alloc_overflow_x87"
#+sse2 "alloc_overflow_sse2") #+sse2 "alloc_overflow_sse2")
:foreign)) :foreign))
(inst mov alloc-tn eax-tn) ; Save allocated address in alloc-tn (inst mov alloc-tn eax-tn) ; Put allocated address in alloc-tn
(inst pop eax-tn) ; Restore old value of eax (inst pop eax-tn) ; Restore old value of eax
(inst jmp done))) (inst jmp done)))
...@@ -181,8 +184,7 @@ ...@@ -181,8 +184,7 @@
(values)) (values))
(defun not-inline-allocation (alloc-tn size) (defun not-inline-allocation (alloc-tn size)
;; C call to allocate via dispatch routines. Each destination has a ;; C call to allocate. The size may be a register or a constant.
;; special entry point. The size may be a register or a constant.
(load-size alloc-tn alloc-tn size) (load-size alloc-tn alloc-tn size)
(case (tn-offset alloc-tn) (case (tn-offset alloc-tn)
(#.eax-offset (#.eax-offset
......
...@@ -484,7 +484,7 @@ FUNCDEF(alloc_overflow_sse2) ...@@ -484,7 +484,7 @@ FUNCDEF(alloc_overflow_sse2)
movl %ecx, 8(%esp) # Save ecx and edx registers movl %ecx, 8(%esp) # Save ecx and edx registers
movl %edx, 4(%esp) movl %edx, 4(%esp)
stmxcsr 12(%esp) # Save MXCSR stmxcsr 12(%esp) # Save MXCSR
/* Clear the exceptions that might occurred */ /* Clear the exceptions that might have occurred */
movl 12(%esp), %edx movl 12(%esp), %edx
and $-64, %edx # Clear the exceptions and $-64, %edx # Clear the exceptions
movl %edx, 16(%esp) movl %edx, 16(%esp)
......
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