- Timestamp:
- 07/06/10 22:34:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r12786 r12787 201 201 (defconstant +fasl-loader-class+ 202 202 "org/armedbear/lisp/FaslClassLoader") 203 (defconstant +lisp-class-class+ "org/armedbear/lisp/LispClass")204 203 (defconstant +lisp-object-class+ "org/armedbear/lisp/LispObject") 205 204 (defconstant +lisp-object+ "Lorg/armedbear/lisp/LispObject;") 206 205 (defconstant +lisp-object-array+ "[Lorg/armedbear/lisp/LispObject;") 207 206 (defconstant +closure-binding-array+ "[Lorg/armedbear/lisp/ClosureBinding;") 208 (defconstant +closure-binding-class+ "org/armedbear/lisp/ClosureBinding")209 207 (defconstant +lisp-symbol-class+ "org/armedbear/lisp/Symbol") 210 208 (defconstant +lisp-symbol+ "Lorg/armedbear/lisp/Symbol;") … … 212 210 (defconstant +lisp-thread-class+ "org/armedbear/lisp/LispThread") 213 211 (defconstant +lisp-thread+ "Lorg/armedbear/lisp/LispThread;") 214 (defconstant +lisp-load-class+ "org/armedbear/lisp/Load")215 212 (defconstant +lisp-cons-class+ "org/armedbear/lisp/Cons") 216 213 (defconstant +lisp-cons+ "Lorg/armedbear/lisp/Cons;") … … 242 239 (defconstant +lisp-special-binding+ "Lorg/armedbear/lisp/SpecialBinding;") 243 240 (defconstant +lisp-special-binding-class+ "org/armedbear/lisp/SpecialBinding") 244 (defconstant +lisp-special-bindings-mark+ "Lorg/armedbear/lisp/SpecialBindingsMark;")245 (defconstant +lisp-special-bindings-mark-class+ "org/armedbear/lisp/SpecialBindingsMark")246 241 (defconstant +lisp-throw-class+ "org/armedbear/lisp/Throw") 247 242 (defconstant +lisp-return-class+ "org/armedbear/lisp/Return") 248 243 (defconstant +lisp-go-class+ "org/armedbear/lisp/Go") 249 (defconstant +lisp-compiled-closure-class+ "org/armedbear/lisp/CompiledClosure")250 244 (defconstant +lisp-primitive-class+ "org/armedbear/lisp/Primitive") 251 245 (defconstant +lisp-hash-table-class+ "org/armedbear/lisp/HashTable") 252 246 (defconstant +lisp-eql-hash-table-class+ "org/armedbear/lisp/EqlHashTable") 253 (defconstant +lisp-package-class+ "org/armedbear/lisp/Package")254 (defconstant +lisp-readtable-class+ "org/armedbear/lisp/Readtable")255 (defconstant +lisp-stream-class+ "org/armedbear/lisp/Stream")256 (defconstant +lisp-closure-class+ "org/armedbear/lisp/Closure")257 247 (defconstant +lisp-closure-parameter-class+ "org/armedbear/lisp/Closure$Parameter") 258 248 (defconstant +lisp-closure-parameter-array+ "[Lorg/armedbear/lisp/Closure$Parameter;") … … 786 776 (HASH-TABLE +lisp-hash-table-class+) 787 777 (FIXNUM +lisp-fixnum-class+) 788 (STREAM +lisp-stream -class+)778 (STREAM +lisp-stream+) 789 779 (STRING +lisp-abstract-string-class+) 790 780 (VECTOR +lisp-abstract-vector-class+))) … … 1865 1855 (emit-push-nil) 1866 1856 (emit-push-t)) ;; we don't need the actual supplied-p symbol 1867 (emit 'getstatic +lisp-closure -class+ "OPTIONAL" "I")1857 (emit 'getstatic +lisp-closure+ "OPTIONAL" "I") 1868 1858 (emit-invokespecial-init +lisp-closure-parameter-class+ 1869 1859 (list +lisp-symbol+ +lisp-object+ … … 1898 1888 (emit-constructor-lambda-list args) 1899 1889 (emit-invokespecial-init super (lisp-object-arg-types 2))) 1900 ((equal super +lisp-compiled-closure -class+)1890 ((equal super +lisp-compiled-closure+) ;;### only needs EQ when SUPER is guaranteed to be CLASS-NAME 1901 1891 (aload req-params-register) 1902 1892 (aload opt-params-register) … … 2135 2125 ((null (symbol-package symbol)) 2136 2126 (emit-push-constant-int (dump-uninterned-symbol-index symbol)) 2137 (emit-invokestatic +lisp-load -class+ "getUninternedSymbol" '("I")2127 (emit-invokestatic +lisp-load+ "getUninternedSymbol" '("I") 2138 2128 +lisp-object+) 2139 2129 (emit 'checkcast +lisp-symbol-class+)) … … 3053 3043 (emit-push-constant-int 0) ;; srcPos 3054 3044 (emit-push-constant-int (length *closure-variables*)) 3055 (emit 'anewarray + closure-binding-class+) ;; dest3045 (emit 'anewarray +lisp-closure-binding+) ;; dest 3056 3046 (emit 'dup) 3057 3047 (astore register) ;; save dest value … … 3102 3092 ; Stack: template-function 3103 3093 (when *closure-variables* 3104 (emit 'checkcast +lisp-compiled-closure -class+)3094 (emit 'checkcast +lisp-compiled-closure+) 3105 3095 (duplicate-closure-array compiland) 3106 3096 (emit-invokestatic +lisp+ "makeCompiledClosure" … … 3392 3382 3393 3383 (defun p2-test-packagep (form) 3394 (p2-test-instanceof-predicate form +lisp-package -class+))3384 (p2-test-instanceof-predicate form +lisp-package+)) 3395 3385 3396 3386 (defun p2-test-rationalp (form) … … 3932 3922 (defun emit-new-closure-binding (variable) 3933 3923 "" 3934 (emit 'new + closure-binding-class+) ;; value c-b3924 (emit 'new +lisp-closure-binding+) ;; value c-b 3935 3925 (emit 'dup_x1) ;; c-b value c-b 3936 3926 (emit 'swap) ;; c-b c-b value 3937 (emit-invokespecial-init + closure-binding-class+3927 (emit-invokespecial-init +lisp-closure-binding+ 3938 3928 (list +lisp-object+)) ;; c-b 3939 3929 (aload (compiland-closure-register *current-compiland*)) … … 4236 4226 (emit 'aaload) 4237 4227 (emit-swap representation nil) 4238 (emit 'putfield + closure-binding-class+ "value" +lisp-object+))4228 (emit 'putfield +lisp-closure-binding+ "value" +lisp-object+)) 4239 4229 ((variable-environment variable) 4240 4230 (assert (not *file-compilation*)) … … 4268 4258 (emit-push-constant-int (variable-closure-index variable)) 4269 4259 (emit 'aaload) 4270 (emit 'getfield + closure-binding-class+ "value" +lisp-object+))4260 (emit 'getfield +lisp-closure-binding+ "value" +lisp-object+)) 4271 4261 ((variable-environment variable) 4272 4262 (assert (not *file-compilation*)) … … 4654 4644 4655 4645 (defun p2-packagep (form target representation) 4656 (p2-instanceof-predicate form target representation +lisp-package -class+))4646 (p2-instanceof-predicate form target representation +lisp-package+)) 4657 4647 4658 4648 (defun p2-readtablep (form target representation) 4659 (p2-instanceof-predicate form target representation +lisp-readtable -class+))4649 (p2-instanceof-predicate form target representation +lisp-readtable+)) 4660 4650 4661 4651 (defun p2-simple-vector-p (form target representation) … … 4956 4946 (dformat t "(compiland-closure-register parent) = ~S~%" 4957 4947 (compiland-closure-register parent)) 4958 (emit 'checkcast +lisp-compiled-closure -class+)4948 (emit 'checkcast +lisp-compiled-closure+) 4959 4949 (duplicate-closure-array parent) 4960 4950 (emit-invokestatic +lisp+ "makeCompiledClosure" … … 5086 5076 5087 5077 (when (compiland-closure-register *current-compiland*) 5088 (emit 'checkcast +lisp-compiled-closure -class+)5078 (emit 'checkcast +lisp-compiled-closure+) 5089 5079 (duplicate-closure-array *current-compiland*) 5090 5080 (emit-invokestatic +lisp+ "makeCompiledClosure" … … 5624 5614 (compile-forms-and-maybe-emit-clear-values arg1 'stack nil) 5625 5615 (emit-push-constant-int 1) ; errorp 5626 (emit-invokestatic +lisp-class -class+ "findClass"5616 (emit-invokestatic +lisp-class+ "findClass" 5627 5617 (list +lisp-object+ "Z") +lisp-object+) 5628 5618 (fix-boxing representation nil) … … 5632 5622 (compile-forms-and-maybe-emit-clear-values arg1 'stack nil 5633 5623 arg2 'stack :boolean) 5634 (emit-invokestatic +lisp-class -class+ "findClass"5624 (emit-invokestatic +lisp-class+ "findClass" 5635 5625 (list +lisp-object+ "Z") +lisp-object+) 5636 5626 (fix-boxing representation nil) … … 5810 5800 (cond ((eq (derive-compiler-type arg) 'STREAM) 5811 5801 (compile-forms-and-maybe-emit-clear-values arg 'stack nil) 5812 (emit 'checkcast +lisp-stream -class+)5813 (emit-invokevirtual +lisp-stream -class+ "getElementType"5802 (emit 'checkcast +lisp-stream+) 5803 (emit-invokevirtual +lisp-stream+ "getElementType" 5814 5804 nil +lisp-object+) 5815 5805 (emit-move-from-stack target representation)) … … 5829 5819 (compile-form arg1 'stack :int) 5830 5820 (compile-form arg2 'stack nil) 5831 (emit 'checkcast +lisp-stream -class+)5821 (emit 'checkcast +lisp-stream+) 5832 5822 (maybe-emit-clear-values arg1 arg2) 5833 5823 (emit 'swap) 5834 (emit-invokevirtual +lisp-stream -class+ "_writeByte" '("I") nil)5824 (emit-invokevirtual +lisp-stream+ "_writeByte" '("I") nil) 5835 5825 (when target 5836 5826 (emit-push-nil) … … 5857 5847 (cond ((compiler-subtypep type1 'stream) 5858 5848 (compile-forms-and-maybe-emit-clear-values arg1 'stack nil) 5859 (emit 'checkcast +lisp-stream -class+)5849 (emit 'checkcast +lisp-stream+) 5860 5850 (emit-push-constant-int 1) 5861 5851 (emit-push-nil) 5862 (emit-invokevirtual +lisp-stream -class+ "readLine"5852 (emit-invokevirtual +lisp-stream+ "readLine" 5863 5853 (list "Z" +lisp-object+) +lisp-object+) 5864 5854 (emit-move-from-stack target)) … … 5871 5861 (cond ((and (compiler-subtypep type1 'stream) (null arg2)) 5872 5862 (compile-forms-and-maybe-emit-clear-values arg1 'stack nil) 5873 (emit 'checkcast +lisp-stream -class+)5863 (emit 'checkcast +lisp-stream+) 5874 5864 (emit-push-constant-int 0) 5875 5865 (emit-push-nil) 5876 (emit-invokevirtual +lisp-stream -class+ "readLine"5866 (emit-invokevirtual +lisp-stream+ "readLine" 5877 5867 (list "Z" +lisp-object+) +lisp-object+) 5878 5868 (emit-move-from-stack target) … … 7488 7478 (HASH-TABLE +lisp-hash-table-class+) 7489 7479 (FIXNUM +lisp-fixnum-class+) 7490 (STREAM +lisp-stream -class+)7480 (STREAM +lisp-stream+) 7491 7481 (STRING +lisp-abstract-string-class+) 7492 7482 (VECTOR +lisp-abstract-vector-class+))) … … 7950 7940 (defun write-class-file (class-file stream) 7951 7941 (let* ((super (abcl-class-file-superclass class-file)) 7952 (this-index (pool-class (abcl-class-file-class class-file))) 7953 (super-index (pool-class super)) 7942 (this (abcl-class-file-class class-file)) 7943 (this-index (pool-class (!class-name this))) 7944 (super-index (pool-class (!class-name super))) 7954 7945 (constructor (make-constructor super 7955 7946 (abcl-class-file-lambda-name class-file) … … 8103 8094 ;; if we're the ultimate parent: create the closure array 8104 8095 (emit-push-constant-int (length *closure-variables*)) 8105 (emit 'anewarray + closure-binding-class+))8096 (emit 'anewarray +lisp-closure-binding+)) 8106 8097 (progn 8107 8098 (aload 0) 8108 (emit 'getfield +lisp-compiled-closure -class+ "ctx"8099 (emit 'getfield +lisp-compiled-closure+ "ctx" 8109 8100 +closure-binding-array+) 8110 8101 (when local-closure-vars … … 8130 8121 (emit 'dup) ; array 8131 8122 (emit-push-constant-int i) 8132 (emit 'new + closure-binding-class+)8123 (emit 'new +lisp-closure-binding+) 8133 8124 (emit 'dup) 8134 8125 (cond … … 8148 8139 (t 8149 8140 (assert (not "Can't happen!!")))) 8150 (emit-invokespecial-init + closure-binding-class+8141 (emit-invokespecial-init +lisp-closure-binding+ 8151 8142 (list +lisp-object+)) 8152 8143 (emit 'aastore))))) … … 8248 8239 (if (or *hairy-arglist-p* 8249 8240 (and *child-p* *closure-variables*)) 8250 +lisp-compiled-closure -class+8241 +lisp-compiled-closure+ 8251 8242 +lisp-primitive-class+)) 8252 8243
Note: See TracChangeset
for help on using the changeset viewer.