Ignore:
Timestamp:
05/19/10 21:14:03 (13 years ago)
Author:
ehuelsmann
Message:

Merge EMIT-LOAD-SYMBOL into EMIT-LOAD-EXTERNALIZED-OBJECT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12708 r12709  
    752752
    753753(defun emit-push-variable-name (variable)
    754   (emit-load-symbol (variable-name variable)))
     754  (emit-load-externalized-object (variable-name variable)))
    755755
    756756(defknown generate-instanceof-type-check-for-variable (t t) t)
     
    21442144(defun serialize-symbol (symbol)
    21452145  "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+)))))
    21662171
    21672172(defvar serialization-table
     
    22452250      field-type)))
    22462251
    2247 (defun emit-load-symbol (symbol)
    2248   "Loads a symbol, optionally after externalizing it."
    2249   (multiple-value-bind
    2250         (name class)
    2251       (lookup-known-symbol symbol)
    2252     (if name
    2253         (emit 'getstatic class name +lisp-symbol+)
    2254         (emit-load-externalized-object symbol))))
    2255 
    22562252(defknown declare-function (symbol &optional setf) string)
    22572253(defun declare-function (symbol &optional setf)
     
    22682264       (lookup-known-symbol symbol)
    22692265     ;; This is a work-around for the fact that
    2270      ;; EMIT-LOAD-SYMBOL can't be used due to the fact that
     2266     ;; EMIT-LOAD-EXTERNALIZED-OBJECT can't be used due to the fact that
    22712267     ;; here we won't know where to send the code yet (the LET
    22722268     ;; selects between *code* and *static-code*, while
    2273      ;; EMIT-LOAD-SYMBOL wants to modify those specials too
     2269     ;; EMIT-LOAD-EXTERNALIZED-OBJECT wants to modify those specials too
    22742270     (unless name
    22752271        (setf name (if *file-compilation*
     
    29712967      (cond ((eq op (compiland-name *current-compiland*)) ; recursive call
    29722968             (if (notinline-p op)
    2973                  (emit-load-symbol op)
     2969                 (emit-load-externalized-object op)
    29742970                 (aload 0)))
    29752971            (t
    2976              (emit-load-symbol op)))
     2972             (emit-load-externalized-object op)))
    29772973      (process-args args)
    29782974      (if (or (<= *speed* *debug*) *require-stack-frame*)
     
    49374933           (emit-move-from-stack target representation))
    49384934          ((symbolp obj)
    4939            (emit-load-symbol obj)
     4935           (emit-load-externalized-object obj)
    49404936           (emit-move-from-stack target representation))
    49414937          ((listp obj)
     
    51725168          (emit-move-from-stack target))
    51735169         (t
    5174           (emit-load-symbol name)
     5170          (emit-load-externalized-object name)
    51755171          (emit-invokevirtual +lisp-object-class+ "getSymbolFunctionOrDie"
    51765172                              nil +lisp-object+)
     
    52105206          (emit-move-from-stack target))
    52115207         (t
    5212           (emit-load-symbol (cadr name))
     5208          (emit-load-externalized-object (cadr name))
    52135209          (emit-invokevirtual +lisp-symbol-class+
    52145210                              "getSymbolSetfFunctionOrDie"
     
    74237419                 (not (enclosed-by-runtime-bindings-creating-block-p
    74247420                       (variable-block variable))))
    7425       (emit-load-symbol name))
     7421      (emit-load-externalized-object name))
    74267422    (cond ((constantp name)
    74277423           ;; "... a reference to a symbol declared with DEFCONSTANT always
     
    75267522;;              (format t "compiling pushSpecial~%")
    75277523             (emit-push-current-thread)
    7528              (emit-load-symbol name)
     7524             (emit-load-externalized-object name)
    75297525       (compile-forms-and-maybe-emit-clear-values (second value-form) 'stack nil)
    75307526             (emit-invokevirtual +lisp-thread-class+ "pushSpecial"
     
    75327528            (t
    75337529             (emit-push-current-thread)
    7534              (emit-load-symbol name)
     7530             (emit-load-externalized-object name)
    75357531       (compile-forms-and-maybe-emit-clear-values value-form 'stack nil)
    75367532             (emit-invokevirtual +lisp-thread-class+ "setSpecialVariable"
     
    80178013                   (emit 'iconst_1))
    80188014                  ((nil)
    8019                    (emit-load-symbol form)))
     8015                   (emit-load-externalized-object form)))
    80208016                (emit-move-from-stack target representation))
    80218017               (t
Note: See TracChangeset for help on using the changeset viewer.