code for type checks for types known at compile time that are smaller
than (SIGNED-BYTE 64) or (UNSIGNED-BYTE 64) and larger than FIXNUM, and
their COMPLEX variants.
+ * optimization: On x86 targets, more uses of ALIEN-FUNCALL during cross
+ compilation now inline the INVOKE-WITH-SAVED-FP-AND-PC dance.
changes in sbcl-1.1.7 relative to sbcl-1.1.6:
* enhancement: TRACE :PRINT-ALL handles multiple-valued forms.
("src/code/parse-defmacro") ; on host for PARSE-DEFMACRO
("src/compiler/deftype") ; on host for SB!XC:DEFTYPE
("src/compiler/defconstant")
- ("src/code/early-alieneval") ; for vars needed both at build and run time
+ ("src/code/early-alieneval") ; for funs and vars needed at build and run time
("src/code/specializable-array")
"%DEREF-ADDR" "%HEAP-ALIEN" "%HEAP-ALIEN-ADDR"
"%LOCAL-ALIEN-ADDR" "%LOCAL-ALIEN-FORCED-TO-MEMORY-P" "%SAP-ALIEN"
"%SET-DEREF" "%SET-HEAP-ALIEN" "%SET-LOCAL-ALIEN" "%SET-SLOT"
- "%SLOT-ADDR" "*VALUES-TYPE-OKAY*" "ALIEN-ARRAY-TYPE"
+ "%SLOT-ADDR" "*SAVED-FP-AND-PCS*" "*VALUES-TYPE-OKAY*"
+ "ALIEN-ARRAY-TYPE"
"ALIEN-ARRAY-TYPE-DIMENSIONS" "ALIEN-ARRAY-TYPE-ELEMENT-TYPE"
"ALIEN-ARRAY-TYPE-P" "ALIEN-BOOLEAN-TYPE" "ALIEN-BOOLEAN-TYPE-P"
"ALIEN-CALLBACK"
"DEPORT" "DEPORT-ALLOC"
"DISPOSE-LOCAL-ALIEN"
"*ENTER-ALIEN-CALLBACK*" "ENTER-ALIEN-CALLBACK"
+ "FIND-SAVED-FP-AND-PC"
"HEAP-ALIEN-INFO" "HEAP-ALIEN-INFO-P" "HEAP-ALIEN-INFO-SAP-FORM"
- "HEAP-ALIEN-INFO-TYPE" "INVOKE-ALIEN-TYPE-METHOD" "LOCAL-ALIEN"
+ "HEAP-ALIEN-INFO-TYPE" "INVOKE-ALIEN-TYPE-METHOD"
+ "INVOKE-WITH-SAVED-FP-AND-PC" "LOCAL-ALIEN"
"LOCAL-ALIEN-INFO" "LOCAL-ALIEN-INFO-FORCE-TO-MEMORY-P"
"LOCAL-ALIEN-INFO-P" "LOCAL-ALIEN-INFO-TYPE"
"MAKE-ALIEN-FUN-TYPE" "MAKE-ALIEN-POINTER-TYPE"
"PHYSENV-DEBUG-LIVE-TN" "PHYSENV-LIVE-TN"
"FAST-SYMBOL-VALUE"
"FAST-SYMBOL-GLOBAL-VALUE"
- "FIND-SAVED-FP-AND-PC"
"FIXUP-NOTE-KIND"
"FIXUP-NOTE-FIXUP"
"FIXUP-NOTE-POSITION"
(setf (frame-number frame) number)))
(defun find-saved-frame-down (fp up-frame)
- (multiple-value-bind (saved-fp saved-pc) (sb!c:find-saved-fp-and-pc fp)
+ (multiple-value-bind (saved-fp saved-pc)
+ (sb!alien-internals:find-saved-fp-and-pc fp)
(when saved-fp
(compute-calling-frame (descriptor-sap saved-fp)
(descriptor-sap saved-pc)
(defvar *values-type-okay* nil)
(defvar *default-c-string-external-format* nil)
+
+;;; Frame pointer, program counter conses. In each thread it's bound
+;;; locally or not bound at all.
+(defvar *saved-fp-and-pcs*)
+
+#!+:c-stack-is-control-stack
+(declaim (inline invoke-with-saved-fp-and-pc))
+#!+:c-stack-is-control-stack
+(defun invoke-with-saved-fp-and-pc (fn)
+ (declare #-sb-xc-host (muffle-conditions compiler-note)
+ (optimize (speed 3)))
+ (let* ((fp-and-pc (cons (sb!kernel:%caller-frame)
+ (sap-int (sb!kernel:%caller-pc)))))
+ (declare (truly-dynamic-extent fp-and-pc))
+ (let ((*saved-fp-and-pcs* (if (boundp '*saved-fp-and-pcs*)
+ (cons fp-and-pc *saved-fp-and-pcs*)
+ (list fp-and-pc))))
+ (declare (truly-dynamic-extent *saved-fp-and-pcs*))
+ (funcall fn))))
+
+(defun find-saved-fp-and-pc (fp)
+ (when (boundp '*saved-fp-and-pcs*)
+ (dolist (x *saved-fp-and-pcs*)
+ (when (#!+:stack-grows-downward-not-upward
+ sap>
+ #!-:stack-grows-downward-not-upward
+ sap<
+ (int-sap (get-lisp-obj-address (car x))) fp)
+ (return (values (car x) (cdr x)))))))
+
`(lambda (function ,@names)
(alien-funcall (deref function) ,@names))))
-;;; Frame pointer, program counter conses. In each thread it's bound
-;;; locally or not bound at all.
-(defvar *saved-fp-and-pcs*)
-
-#!+:c-stack-is-control-stack
-(declaim (inline invoke-with-saved-fp-and-pc))
-#!+:c-stack-is-control-stack
-(defun invoke-with-saved-fp-and-pc (fn)
- (declare #-sb-xc-host (muffle-conditions compiler-note)
- (optimize (speed 3)))
- (let* ((fp-and-pc (cons (%caller-frame)
- (sap-int (%caller-pc)))))
- (declare (truly-dynamic-extent fp-and-pc))
- (let ((*saved-fp-and-pcs* (if (boundp '*saved-fp-and-pcs*)
- (cons fp-and-pc *saved-fp-and-pcs*)
- (list fp-and-pc))))
- (declare (truly-dynamic-extent *saved-fp-and-pcs*))
- (funcall fn))))
-
-(defun find-saved-fp-and-pc (fp)
- (when (boundp '*saved-fp-and-pcs*)
- (dolist (x *saved-fp-and-pcs*)
- (when (#!+:stack-grows-downward-not-upward
- sap>
- #!-:stack-grows-downward-not-upward
- sap<
- (int-sap (get-lisp-obj-address (car x))) fp)
- (return (values (car x) (cdr x)))))))
-
(deftransform alien-funcall ((function &rest args) * * :node node :important t)
(let ((type (lvar-type function)))
(unless (alien-type-type-p type)