Changeset 12792


Ignore:
Timestamp:
07/08/10 22:15:43 (12 years ago)
Author:
ehuelsmann
Message:

CLASS-NAME integration for +lisp-symbol+.

Location:
branches/generic-class-file/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12791 r12792  
    202202(defconstant +lisp-object-array+ "[Lorg/armedbear/lisp/LispObject;")
    203203(defconstant +closure-binding-array+ "[Lorg/armedbear/lisp/ClosureBinding;")
    204 (defconstant +lisp-symbol-class+ "org/armedbear/lisp/Symbol")
    205 (defconstant +lisp-symbol+ "Lorg/armedbear/lisp/Symbol;")
    206204(defconstant +lisp-integer-class+ "org/armedbear/lisp/LispInteger")
    207205(defconstant +lisp-integer+ "Lorg/armedbear/lisp/LispInteger;")
     
    745743    (return-from generate-instanceof-type-check-for-variable))
    746744  (let ((instanceof-class (ecase expected-type
    747                             (SYMBOL     +lisp-symbol-class+)
     745                            (SYMBOL     +lisp-symbol+)
    748746                            (CHARACTER  +lisp-character-class+)
    749747                            (CONS       +lisp-cons+)
     
    762760    (emit 'ifne LABEL1)
    763761    (emit-load-local-variable variable)
    764     (emit 'getstatic +lisp-symbol-class+ expected-type-java-symbol-name
     762    (emit 'getstatic +lisp-symbol+ expected-type-java-symbol-name
    765763          +lisp-symbol+)
    766764    (emit-invokestatic +lisp+ "type_error"
     
    21012099       (emit-invokestatic +lisp-load+ "getUninternedSymbol" '("I")
    21022100                          +lisp-object+)
    2103        (emit 'checkcast +lisp-symbol-class+))
     2101       (emit 'checkcast +lisp-symbol+))
    21042102      ((keywordp symbol)
    21052103       (emit 'ldc (pool-string (symbol-name symbol)))
     
    21212119            ,+lisp-abstract-string+) ;; because of (not compile-file)
    21222120    (package "PKG" ,#'eq ,#'serialize-package ,+lisp-object+)
    2123     (symbol "SYM" ,#'eq ,#'serialize-symbol ,+!lisp-symbol+)
     2121    (symbol "SYM" ,#'eq ,#'serialize-symbol ,+lisp-symbol+)
    21242122    (T "OBJ" ,#'eq ,#'serialize-object ,+lisp-object+))
    21252123  "A list of 5-element lists. The elements of the sublists mean:
     
    22212219             (progn ;; generated by the DECLARE-OBJECT*'s above
    22222220               (emit 'getstatic class name +lisp-object+)
    2223                (emit 'checkcast +lisp-symbol-class+))
     2221               (emit 'checkcast +lisp-symbol+))
    22242222             (emit 'getstatic class name +lisp-symbol+))
    2225          (emit-invokevirtual +lisp-symbol-class+
     2223         (emit-invokevirtual +lisp-symbol+
    22262224                             (if setf
    22272225                                 "getSymbolSetfFunctionOrDie"
     
    33683366
    33693367(defun p2-test-symbolp (form)
    3370   (p2-test-instanceof-predicate form +lisp-symbol-class+))
     3368  (p2-test-instanceof-predicate form +lisp-symbol+))
    33713369
    33723370(defun p2-test-consp (form)
     
    46274625
    46284626(defun p2-symbolp (form target representation)
    4629   (p2-instanceof-predicate form target representation +lisp-symbol-class+))
     4627  (p2-instanceof-predicate form target representation +lisp-symbol+))
    46304628
    46314629(defun p2-vectorp (form target representation)
     
    50985096         (t
    50995097          (emit-load-externalized-object (cadr name))
    5100           (emit-invokevirtual +lisp-symbol-class+
     5098          (emit-invokevirtual +lisp-symbol+
    51015099                              "getSymbolSetfFunctionOrDie"
    51025100                              nil +lisp-object+)
     
    57245722         (emit 'dup)
    57255723         (compile-form (%cadr form) 'stack nil)
    5726          (emit 'checkcast +lisp-symbol-class+)
     5724         (emit 'checkcast +lisp-symbol+)
    57275725         (compile-form (%caddr form) 'stack nil)
    57285726         (maybe-emit-clear-values (%cadr form) (%caddr form))
     
    57445742           (emit 'dup)
    57455743           (compile-form (%car args) 'stack nil)
    5746            (emit 'checkcast +lisp-symbol-class+)
     5744           (emit 'checkcast +lisp-symbol+)
    57475745           (dolist (slot-form slot-forms)
    57485746             (compile-form slot-form 'stack nil))
     
    72097207           ;; "... a reference to a symbol declared with DEFCONSTANT always
    72107208           ;; refers to its global value."
    7211            (emit-invokevirtual +lisp-symbol-class+ "getSymbolValue"
     7209           (emit-invokevirtual +lisp-symbol+ "getSymbolValue"
    72127210                               nil +lisp-object+))
    72137211          ((and (variable-binding-register variable)
     
    72207218          (t
    72217219           (emit-push-current-thread)
    7222            (emit-invokevirtual +lisp-symbol-class+ "symbolValue"
     7220           (emit-invokevirtual +lisp-symbol+ "symbolValue"
    72237221                               (list +lisp-thread+) +lisp-object+)))
    72247222    (fix-boxing representation nil)
     
    72517249         (emit-push-current-thread)
    72527250         (compile-form (%cadr form) 'stack nil)
    7253          (emit 'checkcast +lisp-symbol-class+)
     7251         (emit 'checkcast +lisp-symbol+)
    72547252         (compile-form (%caddr form) 'stack nil)
    72557253         (maybe-emit-clear-values (%cadr form) (%caddr form))
     
    74037401    (cond ((and (eq (derive-compiler-type arg) 'SYMBOL) (< *safety* 3))
    74047402     (compile-forms-and-maybe-emit-clear-values arg 'stack nil)
    7405            (emit 'checkcast +lisp-symbol-class+)
    7406            (emit 'getfield  +lisp-symbol-class+ "name" +lisp-simple-string+)
     7403           (emit 'checkcast +lisp-symbol+)
     7404           (emit 'getfield  +lisp-symbol+ "name" +lisp-simple-string+)
    74077405           (emit-move-from-stack target representation))
    74087406          (t
     
    74157413    (cond ((and (eq (derive-compiler-type arg) 'SYMBOL) (< *safety* 3))
    74167414     (compile-forms-and-maybe-emit-clear-values arg 'stack nil)
    7417            (emit 'checkcast +lisp-symbol-class+)
    7418            (emit-invokevirtual +lisp-symbol-class+ "getPackage"
     7415           (emit 'checkcast +lisp-symbol+)
     7416           (emit-invokevirtual +lisp-symbol+ "getPackage"
    74197417                               nil +lisp-object+)
    74207418           (fix-boxing representation nil)
     
    74297427      (when (eq (derive-compiler-type arg) 'SYMBOL)
    74307428  (compile-forms-and-maybe-emit-clear-values arg 'stack nil)
    7431         (emit 'checkcast +lisp-symbol-class+)
     7429        (emit 'checkcast +lisp-symbol+)
    74327430        (emit-push-current-thread)
    7433         (emit-invokevirtual +lisp-symbol-class+ "symbolValue"
     7431        (emit-invokevirtual +lisp-symbol+ "symbolValue"
    74347432                            (list +lisp-thread+) +lisp-object+)
    74357433        (fix-boxing representation nil)
     
    74447442  (declare (type symbol expected-type))
    74457443  (let ((instanceof-class (ecase expected-type
    7446                             (SYMBOL     +lisp-symbol-class+)
     7444                            (SYMBOL     +lisp-symbol+)
    74477445                            (CHARACTER  +lisp-character-class+)
    74487446                            (CONS       +lisp-cons+)
     
    74607458    (emit 'instanceof instanceof-class)
    74617459    (emit 'ifne LABEL1)
    7462     (emit 'getstatic +lisp-symbol-class+ expected-type-java-symbol-name +lisp-symbol+)
     7460    (emit 'getstatic +lisp-symbol+ expected-type-java-symbol-name +lisp-symbol+)
    74637461    (emit-invokestatic +lisp+ "type_error"
    74647462                       (lisp-object-arg-types 2) +lisp-object+)
  • branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

    r12791 r12792  
    110110(define-class-name +lisp-nil+ "org.armedbear.lisp.Nil")
    111111(define-class-name +lisp-class+ "org.armedbear.lisp.LispClass")
    112 (define-class-name +!lisp-symbol+ "org.armedbear.lisp.Symbol")
     112(define-class-name +lisp-symbol+ "org.armedbear.lisp.Symbol")
    113113(define-class-name +lisp-thread+ "org.armedbear.lisp.LispThread")
    114114(define-class-name +lisp-closure-binding+ "org.armedbear.lisp.ClosureBinding")
Note: See TracChangeset for help on using the changeset viewer.