Update of /cvsroot/sbcl/sbcl/src/compiler/ppc
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv24944/src/compiler/ppc
188.8.131.52: ppc: Calling-convention fixes for entry-point handling during named-call.
* For GC purposes, seven times never load reg_LIP before loading
whatever register points to the object it refers to.
* During named-call, load the function from the fdefn before
loading the raw-addr (which ends up in reg_LIP). For simple-fun
objects, this provides the reference base for reg_LIP. For other
objects this doesn't matter because reg_LIP ends up pointing to
either undefined_tramp or closure_tramp.
* This still leaves a race condition when updating fdefinitions,
but fixes the race condition surrounding function calling.
* To fix the remaining race condition, we would need to alter
the undefined function trampoline to appear to be a simple-fun
object and adjust the fdefn-fun accessors to compensate, then
arrange for "named" calls to load reg_LEXENV and do closure-fun
access in the same manner as the closure_tramp and the "unnamed"
call VOPs. This would add another instruction to the call path,
but not another memory access (as we would trade off loading the
fdefn-raw-addr for loading the closure-fun).
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ppc/call.lisp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- call.lisp 7 Aug 2010 15:19:29 -0000 1.24
+++ call.lisp 7 Aug 2010 15:19:41 -0000 1.25
@@ -650,9 +650,8 @@
:from (:argument ,(if (eq return :tail) 0 1))
- ,@(unless named
- '((:temporary (:scs (descriptor-reg) :from (:argument 0) :to :eval)
+ (:temporary (:scs (descriptor-reg) :from (:argument 0) :to :eval)
(:temporary (:sc any-reg :offset nargs-offset :to :eval)
@@ -784,8 +783,17 @@
;; FUNCTION is loaded, but before ENTRY-POINT is
- (loadw entry-point name-pass fdefn-raw-addr-slot
+ ;; The raw-addr (ENTRY-POINT) will be one of:
+ ;; closure_tramp, undefined_tramp, or somewhere
+ ;; within a simple-fun object. If the latter, then
+ ;; it is essential (due to it being an interior
+ ;; pointer) that the function itself be in a
+ ;; register before the raw-addr is loaded.
+ (sb!assem:without-scheduling ()
+ (loadw function name-pass fdefn-fun-slot
+ (loadw entry-point name-pass fdefn-raw-addr-slot
(descriptor-reg (move lexenv arg-fun))