Changeset 12692
- Timestamp:
- 05/16/10 19:45:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r12691 r12692 751 751 752 752 (defun emit-push-variable-name (variable) 753 (multiple-value-bind 754 (name class) 755 (lookup-or-declare-symbol (variable-name variable)) 756 (emit 'getstatic class name +lisp-symbol+))) 753 (emit-load-symbol (variable-name variable))) 757 754 758 755 (defknown generate-instanceof-type-check-for-variable (t t) t) … … 2235 2232 (t (externalize-object symbol)))) 2236 2233 2237 (defun lookup-or-declare-symbol (symbol) 2238 "Returns the value-pair (VALUES field class) from which 2239 the Java object representing SYMBOL can be retrieved." 2234 (defun emit-load-symbol (symbol) 2235 "Loads a symbol, optionally after externalizing it." 2240 2236 (multiple-value-bind 2241 2237 (name class) 2242 2238 (lookup-known-symbol symbol) 2243 2239 (if name 2244 ( values name class)2245 ( values (declare-symbol symbol) *this-class*))))2240 (emit 'getstatic class name +lisp-symbol+) 2241 (emit 'getstatic *this-class* (declare-symbol symbol) +lisp-symbol+)))) 2246 2242 2247 2243 (defknown declare-function (symbol &optional setf) string) … … 2257 2253 (multiple-value-bind 2258 2254 (name class) 2259 (lookup-or-declare-symbol symbol) 2255 (lookup-known-symbol symbol) 2256 ;; This is a work-around for the fact that 2257 ;; EMIT-LOAD-SYMBOL can't be used due to the fact that 2258 ;; here we won't know where to send the code yet (the LET 2259 ;; selects between *code* and *static-code*, while 2260 ;; EMIT-LOAD-SYMBOL wants to modify those specials too 2261 (unless name 2262 (setf name (declare-symbol symbol) 2263 class *this-class*)) 2260 2264 (let (saved-code) 2261 2265 (let ((*code* (if *declare-inline* *code* *static-code*))) … … 3031 3035 (cond ((eq op (compiland-name *current-compiland*)) ; recursive call 3032 3036 (if (notinline-p op) 3033 (multiple-value-bind 3034 (name class) 3035 (lookup-or-declare-symbol op) 3036 (emit 'getstatic class name +lisp-symbol+)) 3037 (emit-load-symbol op) 3037 3038 (aload 0))) 3038 3039 (t 3039 (multiple-value-bind 3040 (name class) 3041 (lookup-or-declare-symbol op) 3042 (emit 'getstatic class name +lisp-symbol+)))) 3040 (emit-load-symbol op))) 3043 3041 (process-args args) 3044 3042 (if (or (<= *speed* *debug*) *require-stack-frame*) … … 5025 5023 (emit-move-from-stack target representation)) 5026 5024 ((symbolp obj) 5027 (multiple-value-bind 5028 (name class) 5029 (lookup-or-declare-symbol obj) 5030 (emit 'getstatic class name +lisp-symbol+)) 5025 (emit-load-symbol obj) 5031 5026 (emit-move-from-stack target representation)) 5032 5027 ((listp obj) … … 5268 5263 (emit-move-from-stack target)) 5269 5264 (t 5270 (multiple-value-bind 5271 (name class) 5272 (lookup-or-declare-symbol name) 5273 (emit 'getstatic class name +lisp-symbol+)) 5265 (emit-load-symbol name) 5274 5266 (emit-invokevirtual +lisp-object-class+ "getSymbolFunctionOrDie" 5275 5267 nil +lisp-object+) … … 5310 5302 (emit-move-from-stack target)) 5311 5303 (t 5312 (multiple-value-bind 5313 (name class) 5314 (lookup-or-declare-symbol (cadr name)) 5315 (emit 'getstatic class name +lisp-symbol+)) 5304 (emit-load-symbol (cadr name)) 5316 5305 (emit-invokevirtual +lisp-symbol-class+ 5317 5306 "getSymbolSetfFunctionOrDie" … … 7526 7515 (not (enclosed-by-runtime-bindings-creating-block-p 7527 7516 (variable-block variable)))) 7528 (multiple-value-bind 7529 (name class) 7530 (lookup-or-declare-symbol name) 7531 (emit 'getstatic class name +lisp-symbol+))) 7517 (emit-load-symbol name)) 7532 7518 (cond ((constantp name) 7533 7519 ;; "... a reference to a symbol declared with DEFCONSTANT always … … 7632 7618 ;; (format t "compiling pushSpecial~%") 7633 7619 (emit-push-current-thread) 7634 (multiple-value-bind 7635 (name class) 7636 (lookup-or-declare-symbol name) 7637 (emit 'getstatic class name +lisp-symbol+)) 7620 (emit-load-symbol name) 7638 7621 (compile-forms-and-maybe-emit-clear-values (second value-form) 'stack nil) 7639 7622 (emit-invokevirtual +lisp-thread-class+ "pushSpecial" … … 7641 7624 (t 7642 7625 (emit-push-current-thread) 7643 (multiple-value-bind 7644 (name class) 7645 (lookup-or-declare-symbol name) 7646 (emit 'getstatic class name +lisp-symbol+)) 7626 (emit-load-symbol name) 7647 7627 (compile-forms-and-maybe-emit-clear-values value-form 'stack nil) 7648 7628 (emit-invokevirtual +lisp-thread-class+ "setSpecialVariable" … … 8129 8109 (emit 'iconst_1)) 8130 8110 ((nil) 8131 (multiple-value-bind 8132 (name class) 8133 (lookup-or-declare-symbol form) 8134 (emit 'getstatic class name +lisp-symbol+)))) 8111 (emit-load-symbol form))) 8135 8112 (emit-move-from-stack target representation)) 8136 8113 (t
Note: See TracChangeset
for help on using the changeset viewer.