From 72a1d0dbc877f559f63baa4285c655a92c21c649 Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Sat, 7 Aug 2010 15:21:54 +0000 Subject: [PATCH] 1.0.41.26: ppc: Calling-convention fixes for static-fun VOPs. * Instead of having the static-fun VOPs work with the fdefn raw-addr slot directly, have them first load reg_FDEFN with the static-fdefinition object and then perform the critical part of the normal call sequence. * This covers the usual race condition, etc. involved in dealing with an fdefn-raw-addr without first loading the function, and allows (PPC only) the use of funcallable instances and closures as static-functions (unlikely as that is). --- src/compiler/ppc/static-fn.lisp | 6 +++++- version.lisp-expr | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compiler/ppc/static-fn.lisp b/src/compiler/ppc/static-fn.lisp index 2842087..2e8bf7b 100644 --- a/src/compiler/ppc/static-fn.lisp +++ b/src/compiler/ppc/static-fn.lisp @@ -19,6 +19,8 @@ (:temporary (:scs (non-descriptor-reg)) temp) (:temporary (:scs (descriptor-reg)) move-temp) (:temporary (:sc descriptor-reg :offset lra-offset) lra) + (:temporary (:sc descriptor-reg :offset fdefn-offset) fdefn) + (:temporary (:scs (descriptor-reg)) function) (:temporary (:sc interior-reg :offset lip-offset) entry-point) (:temporary (:sc any-reg :offset nargs-offset) nargs) (:temporary (:sc any-reg :offset ocfp-offset) old-fp) @@ -78,7 +80,9 @@ (let ((lra-label (gen-label)) (cur-nfp (current-nfp-tn vop))) ,@(moves (temp-names) (arg-names)) - (inst lwz entry-point null-tn (static-fun-offset symbol)) + (inst addi fdefn null-tn (static-fdefn-offset symbol)) + (loadw function fdefn fdefn-fun-slot other-pointer-lowtag) + (loadw entry-point fdefn fdefn-raw-addr-slot other-pointer-lowtag) (inst lr nargs (fixnumize ,num-args)) (when cur-nfp (store-stack-tn nfp-save cur-nfp)) diff --git a/version.lisp-expr b/version.lisp-expr index 88839c1..4d44392 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.41.25" +"1.0.41.26" -- 1.7.10.4