X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fbackend.lisp;h=9e532ea69199faaa67185adfdea919108c4e4f10;hb=54da325f13fb41669869aea688ae195426c0e231;hp=4dbb9cb22fc36304f1b2caa404fb49a6b40df398;hpb=a98da03220d7345b066e4092285f0dfce55d9374;p=sbcl.git diff --git a/src/compiler/backend.lisp b/src/compiler/backend.lisp index 4dbb9cb..9e532ea 100644 --- a/src/compiler/backend.lisp +++ b/src/compiler/backend.lisp @@ -134,97 +134,51 @@ (defvar *backend-internal-errors* nil) (declaim (type (or simple-vector null) *backend-internal-errors*)) -;;;; VM support routines - -;;; FIXME: Do we need this kind of indirection for the VM support -;;; routines any more? - -;;; forward declaration -(defvar *backend-support-routines*) - -(macrolet ((def-vm-support-routines (&rest routines) - `(progn - (eval-when (:compile-toplevel :load-toplevel :execute) - (defparameter *vm-support-routines* ',routines)) - (defstruct (vm-support-routines (:copier nil)) - ,@(mapcar (lambda (routine) - `(,routine nil :type (or function null))) - routines)) - ,@(mapcar - (lambda (name) - `(defun ,name (&rest args) - (apply (or (,(symbolicate "VM-SUPPORT-ROUTINES-" - name) - *backend-support-routines*) - (error "machine-specific support ~S ~ - routine undefined" - ',name)) - args))) - routines)))) - - (def-vm-support-routines - - ;; from vm.lisp - immediate-constant-sc - location-print-name - combination-implementation-style - boxed-immediate-sc-p - - ;; from primtype.lisp - primitive-type-of - primitive-type - - ;; from c-call.lisp - make-call-out-tns - - ;; from call.lisp - standard-arg-location - make-return-pc-passing-location - make-old-fp-passing-location - make-old-fp-save-location - make-return-pc-save-location - make-arg-count-location - make-nfp-tn - make-stack-pointer-tn - make-number-stack-pointer-tn - make-unknown-values-locations - select-component-format - - ;; from nlx.lisp - make-nlx-sp-tn - make-dynamic-state-tns - make-nlx-entry-arg-start-location - - ;; from pred.lisp - convert-conditional-move-p - - ;; from support.lisp - generate-call-sequence - generate-return-sequence - - ;; for use with scheduler - emit-nop - location-number)) - -(defprinter (vm-support-routines)) - -(defmacro !def-vm-support-routine (name ll &body body) - (unless (member (intern (string name) (find-package "SB!C")) - *vm-support-routines*) - (warn "unknown VM support routine: ~A" name)) - (let ((local-name (symbolicate "IMPL-OF-VM-SUPPORT-ROUTINE-" name))) - `(progn - (defun ,local-name ,ll ,@body) - (setf (,(intern (concatenate 'simple-string - "VM-SUPPORT-ROUTINES-" - (string name)) - (find-package "SB!C")) - *backend-support-routines*) - #',local-name)))) - -;;; the VM support routines -(defvar *backend-support-routines* (make-vm-support-routines)) -(declaim (type vm-support-routines *backend-support-routines*)) +;;;; VM support routines which backends need to implement + +;;; from vm.lisp +;;; immediate-constant-sc +;;; location-print-name +;;; combination-implementation-style +;;; convert-conditional-move-p +;;; boxed-immediate-sc-p + +;;; from primtype.lisp +;;; primitive-type-of +;;; primitive-type + +;;; from c-call.lisp +;;; make-call-out-tns + +;;; from call.lisp +;;; standard-arg-location +;;; make-return-pc-passing-location +;;; make-old-fp-passing-location +;;; make-old-fp-save-location +;;; make-return-pc-save-location +;;; make-arg-count-location +;;; make-nfp-tn +;;; make-stack-pointer-tn +;;; make-number-stack-pointer-tn +;;; make-unknown-values-locations +;;; select-component-format + +;;; from nlx.lisp +;;; make-nlx-sp-tn +;;; make-dynamic-state-tns +;;; make-nlx-entry-arg-start-location + +;;; from pred.lisp +;;; convert-conditional-move-p + +;;; from support.lisp +;;; generate-call-sequence +;;; generate-return-sequence + +;;; for use with scheduler +;;; emit-nop +;;; location-number + ;;;; This is a prototype interface to support Christophe Rhodes' new ;;;; (sbcl-0.pre7.57) VOP :GUARD clauses for implementations which @@ -267,7 +221,8 @@ conditionalization. ;;; The default value of NIL means use only unguarded VOPs. The ;;; initial value is customizeable via ;;; customize-backend-subfeatures.lisp -(defvar *backend-subfeatures* '#.sb-cold:*shebang-backend-subfeatures*) +(defvar *backend-subfeatures* + '#.(sort (copy-list sb-cold:*shebang-backend-subfeatures*) #'string<)) ;;; possible *BACKEND-SUBFEATURES* values: ;;;