X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fassembly%2Fx86%2Falloc.lisp;h=b30039671438b4b0b70181a3ddea7c7827fcbcb6;hb=102b7c83b326855e16c3bc3ce4fa60c6d7aaba85;hp=b6e5a62afa1fe1fe31168df7e0549b47d629fae0;hpb=6fb6e66f531dfb6140ec3e0cc8f84f6ecd1927ca;p=sbcl.git diff --git a/src/assembly/x86/alloc.lisp b/src/assembly/x86/alloc.lisp index b6e5a62..b300396 100644 --- a/src/assembly/x86/alloc.lisp +++ b/src/assembly/x86/alloc.lisp @@ -28,7 +28,7 @@ (inst ret) BIGNUM - (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 1)) + (with-fixed-allocation (ebx bignum-widetag (+ bignum-digits-offset 1)) (storew eax ebx bignum-digits-offset other-pointer-lowtag)) (inst ret)) @@ -57,11 +57,31 @@ (inst mov ebx eax) ;; Two word bignum - (with-fixed-allocation (ebx bignum-type (+ bignum-digits-offset 2)) + (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)) + (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))