[armedbear-cvs] r11502 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Dec 28 23:09:49 UTC 2008


Author: ehuelsmann
Date: Sun Dec 28 23:09:49 2008
New Revision: 11502

Log:
Introduce mnemonic for (emit 'getstatic ....) to load a symbol naming the variable.

Modified:
   trunk/abcl/src/org/armedbear/lisp/compiler-pass2.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 Dec 28 23:09:49 2008
@@ -468,6 +468,10 @@
         (emit-push-constant-int (variable-index variable))
         (emit 'aaload))))
 
+(defun emit-push-variable-name (variable)
+  (emit 'getstatic *this-class* (declare-symbol (variable-name variable))
+        +lisp-symbol+))
+
 (defknown generate-instanceof-type-check-for-variable (t t) t)
 (defun generate-instanceof-type-check-for-variable (variable expected-type)
   "Generate a type check for `variable'.
@@ -3799,8 +3803,7 @@
         ((variable-special-p variable)
          (emit-push-current-thread)
          (emit 'swap)
-         (emit 'getstatic *this-class*
-               (declare-symbol (variable-name variable)) +lisp-symbol+)
+         (emit-push-variable-name variable)
          (emit 'swap)
          (emit-invokevirtual +lisp-thread-class+ "bindSpecial"
                              (list +lisp-symbol+ +lisp-object+) nil))
@@ -4087,8 +4090,7 @@
                       (eq initform (variable-name variable)))
                  ;; The special case of binding a special to its current value.
                  (emit-push-current-thread)
-                 (emit 'getstatic *this-class*
-                       (declare-symbol (variable-name variable)) +lisp-symbol+)
+                 (emit-push-variable-name variable)
                  (emit-invokevirtual +lisp-thread-class+
                                      "bindSpecialToCurrentValue"
                                      (list +lisp-symbol+)
@@ -8671,17 +8673,14 @@
       (when (variable-special-p variable)
         (cond ((variable-register variable)
                (emit-push-current-thread)
-               (emit 'getstatic *this-class*
-                     (declare-symbol (variable-name variable))
-                     +lisp-symbol+)
+               (emit-push-variable-name variable)
                (emit 'aload (variable-register variable))
                (emit-invokevirtual +lisp-thread-class+ "bindSpecial"
                                    (list +lisp-symbol+ +lisp-object+) nil)
                (setf (variable-register variable) nil))
               ((variable-index variable)
                (emit-push-current-thread)
-               (emit 'getstatic *this-class*
-                     (declare-symbol (variable-name variable)) +lisp-symbol+)
+               (emit-push-variable-name variable)
                (emit 'aload (compiland-argument-register compiland))
                (emit-push-constant-int (variable-index variable))
                (emit 'aaload)




More information about the armedbear-cvs mailing list