Re: [armedbear-devel] [armedbear-cvs] r12226 - trunk/abcl/src/org/armedbear/lisp
Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp (original) +++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Sun Oct 25 18:35:52 2009 @@ -1948,6 +1948,8 @@ (when (plusp (length output)) output)))
+(defvar *declare-inline* nil) + (defmacro declare-with-hashtable (declared-item hashtable hashtable-var item-var &body body) `(let* ((,hashtable-var ,hashtable) @@ -1970,19 +1972,19 @@ (declare-object symbol +lisp-symbol+ +lisp-symbol-class+)))) (t - (let ((*code* *static-code*) - (s (sanitize symbol))) - (setf g (symbol-name (gensym "SYM"))) - (when s - (setf g (concatenate 'string g "_" s))) - (declare-field g +lisp-symbol+ +field-access-private+) - (emit 'ldc (pool-string (symbol-name symbol))) - (emit 'ldc (pool-string (package-name (symbol-package symbol)))) - (emit-invokestatic +lisp-class+ "internInPackage" - (list +java-string+ +java-string+) +lisp-symbol+) - (emit 'putstatic *this-class* g +lisp-symbol+) - (setf *static-code* *code*) - (setf (gethash symbol ht) g)))))) + (let ((*code* *static-code*) + (s (sanitize symbol))) + (setf g (symbol-name (gensym "SYM"))) + (when s + (setf g (concatenate 'string g "_" s))) + (declare-field g +lisp-symbol+ +field-access-private+) + (emit 'ldc (pool-string (symbol-name symbol))) + (emit 'ldc (pool-string (package-name (symbol-package symbol)))) + (emit-invokestatic +lisp-class+ "internInPackage" + (list +java-string+ +java-string+) +lisp-symbol+) + (emit 'putstatic *this-class* g +lisp-symbol+) + (setf *static-code* *code*) + (setf (gethash symbol ht) g))))))
There's a thinko in the above hunk: it only re-indents, that was intentional. However, it assumes the package to intern into exist. When *declare-inline* is non-NIL, there's a fair chance the package hasn't been created at *static-code* time though. This means the symbol creation will need to happen in-line too. I'll fix this later today. Bye, Erik.
participants (1)
-
Erik Huelsmann