Changeset 13466
- Timestamp:
- 08/12/11 12:08:25 (12 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Autoload.java
r13445 r13466 707 707 autoload(PACKAGE_SYS, "get-fasl-function", "FaslClassLoader", false); 708 708 709 autoload(PACKAGE_SYS, "make-memory-class-loader", "MemoryClassLoader", false); 710 autoload(PACKAGE_SYS, "put-memory-function", "MemoryClassLoader", false); 711 autoload(PACKAGE_SYS, "get-memory-function", "MemoryClassLoader", false); 712 709 713 autoload(Symbol.SET_CHAR, "StringFunctions"); 710 714 autoload(Symbol.SET_SCHAR, "StringFunctions"); -
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r13464 r13466 49 49 pool-class pool-field pool-method pool-int 50 50 pool-float pool-long pool-double)) 51 52 (declaim (special *memory-class-loader*)) 51 53 52 54 (defun pool-name (name) … … 2207 2209 (t 2208 2210 (dformat t "compile-local-function-call default case~%") 2209 (let* ((g (if *file-compilation* 2210 (declare-local-function local-function) 2211 (declare-object 2212 (local-function-function local-function))))) 2211 (let* ((g (declare-local-function local-function))) 2213 2212 (emit-getstatic *this-class* g +lisp-object+) 2214 2213 ; Stack: template-function … … 4064 4063 (setf (local-function-class-file local-function) 4065 4064 (compiland-class-file compiland)) 4066 (setf (local-function-function local-function) 4067 (load-compiled-function 4068 (sys::%get-output-stream-bytes stream)))))))) 4065 (let ((bytes (sys::%get-output-stream-bytes stream))) 4066 (sys::put-memory-function *memory-class-loader* 4067 (class-name-internal 4068 (abcl-class-file-class-name 4069 (compiland-class-file compiland))) 4070 bytes))))))) 4069 4071 4070 4072 (defun emit-make-compiled-closure-for-labels … … 4097 4099 (setf (local-function-class-file local-function) 4098 4100 (compiland-class-file compiland)) 4099 (let ((g (declare-object 4100 (load-compiled-function 4101 (sys::%get-output-stream-bytes stream))))) 4101 (let* ((bytes (sys::%get-output-stream-bytes stream)) 4102 (g (declare-local-function local-function))) 4103 (sys::put-memory-function *memory-class-loader* 4104 (class-name-internal 4105 (abcl-class-file-class-name 4106 (compiland-class-file compiland))) 4107 bytes) 4102 4108 (emit-make-compiled-closure-for-labels 4103 local-function compiland g))))))) 4109 local-function compiland g) 4110 )))))) 4104 4111 4105 4112 (defknown p2-flet-node (t t t) t) … … 4153 4160 (with-open-stream (stream (sys::%make-byte-array-output-stream)) 4154 4161 (compile-and-write-to-stream compiland stream) 4155 (emit-load-externalized-object (load-compiled-function 4156 (sys::%get-output-stream-bytes stream)))))) 4162 (let ((bytes (sys::%get-output-stream-bytes stream))) 4163 (sys::put-memory-function *memory-class-loader* 4164 (class-name-internal 4165 (abcl-class-file-class-name 4166 (compiland-class-file compiland))) 4167 bytes) 4168 (emit-getstatic *this-class* 4169 (declare-local-function 4170 (make-local-function 4171 :class-file (compiland-class-file compiland))) 4172 +lisp-object+))))) 4157 4173 (cond ((null *closure-variables*)) ; Nothing to do. 4158 4174 ((compiland-closure-register *current-compiland*) … … 4186 4202 'stack nil)) 4187 4203 (t 4188 (let ((g (if *file-compilation* 4189 (declare-local-function local-function) 4190 (declare-object 4191 (local-function-function local-function))))) 4204 (let ((g (declare-local-function local-function))) 4192 4205 (emit-getstatic *this-class* g +lisp-object+) 4193 4206 ; Stack: template-function … … 4227 4240 'stack nil)) 4228 4241 (t 4229 (let ((g (if *file-compilation* 4230 (declare-local-function local-function) 4231 (declare-object 4232 (local-function-function local-function))))) 4242 (let ((g (declare-local-function local-function))) 4233 4243 (emit-getstatic *this-class* 4234 4244 g +lisp-object+))))) ; Stack: template-function … … 7381 7391 "Compiles a lambda expression `form'. If `filespec' is NIL, 7382 7392 a random Java class name is generated, if it is non-NIL, it's used 7383 to derive a Java class name from." 7393 to derive a Java class name from. 7394 7395 Returns the a abcl-class-file structure containing the description of the 7396 generated class." 7384 7397 (aver (eq (car form) 'LAMBDA)) 7385 7398 (catch 'compile-defun-abort … … 7403 7416 environment) 7404 7417 :class-file class-file) 7405 stream)))) 7418 stream) 7419 class-file))) 7406 7420 7407 7421 (defvar *catch-errors* t) … … 7497 7511 ;; This function is part of the call chain from COMPILE, but 7498 7512 ;; not COMPILE-FILE 7499 (let* (compiled-function) 7513 (let* (compiled-function 7514 (*memory-class-loader* (sys::make-memory-class-loader))) 7500 7515 (with-compilation-unit () 7501 7516 (with-saved-compiler-policy 7502 7517 (setf compiled-function 7503 (load-compiled-function 7504 (with-open-stream (s (sys::%make-byte-array-output-stream)) 7505 (compile-defun name expr env nil s nil) 7506 (finish-output s) 7507 (sys::%get-output-stream-bytes s)))))) 7518 (with-open-stream (s (sys::%make-byte-array-output-stream)) 7519 (let* ((class-file (compile-defun name expr env nil s nil)) 7520 (bytes (progn 7521 (finish-output s) 7522 (sys::%get-output-stream-bytes s))) 7523 (class-name (class-name-internal 7524 (abcl-class-file-class-name class-file)))) 7525 (sys::put-memory-function *memory-class-loader* 7526 class-name bytes) 7527 (sys::get-memory-function *memory-class-loader* 7528 class-name)))))) 7508 7529 (when (and name (functionp compiled-function)) 7509 7530 (sys::set-function-definition name compiled-function definition)) -
trunk/abcl/src/org/armedbear/lisp/jvm.lisp
r13448 r13466 381 381 compiland 382 382 inline-expansion 383 function ;; the function loaded through load-compiled-function384 383 class-file ;; the class file structure for this function 385 384 variable ;; the variable which contains the loaded compiled function
Note: See TracChangeset
for help on using the changeset viewer.