killing lutexes, adding timeouts
[sbcl.git] / src / compiler / hppa / call.lisp
index ff31fe1..8c004db 100644 (file)
         (inst addi (- (bytes-needed-for-non-descriptor-stack-frame))
               nfp val)))))
 
+;;; Accessing a slot from an earlier stack frame is definite hackery.
+(define-vop (ancestor-frame-ref)
+  (:args (frame-pointer :scs (descriptor-reg))
+         (variable-home-tn :load-if nil))
+  (:results (value :scs (descriptor-reg any-reg)))
+  (:policy :fast-safe)
+  (:generator 4
+    (aver (sc-is variable-home-tn control-stack))
+    (loadw value frame-pointer (tn-offset variable-home-tn))))
+(define-vop (ancestor-frame-set)
+  (:args (frame-pointer :scs (descriptor-reg))
+         (value :scs (descriptor-reg any-reg)))
+  (:results (variable-home-tn :load-if nil))
+  (:policy :fast-safe)
+  (:generator 4
+    (aver (sc-is variable-home-tn control-stack))
+    (storew value frame-pointer (tn-offset variable-home-tn))))
+
 (define-vop (xep-allocate-frame)
   (:info start-lab copy-more-arg-follows)
   (:ignore copy-more-arg-follows)
@@ -399,6 +417,15 @@ default-value-8
               nvals)
   (:temporary (:scs (non-descriptor-reg)) temp))
 
+\f
+;;; This hook in the codegen pass lets us insert code before fall-thru entry
+;;; points, local-call entry points, and tail-call entry points.  The default
+;;; does nothing.
+(defun emit-block-header (start-label trampoline-label fall-thru-p alignp)
+  (declare (ignore fall-thru-p alignp))
+  (when trampoline-label
+    (emit-label trampoline-label))
+  (emit-label start-label))
 
 \f
 ;;;; Local call with unknown values convention return:
@@ -774,12 +801,7 @@ default-value-8
                 (insert-step-instrumenting (callable-tn)
                   ;; Conditionally insert a conditional trap:
                   (when step-instrumenting
-                    ;; Get the symbol-value of SB!IMPL::*STEPPING*
-                    (inst ldw (- (+ symbol-value-slot
-                                    (truncate (static-symbol-offset 'sb!impl::*stepping*)
-                                    n-word-bytes))
-                                 other-pointer-lowtag)
-                              null-tn stepping)
+                    (load-symbol-value stepping sb!impl::*stepping*)
                     ;; If it's not NIL, trap.
                     ;(inst comb := stepping null-tn step-done-label)
                     (inst comb := null-tn null-tn step-done-label :nullify t)
@@ -1025,10 +1047,13 @@ default-value-8
       (lisp-return lra-arg :offset 2)
       ;; Nope, not the single case.
       (emit-label not-single)
+      ;; most of these moves will not be emitted and therefor
+      ;; isn't suitable to put in the delay slot below. But if
+      ;; you do, dont forget to force-emit as in (move src dst t)
       (move ocfp-arg ocfp)
       (move lra-arg lra)
       (move vals-arg vals)
-      (move nvals-arg nvals) ; FIX-lav: cant utilize branch-delay-slot, why?
+      (move nvals-arg nvals)
       (let ((fixup (make-fixup 'return-multiple :assembly-routine)))
         (inst ldil fixup tmp)
         (inst be fixup lisp-heap-space tmp :nullify t)))
@@ -1061,7 +1086,7 @@ default-value-8
 
 ;;; Copy a more arg from the argument area to the end of the current frame.
 ;;; Fixed is the number of non-more arguments.
-;;; FIX-lav: old hppa code look smarter.
+;;; FIXME-lav: old hppa code look smarter.
 (define-vop (copy-more-arg)
   (:temporary (:sc any-reg :offset nl0-offset) result)
   (:temporary (:sc any-reg :offset nl1-offset) count)
@@ -1097,11 +1122,11 @@ default-value-8
       (inst add nargs-tn cfp-tn src)
 
       (emit-label loop)
-      ; decrease src, then load src into temp
+      ;; decrease src, then load src into temp
       (inst ldwm (- n-word-bytes) src temp)
-      ; increase, compare if count >= to zero, if true, jump
+      ;; increase, compare if count >= to zero, if true, jump
       (inst addib :>= (fixnumize -1) count loop)
-      ; decrease dst, then store temp at dst
+      ;; decrease dst, then store temp at dst
       (inst stwm temp (- n-word-bytes) dst)
 
       (emit-label do-regs)
@@ -1252,12 +1277,7 @@ default-value-8
   (:policy :fast-safe)
   (:vop-var vop)
   (:generator 3
-    ;; Get the symbol-value of SB!IMPL::*STEPPING*
-    (inst ldw (- (+ symbol-value-slot
-                    (truncate (static-symbol-offset 'sb!impl::*stepping*)
-                              n-word-bytes))
-                 other-pointer-lowtag)
-              null-tn stepping)
+    (load-symbol-value stepping sb!impl::*stepping*)
     ;; If it's not NIL, trap.
     (inst comb := stepping null-tn DONE :nullify t)
     ;; CONTEXT-PC will be pointing here when the interrupt is handled,