Update of /cvsroot/sbcl/sbcl/src/compiler/x86-64
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1033/src/compiler/x86-64
Modified Files:
alloc.lisp c-call.lisp cell.lisp macros.lisp show.lisp vm.lisp
Log Message:
0.8.21.21: fix & share EXTERN-ALIEN-NAME logic (fixes bug #373)
* move e-a-n from SB-VM to SB-SYS, and from target/vm.lisp
to foreign.lisp.
* move all e-a-n calls to FIND-FOREIGN-SYMBOL-IN-TABLE and
GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS.
* reader conditionalize e-a-n behaviour on :ELF and :MACH-O; explicitly
add the relevant feature for each OS in make-config.sh.
* delete unused file ppc/print.lisp (duplicates ppc/show.lisp).
* increment fasl-format number.
note: affects all backends; tested on ppc/darwin, x86/freebsd, and
sparc/sunos.
Index: alloc.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/alloc.lisp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- alloc.lisp 8 Jan 2005 09:41:51 -0000 1.3
+++ alloc.lisp 7 Apr 2005 08:00:44 -0000 1.4
@@ -105,7 +105,7 @@
(with-fixed-allocation (result fdefn-widetag fdefn-size node)
(storew name result fdefn-name-slot other-pointer-lowtag)
(storew nil-value result fdefn-fun-slot other-pointer-lowtag)
- (storew (make-fixup (extern-alien-name "undefined_tramp") :foreign)
+ (storew (make-fixup "undefined_tramp" :foreign)
result fdefn-raw-addr-slot other-pointer-lowtag))))
(define-vop (make-closure)
@@ -202,10 +202,10 @@
;; we might as well add in the object address here, too. (Adding entropy
;; is good, even if ANSI doesn't understand that.)
(inst imul temp
- (make-fixup (extern-alien-name "fast_random_state") :foreign)
+ (make-fixup "fast_random_state" :foreign)
1103515245)
(inst add temp 12345)
- (inst mov (make-fixup (extern-alien-name "fast_random_state") :foreign)
+ (inst mov (make-fixup "fast_random_state" :foreign)
temp)
;; We want a positive fixnum for the hash value, so discard the LS bits.
;;
Index: c-call.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/c-call.lisp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- c-call.lisp 17 Feb 2005 21:59:23 -0000 1.7
+++ c-call.lisp 7 Apr 2005 08:00:45 -0000 1.8
@@ -219,7 +219,7 @@
(:results (res :scs (sap-reg)))
(:result-types system-area-pointer)
(:generator 2
- (inst lea res (make-fixup (extern-alien-name foreign-symbol) :foreign))))
+ (inst lea res (make-fixup foreign-symbol :foreign))))
#!+linkage-table
(define-vop (foreign-symbol-dataref-address)
@@ -231,7 +231,7 @@
(:results (res :scs (sap-reg)))
(:result-types system-area-pointer)
(:generator 2
- (inst mov res (make-fixup (extern-alien-name foreign-symbol) :foreign-dataref))))
+ (inst mov res (make-fixup foreign-symbol :foreign-dataref))))
(define-vop (call-out)
(:args (function :scs (sap-reg))
Index: cell.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/cell.lisp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cell.lisp 6 Jan 2005 12:48:02 -0000 1.2
+++ cell.lisp 7 Apr 2005 08:00:45 -0000 1.3
@@ -262,7 +262,7 @@
fun-pointer-lowtag)))
(inst cmp type simple-fun-header-widetag)
(inst jmp :e normal-fn)
- (inst lea raw (make-fixup (extern-alien-name "closure_tramp") :foreign))
+ (inst lea raw (make-fixup "closure_tramp" :foreign))
NORMAL-FN
(storew function fdefn fdefn-fun-slot other-pointer-lowtag)
(storew raw fdefn fdefn-raw-addr-slot other-pointer-lowtag)
@@ -275,7 +275,7 @@
(:results (result :scs (descriptor-reg)))
(:generator 38
(storew nil-value fdefn fdefn-fun-slot other-pointer-lowtag)
- (storew (make-fixup (extern-alien-name "undefined_tramp") :foreign)
+ (storew (make-fixup "undefined_tramp" :foreign)
fdefn fdefn-raw-addr-slot other-pointer-lowtag)
(move result fdefn)))
Index: macros.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/macros.lisp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- macros.lisp 17 Mar 2005 22:51:45 -0000 1.3
+++ macros.lisp 7 Apr 2005 08:00:45 -0000 1.4
@@ -156,8 +156,7 @@
(declare (ignore ignored))
(inst push size)
(inst lea r13-tn (make-ea :qword
- :disp (make-fixup (extern-alien-name "alloc_tramp")
- :foreign)))
+ :disp (make-fixup "alloc_tramp" :foreign)))
(inst call r13-tn)
(inst pop alloc-tn)
(values))
@@ -171,14 +170,12 @@
(free-pointer
(make-ea :qword :disp
#!+sb-thread (* n-word-bytes thread-alloc-region-slot)
- #!-sb-thread (make-fixup (extern-alien-name "boxed_region")
- :foreign)
+ #!-sb-thread (make-fixup "boxed_region" :foreign)
:scale 1)) ; thread->alloc_region.free_pointer
(end-addr
(make-ea :qword :disp
#!+sb-thread (* n-word-bytes (1+ thread-alloc-region-slot))
- #!-sb-thread (make-fixup (extern-alien-name "boxed_region")
- :foreign 8)
+ #!-sb-thread (make-fixup "boxed_region" :foreign 8)
:scale 1))) ; thread->alloc_region.end_addr
(cond (in-elsewhere
(allocation-tramp alloc-tn size))
@@ -208,8 +205,7 @@
(declare (ignore ignored))
(inst push size)
(inst lea r13-tn (make-ea :qword
- :disp (make-fixup (extern-alien-name "alloc_tramp")
- :foreign)))
+ :disp (make-fixup "alloc_tramp" :foreign)))
(inst call r13-tn)
(inst pop alloc-tn)
(values))
Index: show.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/show.lisp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- show.lisp 6 Jan 2005 12:48:03 -0000 1.2
+++ show.lisp 7 Apr 2005 08:00:45 -0000 1.3
@@ -27,11 +27,10 @@
(:save-p t)
(:generator 100
(inst push object)
- (inst lea rax (make-fixup (extern-alien-name "debug_print") :foreign))
+ (inst lea rax (make-fixup "debug_print" :foreign))
(inst lea call-target
(make-ea :qword
- :disp (make-fixup (extern-alien-name "call_into_c")
- :foreign)))
+ :disp (make-fixup "call_into_c" :foreign)))
(inst call call-target)
(inst add rsp-tn n-word-bytes)
(move result rax)))
Index: vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/vm.lisp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- vm.lisp 6 Jan 2005 12:48:03 -0000 1.3
+++ vm.lisp 7 Apr 2005 08:00:46 -0000 1.4
@@ -466,21 +466,6 @@
(noise (symbol-name (sc-name sc))))))
;;; FIXME: Could this, and everything that uses it, be made #!+SB-SHOW?
-
-;;; The loader uses this to convert alien names to the form they need in
-;;; the symbol table (for example, prepending an underscore).
-
-;;; The loader uses this to convert alien names to the form they need in
-;;; the symbol table (for example, prepending an underscore).
-(defun extern-alien-name (name)
- (declare (type string name))
- ;; ELF ports currently don't need any prefix
- (typecase name
- (simple-base-string name)
- (base-string (coerce name 'simple-base-string))
- (t (handler-case (coerce name 'simple-base-string)
- (type-error () (error "invalid external alien name: ~S" name))))))
-
(defun dwords-for-quad (value)
(let* ((lo (logand value (1- (ash 1 32))))
(hi (ash value -32)))
|