1.0.11.35: fixed bug 417
[sbcl.git] / src / assembly / x86 / alloc.lisp
index d3da607..b300396 100644 (file)
@@ -10,9 +10,6 @@
 ;;;; files for more information.
 
 (in-package "SB!VM")
-
-(file-comment
-  "$Header$")
 \f
 ;;;; from signed/unsigned
 
@@ -31,8 +28,8 @@
   (inst ret)
   BIGNUM
 
-  (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 1))
-    (storew eax ebx bignum-digits-offset other-pointer-type))
+  (with-fixed-allocation (ebx bignum-widetag (+ bignum-digits-offset 1))
+    (storew eax ebx bignum-digits-offset other-pointer-lowtag))
 
   (inst ret))
 
   (inst mov ebx eax)
 
   ;; Two word bignum
-  (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 2))
-    (storew eax ebx bignum-digits-offset other-pointer-type))
+  (with-fixed-allocation (ebx bignum-widetag (+ bignum-digits-offset 2))
+    (storew eax ebx bignum-digits-offset other-pointer-lowtag))
   (inst ret)
 
   ONE-WORD-BIGNUM
-  (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 1))
-    (storew eax ebx bignum-digits-offset other-pointer-type))
+  (with-fixed-allocation (ebx bignum-widetag (+ bignum-digits-offset 1))
+    (storew eax ebx bignum-digits-offset other-pointer-lowtag))
   (inst ret))
+
+#+sb-assembling
+(defun frob-allocation-assembly-routine (obj lowtag arg-tn)
+  `(define-assembly-routine (,(intern (format nil "ALLOCATE-~A-TO-~A" obj arg-tn)))
+     ((:temp ,arg-tn descriptor-reg ,(intern (format nil "~A-OFFSET" arg-tn))))
+     (pseudo-atomic
+      (allocation ,arg-tn (pad-data-block ,(intern (format nil "~A-SIZE" obj))))
+      (inst lea ,arg-tn (make-ea :byte :base ,arg-tn :disp ,lowtag)))
+     (inst ret)))
+
+#+sb-assembling
+(macrolet ((frob-cons-routines ()
+             (let ((routines nil))
+               (dolist (tn-offset *dword-regs*
+                        `(progn ,@routines))
+                 (push (frob-allocation-assembly-routine 'cons
+                                                         list-pointer-lowtag
+                                                         (intern (aref *dword-register-names* tn-offset)))
+                       routines)))))
+  (frob-cons-routines))