Diff of /src/compiler/x86/system.lisp [0ace89] .. [5d4902] Maximize Restore

  Switch to side-by-side view

--- a/src/compiler/x86/system.lisp
+++ b/src/compiler/x86/system.lisp
@@ -163,7 +163,7 @@
   (:translate binding-stack-pointer-sap)
   (:policy :fast-safe)
   (:generator 1
-    (load-symbol-value int *binding-stack-pointer*)))
+    (load-tl-symbol-value int *binding-stack-pointer*)))
 
 (defknown (setf binding-stack-pointer-sap)
     (system-area-pointer) system-area-pointer ())
@@ -173,10 +173,11 @@
   (:arg-types system-area-pointer)
   (:results (int :scs (sap-reg)))
   (:result-types system-area-pointer)
+  (:temporary (:sc any-reg) temp)
   (:translate (setf binding-stack-pointer-sap))
   (:policy :fast-safe)
   (:generator 1
-    (store-symbol-value new-value *binding-stack-pointer*)
+    (store-tl-symbol-value new-value *binding-stack-pointer* temp)
     (move int new-value)))
 
 (define-vop (control-stack-pointer-sap)
@@ -273,6 +274,21 @@
   (:generator 1
     (inst break pending-interrupt-trap)))
 
+(defknown current-thread-offset-sap ((unsigned-byte 32))  
+  system-area-pointer (flushable))
+
+(define-vop (current-thread-offset-sap)
+  (:results (sap :scs (sap-reg)))
+  (:result-types system-area-pointer)
+  (:translate current-thread-offset-sap)
+  (:args (n :scs (unsigned-reg) :target sap))
+  (:arg-types unsigned-num)
+  (:policy :fast-safe)
+  (:generator 2
+    (inst gs-segment-prefix)
+    (inst mov sap (make-ea :dword :disp 0
+			   :index n :scale 4))))
+
 (define-vop (halt)
   (:generator 1
     (inst break halt-trap)))