Changeset 12709
- Timestamp:
- 05/19/10 21:14:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r12708 r12709 752 752 753 753 (defun emit-push-variable-name (variable) 754 (emit-load- symbol(variable-name variable)))754 (emit-load-externalized-object (variable-name variable))) 755 755 756 756 (defknown generate-instanceof-type-check-for-variable (t t) t) … … 2144 2144 (defun serialize-symbol (symbol) 2145 2145 "Generate code to restore a serialized symbol." 2146 (cond 2147 ((null (symbol-package symbol)) 2148 ;; we need to read the #?<n> syntax for uninterned symbols 2149 2150 ;; TODO: we could use the byte code variant of 2151 ;; Load._FASL_UNINTERNED_SYMBOLS_.symbolValue(LispThread.currentThread()) 2152 ;; .aref(<index) 2153 ;; to eliminate the reader dependency 2154 (serialize-object symbol) 2155 (emit 'checkcast +lisp-symbol-class+)) 2156 ((keywordp symbol) 2157 (emit 'ldc (pool-string (symbol-name symbol))) 2158 (emit-invokestatic +lisp-class+ "internKeyword" 2159 (list +java-string+) +lisp-symbol+)) 2160 (t 2161 (emit 'ldc (pool-string (symbol-name symbol))) 2162 (emit 'ldc (pool-string (package-name (symbol-package symbol)))) 2163 (emit-invokestatic +lisp-class+ "internInPackage" 2164 (list +java-string+ +java-string+) 2165 +lisp-symbol+)))) 2146 (multiple-value-bind 2147 (name class) 2148 (lookup-known-symbol symbol) 2149 (cond 2150 (name 2151 (emit 'getstatic class name +lisp-symbol+)) 2152 ((null (symbol-package symbol)) 2153 ;; we need to read the #?<n> syntax for uninterned symbols 2154 2155 ;; TODO: we could use the byte code variant of 2156 ;; Load._FASL_UNINTERNED_SYMBOLS_.symbolValue(LispThread.currentThread()) 2157 ;; .aref(<index) 2158 ;; to eliminate the reader dependency 2159 (serialize-object symbol) 2160 (emit 'checkcast +lisp-symbol-class+)) 2161 ((keywordp symbol) 2162 (emit 'ldc (pool-string (symbol-name symbol))) 2163 (emit-invokestatic +lisp-class+ "internKeyword" 2164 (list +java-string+) +lisp-symbol+)) 2165 (t 2166 (emit 'ldc (pool-string (symbol-name symbol))) 2167 (emit 'ldc (pool-string (package-name (symbol-package symbol)))) 2168 (emit-invokestatic +lisp-class+ "internInPackage" 2169 (list +java-string+ +java-string+) 2170 +lisp-symbol+))))) 2166 2171 2167 2172 (defvar serialization-table … … 2245 2250 field-type))) 2246 2251 2247 (defun emit-load-symbol (symbol)2248 "Loads a symbol, optionally after externalizing it."2249 (multiple-value-bind2250 (name class)2251 (lookup-known-symbol symbol)2252 (if name2253 (emit 'getstatic class name +lisp-symbol+)2254 (emit-load-externalized-object symbol))))2255 2256 2252 (defknown declare-function (symbol &optional setf) string) 2257 2253 (defun declare-function (symbol &optional setf) … … 2268 2264 (lookup-known-symbol symbol) 2269 2265 ;; This is a work-around for the fact that 2270 ;; EMIT-LOAD- SYMBOLcan't be used due to the fact that2266 ;; EMIT-LOAD-EXTERNALIZED-OBJECT can't be used due to the fact that 2271 2267 ;; here we won't know where to send the code yet (the LET 2272 2268 ;; selects between *code* and *static-code*, while 2273 ;; EMIT-LOAD- SYMBOLwants to modify those specials too2269 ;; EMIT-LOAD-EXTERNALIZED-OBJECT wants to modify those specials too 2274 2270 (unless name 2275 2271 (setf name (if *file-compilation* … … 2971 2967 (cond ((eq op (compiland-name *current-compiland*)) ; recursive call 2972 2968 (if (notinline-p op) 2973 (emit-load- symbolop)2969 (emit-load-externalized-object op) 2974 2970 (aload 0))) 2975 2971 (t 2976 (emit-load- symbolop)))2972 (emit-load-externalized-object op))) 2977 2973 (process-args args) 2978 2974 (if (or (<= *speed* *debug*) *require-stack-frame*) … … 4937 4933 (emit-move-from-stack target representation)) 4938 4934 ((symbolp obj) 4939 (emit-load- symbolobj)4935 (emit-load-externalized-object obj) 4940 4936 (emit-move-from-stack target representation)) 4941 4937 ((listp obj) … … 5172 5168 (emit-move-from-stack target)) 5173 5169 (t 5174 (emit-load- symbolname)5170 (emit-load-externalized-object name) 5175 5171 (emit-invokevirtual +lisp-object-class+ "getSymbolFunctionOrDie" 5176 5172 nil +lisp-object+) … … 5210 5206 (emit-move-from-stack target)) 5211 5207 (t 5212 (emit-load- symbol(cadr name))5208 (emit-load-externalized-object (cadr name)) 5213 5209 (emit-invokevirtual +lisp-symbol-class+ 5214 5210 "getSymbolSetfFunctionOrDie" … … 7423 7419 (not (enclosed-by-runtime-bindings-creating-block-p 7424 7420 (variable-block variable)))) 7425 (emit-load- symbolname))7421 (emit-load-externalized-object name)) 7426 7422 (cond ((constantp name) 7427 7423 ;; "... a reference to a symbol declared with DEFCONSTANT always … … 7526 7522 ;; (format t "compiling pushSpecial~%") 7527 7523 (emit-push-current-thread) 7528 (emit-load- symbolname)7524 (emit-load-externalized-object name) 7529 7525 (compile-forms-and-maybe-emit-clear-values (second value-form) 'stack nil) 7530 7526 (emit-invokevirtual +lisp-thread-class+ "pushSpecial" … … 7532 7528 (t 7533 7529 (emit-push-current-thread) 7534 (emit-load- symbolname)7530 (emit-load-externalized-object name) 7535 7531 (compile-forms-and-maybe-emit-clear-values value-form 'stack nil) 7536 7532 (emit-invokevirtual +lisp-thread-class+ "setSpecialVariable" … … 8017 8013 (emit 'iconst_1)) 8018 8014 ((nil) 8019 (emit-load- symbolform)))8015 (emit-load-externalized-object form))) 8020 8016 (emit-move-from-stack target representation)) 8021 8017 (t
Note: See TracChangeset
for help on using the changeset viewer.