From 16c6dde8103382f0cc625542da47cce036234514 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Wed, 31 May 2017 23:22:25 -0400 Subject: [PATCH] Fix and add test for previous change --- src/compiler/x86-64/system.lisp | 8 +++++--- tests/clos.impure.lisp | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/x86-64/system.lisp b/src/compiler/x86-64/system.lisp index 6fcbe6544..bb015c05e 100644 --- a/src/compiler/x86-64/system.lisp +++ b/src/compiler/x86-64/system.lisp @@ -68,7 +68,7 @@ (logior (+ immobile-space-start (* 7 256)) instance-pointer-lowtag)) #-sb-xc-host (aver (eql null-layout (get-lisp-obj-address (find-layout 'null)))) - ;; ~19 instructions vs. 35 + ;; ~20 instructions vs. 35 (define-vop (layout-of) ; no translation (:policy :fast-safe) (:args (object :scs (descriptor-reg)) @@ -96,9 +96,8 @@ (inst movzx (reg-in-size rax :dword) (make-ea :byte :base rax)) (inst jmp load-from-vector) IMM-OR-LIST - (inst mov result null-layout) (inst cmp object nil-value) - (inst jmp :eq done) + (inst jmp :eq NULL) (inst xor (reg-in-size rax :dword) #b1111) ; restore it (inst and (reg-in-size rax :dword) #xff) LOAD-FROM-VECTOR @@ -107,6 +106,9 @@ :index rax :scale 8 :disp (+ (ash vector-data-offset word-shift) (- other-pointer-lowtag)))) + (inst jmp done) + NULL + (inst mov result null-layout) DONE))) (define-vop (%other-pointer-widetag) diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 08b8bbdfc..3a84c26ed 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -2557,3 +2557,6 @@ (assert-error (unbound-slot-after-allocation=class (make-instance 'unbound-slot-after-allocation=class)) unbound-slot)) + +(with-test (:name :layouf-of-nil) + (assert (eq (sb-kernel:layout-of nil) (sb-kernel:find-layout 'null)))) -- 2.11.4.GIT