From ea2dae80bcc9be55607ce8d9b62c268db53e98c5 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Tue, 17 Jul 2012 19:32:17 -0700
Subject: [PATCH] Clean up and correct some comments.

---
 src/compiler/x86/macros.lisp | 22 ++++++++++++----------
 src/lisp/x86-assem.S         |  2 +-
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp
index 21b68e485..ca2c2677e 100644
--- a/src/compiler/x86/macros.lisp
+++ b/src/compiler/x86/macros.lisp
@@ -140,22 +140,25 @@
 (defun inline-allocation (alloc-tn size)
   (let ((ok (gen-label))
 	(done (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)
-    ;;
+
+    ;; 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
 	  (make-symbol-value-ea '*current-region-free-pointer*))
     (inst cmp alloc-tn
 	  (make-symbol-value-ea '*current-region-end-addr*))
     (inst jmp :be OK)
 
-    ;; Inline allocation didn't work so we need to call alloc, carefully.
-
-    ;; Recompute the size.  Can't just reload size because it might
-    ;; have already been destroyed if size = alloc-tn (which does
-    ;; happen).
+    ;; Inline allocation didn't work so we need to call alloc,
+    ;; carefully.  Need to recompute the size because we can't just
+    ;; reload size because it might have already been destroyed if
+    ;; size = alloc-tn (which does happen).
     (inst sub alloc-tn (make-symbol-value-ea '*current-region-free-pointer*))
     (case (tn-offset alloc-tn)
       (#.eax-offset
@@ -169,7 +172,7 @@
        (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 mov alloc-tn eax-tn)  	; Put allocated address in alloc-tn
        (inst pop eax-tn)		; Restore old value of eax
        (inst jmp done)))
 			       
@@ -181,8 +184,7 @@
   (values))
 
 (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.
+  ;; C call to allocate. The size may be a register or a constant.
   (load-size alloc-tn alloc-tn size)
   (case (tn-offset alloc-tn)
     (#.eax-offset
diff --git a/src/lisp/x86-assem.S b/src/lisp/x86-assem.S
index 9583e843e..34c1ef055 100644
--- a/src/lisp/x86-assem.S
+++ b/src/lisp/x86-assem.S
@@ -484,7 +484,7 @@ FUNCDEF(alloc_overflow_sse2)
 	movl	%ecx, 8(%esp)	# Save ecx and edx registers
 	movl	%edx, 4(%esp)
 	stmxcsr 12(%esp)	# Save MXCSR
-	/* Clear the exceptions that might occurred */
+	/* Clear the exceptions that might have occurred */
 	movl	12(%esp), %edx
 	and	$-64, %edx	# Clear the exceptions
 	movl	%edx, 16(%esp)
-- 
GitLab