arch-assem.S: Update fun-end breakpoint magic for pickier make-lisp-obj.
authorAlastair Bridgewater <nyef@arisu.lisphacker.com>
Wed, 9 Nov 2011 17:30:40 +0000 (12:30 -0500)
committerAlastair Bridgewater <nyef@arisu.lisphacker.com>
Thu, 10 Nov 2011 19:43:57 +0000 (14:43 -0500)
  * We're about to cause SB-KERNEL:MAKE-LISP-OBJ to use the same
validation on CHENEYGC as it always has on GENCGC.

  * In order to not break function-end breakpoints, update them
all now to have the same header structure as on PPC (which had
to be made to work on GENCGC some time back).

  * While we're here, add a comment to each copy pointing to the
PPC version as having an actual explanation for the magic.

  * And update the PPC version commentary to the soon-to-be
reality of MAKE-LISP-OBJ always verifying pointers, instead of
only verifying pointers on GENCGC.

  * Finally, remove the no-longer-necessary code in debug-int
that set the header value, leaving a historic-information
comment behind.

src/code/debug-int.lisp
src/runtime/alpha-assem.S
src/runtime/hppa-assem.S
src/runtime/mips-assem.S
src/runtime/ppc-assem.S
src/runtime/sparc-assem.S
src/runtime/x86-64-assem.S
src/runtime/x86-assem.S

index ef48049..7411bc5 100644 (file)
@@ -3152,20 +3152,10 @@ register."
      #!-(or x86 x86-64)
      (let ((new-lra (make-lisp-obj (+ (sap-int dst-start)
                                       sb!vm:other-pointer-lowtag))))
-       #!-(or gencgc ppc)
-       (progn
-         ;; Set the offset from the LRA to the enclosing component.
-         ;; This does not need to be done on GENCGC targets, as the
-         ;; pointer validation done in MAKE-LISP-OBJ requires that it
-         ;; already have been set before we get here.  It does not
-         ;; need to be done on CHENEYGC PPC as it's easier to use the
-         ;; same fun_end_breakpoint_guts on both, including the LRA
-         ;; header.
-         (set-header-data
-          new-lra
-          (logandc2 (+ sb!vm:code-constants-offset bogus-lra-constants 1)
-                    1))
-         (sb!vm:sanctify-for-execution code-object))
+       ;; We used to set the header value of the LRA here to the
+       ;; offset from the enclosing component to the LRA header, but
+       ;; MAKE-LISP-OBJ actually checks the value before we get a
+       ;; chance to set it, so it's now done in arch-assem.S.
        (values new-lra code-object (sap- trap-loc src-start))))))
 \f
 ;;;; miscellaneous
index dd4e218..1a8928b 100644 (file)
@@ -320,12 +320,17 @@ funcallable_instance_tramp = . + 1
  * fun-end breakpoint magic.
  */
 
+/*
+ * For an explanation of the magic involved in function-end
+ * breakpoints, see the implementation in ppc-assem.S.
+ */
+
        .text
        .align  2
        .set    noreorder
        .globl  fun_end_breakpoint_guts
 fun_end_breakpoint_guts:
-       .long   RETURN_PC_HEADER_WIDETAG
+       .long   RETURN_PC_HEADER_WIDETAG + 0x800
        br      zero, fun_end_breakpoint_trap
        nop
        mov     reg_CSP, reg_OCFP
index 25cb29d..97ada0c 100644 (file)
@@ -436,10 +436,15 @@ SingleStepTraps:
        there's a break 0,0 in the new version here!!!
 */
 
+/*
+ * For an explanation of the magic involved in function-end
+ * breakpoints, see the implementation in ppc-assem.S.
+ */
+
        .align  8
        .export fun_end_breakpoint_guts
 fun_end_breakpoint_guts:
-       .word   RETURN_PC_HEADER_WIDETAG
+       .word   RETURN_PC_HEADER_WIDETAG + 0x800
        /* multiple value return point -- just jump to trap. */
        b,n     fun_end_breakpoint_trap
        /* single value return point -- convert to multiple w/ n=1 */
index c295993..4eabf21 100644 (file)
@@ -447,10 +447,16 @@ funcallable_instance_tramp = . + 1
  * copied and has to be relocatable. It also needs a properly aligned
  * header tag after the fun_end_breakpoint_guts symbol.
  */
+
+/*
+ * For an explanation of the magic involved in function-end
+ * breakpoints, see the implementation in ppc-assem.S.
+ */
+
        .align  3 /* minimum alignment for a lisp object */
        LEAF(fun_end_breakpoint_guts)
        .set    noreorder
-       .word   RETURN_PC_HEADER_WIDETAG
+       .word   RETURN_PC_HEADER_WIDETAG + 0x800
        b       multiple_value_return
         nop
        .set    reorder
index a8a165c..3f0dd99 100644 (file)
@@ -663,13 +663,13 @@ CSYMBOL(funcallable_instance_tramp) = . + 1
        .globl CSYMBOL(fun_end_breakpoint_trap)
        .globl CSYMBOL(fun_end_breakpoint_end)
 
-       /* Due to pointer verification in MAKE-LISP-OBJ on GENCGC
-       targets, which includes PPC, this must include its header data
-       (the offset from the start of the code-object to the LRA).
-       The code-object header is five words, there are two words of
-       constants, and the instruction space is doubleword-aligned,
-       making an offset of eight.  This is header data for a widetag,
-       so shift left eight bits and add. */
+       /* Due to pointer verification in MAKE-LISP-OBJ, this must
+       include its header data (the offset from the start of the
+       code-object to the LRA).  The code-object header is five
+       words, there are two words of constants, and the instruction
+       space is doubleword-aligned, making an offset of eight.
+       This is header data for a widetag, so shift left eight bits
+       and add. */
        .long RETURN_PC_HEADER_WIDETAG + 0x800
 
        /* We are receiving unknown multiple values, thus must deal
index ac6342d..6c2af48 100644 (file)
@@ -265,11 +265,16 @@ funcallable_instance_tramp = . + 1
  * Function-end breakpoint magic.
  */
 
+/*
+ * For an explanation of the magic involved in function-end
+ * breakpoints, see the implementation in ppc-assem.S.
+ */
+
        .text
        .align  8
        .global fun_end_breakpoint_guts
 fun_end_breakpoint_guts:
-       .word   RETURN_PC_HEADER_WIDETAG
+       .word   RETURN_PC_HEADER_WIDETAG + 0x800
        b       1f
        nop
        mov     reg_CSP, reg_OCFP
index 52321bf..c4f5435 100644 (file)
@@ -344,6 +344,12 @@ GNAME(closure_tramp):
 /*
  * fun-end breakpoint magic
  */
+
+/*
+ * For an explanation of the magic involved in function-end
+ * breakpoints, see the implementation in ppc-assem.S.
+ */
+
        .text
        .globl  GNAME(fun_end_breakpoint_guts)
        .align  align_16byte
index 5a89a4a..2945f77 100644 (file)
@@ -380,6 +380,12 @@ GNAME(funcallable_instance_tramp):
 /*
  * fun-end breakpoint magic
  */
+
+/*
+ * For an explanation of the magic involved in function-end
+ * breakpoints, see the implementation in ppc-assem.S.
+ */
+
        .text
        .globl  GNAME(fun_end_breakpoint_guts)
        .align  align_16byte