From: Nikodemus Siivola Date: Tue, 5 Dec 2006 15:46:14 +0000 (+0000) Subject: 1.0.0.21: fix build on PPC -- breakage from XREF commit X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=39e19255f69cbba8668b4b7ffa58532ab6309375;p=sbcl.git 1.0.0.21: fix build on PPC -- breakage from XREF commit * Less offset hardcoding in ppc-assem.S, missing xrefs "slot" in undefined_tramp and funcallable_instance_tramp. * Also adjust mips-assem.S and sparc-assem.S for the new simple-fun layout: add xrefs "slot" to undefined_tramp, closure_tramp, and funcallable_instance_tramp. UNTESTED! * Explain what the _OFFSETs are in generated header files. --- diff --git a/src/compiler/generic/genesis.lisp b/src/compiler/generic/genesis.lisp index ce47985..90c22bd 100644 --- a/src/compiler/generic/genesis.lisp +++ b/src/compiler/generic/genesis.lisp @@ -2798,31 +2798,33 @@ core and return a descriptor to it." (defun write-primitive-object (obj) ;; writing primitive object layouts - (format t "#ifndef LANGUAGE_ASSEMBLY~2%") - (format t - "struct ~A {~%" - (substitute #\_ #\- - (string-downcase (string (sb!vm:primitive-object-name obj))))) - (when (sb!vm:primitive-object-widetag obj) - (format t " lispobj header;~%")) - (dolist (slot (sb!vm:primitive-object-slots obj)) - (format t " ~A ~A~@[[1]~];~%" - (getf (sb!vm:slot-options slot) :c-type "lispobj") - (substitute #\_ #\- - (string-downcase (string (sb!vm:slot-name slot)))) - (sb!vm:slot-rest-p slot))) + (format t "#ifndef LANGUAGE_ASSEMBLY~2%") + (format t + "struct ~A {~%" + (substitute #\_ #\- + (string-downcase (string (sb!vm:primitive-object-name obj))))) + (when (sb!vm:primitive-object-widetag obj) + (format t " lispobj header;~%")) + (dolist (slot (sb!vm:primitive-object-slots obj)) + (format t " ~A ~A~@[[1]~];~%" + (getf (sb!vm:slot-options slot) :c-type "lispobj") + (substitute #\_ #\- + (string-downcase (string (sb!vm:slot-name slot)))) + (sb!vm:slot-rest-p slot))) (format t "};~2%") - (format t "#else /* LANGUAGE_ASSEMBLY */~2%") - (let ((name (sb!vm:primitive-object-name obj)) - (lowtag (eval (sb!vm:primitive-object-lowtag obj)))) - (when lowtag - (dolist (slot (sb!vm:primitive-object-slots obj)) - (format t "#define ~A_~A_OFFSET ~D~%" - (substitute #\_ #\- (string name)) - (substitute #\_ #\- (string (sb!vm:slot-name slot))) - (- (* (sb!vm:slot-offset slot) sb!vm:n-word-bytes) lowtag))) + (format t "#else /* LANGUAGE_ASSEMBLY */~2%") + (format t "/* These offsets are SLOT-OFFSET * N-WORD-BYTES - LOWTAG~%") + (format t " * so they work directly on tagged addresses. */~2%") + (let ((name (sb!vm:primitive-object-name obj)) + (lowtag (eval (sb!vm:primitive-object-lowtag obj)))) + (when lowtag + (dolist (slot (sb!vm:primitive-object-slots obj)) + (format t "#define ~A_~A_OFFSET ~D~%" + (substitute #\_ #\- (string name)) + (substitute #\_ #\- (string (sb!vm:slot-name slot))) + (- (* (sb!vm:slot-offset slot) sb!vm:n-word-bytes) lowtag))) (terpri))) - (format t "#endif /* LANGUAGE_ASSEMBLY */~2%")) + (format t "#endif /* LANGUAGE_ASSEMBLY */~2%")) (defun write-structure-object (dd) (flet ((cstring (designator) diff --git a/src/runtime/mips-assem.S b/src/runtime/mips-assem.S index ca4cfd0..b44b4bc 100644 --- a/src/runtime/mips-assem.S +++ b/src/runtime/mips-assem.S @@ -374,13 +374,14 @@ lra: .word RETURN_PC_HEADER_WIDETAG .word NIL /* name */ .word NIL /* arglist */ .word NIL /* type */ + .word NIL /* xrefs */ LEAF(undefined_tramp) /* Point reg_CODE to the header and tag it as function, since the debugger regards a function pointer in reg_CODE which doesn't point to a code object as undefined function. */ lui reg_CODE, %hi(undefined_tramp) addiu reg_CODE, %lo(undefined_tramp) - addiu reg_CODE, - 24 + FUN_POINTER_LOWTAG + addiu reg_CODE, -SIMPLE_FUN_CODE_OFFSET .set noreorder b 1f break 0x0, trap_Cerror @@ -413,6 +414,7 @@ lra: .word RETURN_PC_HEADER_WIDETAG .word NIL /* name */ .word NIL /* arglist */ .word NIL /* type */ + .word NIL /* xrefs */ LEAF(closure_tramp) lw reg_LEXENV, FDEFN_FUN_OFFSET(reg_FDEFN) lw reg_CODE, CLOSURE_FUN_OFFSET(reg_LEXENV) @@ -432,6 +434,7 @@ funcallable_instance_tramp = . + 1 .word NIL .word NIL .word NIL + .word NIL lw reg_LEXENV, FUNCALLABLE_INSTANCE_FUNCTION_OFFSET(reg_LEXENV) lw reg_CODE, CLOSURE_FUN_OFFSET(reg_LEXENV) diff --git a/src/runtime/ppc-assem.S b/src/runtime/ppc-assem.S index 4c00459..974f339 100644 --- a/src/runtime/ppc-assem.S +++ b/src/runtime/ppc-assem.S @@ -346,7 +346,7 @@ x: /* Function is an indirect closure */ lwz reg_CODE,SIMPLE_FUN_SELF_OFFSET(reg_LEXENV) - addi reg_LIP,reg_CODE,6*4-FUN_POINTER_LOWTAG + addi reg_LIP,reg_CODE,SIMPLE_FUN_CODE_OFFSET mtctr reg_LIP slwi reg_NARGS,reg_NL2,2 bctr @@ -522,13 +522,14 @@ lra: .long NIL /* name */ .long NIL /* arglist */ .long NIL /* type */ + .long NIL /* xref */ CSYMBOL(undefined_tramp): /* Point reg_CODE to the header and tag it as function, since the debugger regards a function pointer in reg_CODE which doesn't point to a code object as undefined function. */ bcl 20,31,.+4 /* get address of the next instruction */ - mflr reg_CODE /* header is 7 words back from here */ - addi reg_CODE,reg_CODE,-7*4+FUN_POINTER_LOWTAG + mflr reg_CODE /* header 1 extra word back from here */ + addi reg_CODE,reg_CODE,-(SIMPLE_FUN_CODE_OFFSET+4) twllei reg_ZERO,trap_Cerror .byte 4 @@ -566,6 +567,7 @@ CSYMBOL(funcallable_instance_tramp) = . + 1 .long NIL .long NIL .long NIL + .long NIL lwz reg_LEXENV,FUNCALLABLE_INSTANCE_FUNCTION_OFFSET(reg_LEXENV) lwz reg_FDEFN,CLOSURE_FUN_OFFSET(reg_LEXENV) addi reg_LIP,reg_FDEFN,SIMPLE_FUN_CODE_OFFSET diff --git a/src/runtime/sparc-assem.S b/src/runtime/sparc-assem.S index c856cc9..ac6342d 100644 --- a/src/runtime/sparc-assem.S +++ b/src/runtime/sparc-assem.S @@ -213,6 +213,7 @@ undefined_tramp = . + 1 .word NIL .word NIL .word NIL + .word NIL b 1f unimp trap_Cerror @@ -237,6 +238,7 @@ closure_tramp = . + 1 .word NIL .word NIL .word NIL + .word NIL ld [reg_FDEFN+FDEFN_FUN_OFFSET], reg_LEXENV ld [reg_LEXENV+CLOSURE_FUN_OFFSET], reg_CODE @@ -253,6 +255,7 @@ funcallable_instance_tramp = . + 1 .word NIL .word NIL .word NIL + .word NIL ld [reg_LEXENV+FUNCALLABLE_INSTANCE_FUNCTION_OFFSET], reg_LEXENV ld [reg_LEXENV+CLOSURE_FUN_OFFSET], reg_CODE diff --git a/version.lisp-expr b/version.lisp-expr index bac11ad..c589e9c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.0.20" +"1.0.0.21"