There were some reports with FASLs becoming too large -- ie generating more .cls files than can be loaded in our loader method "<fasl-name>_0" because the code overflows the 64kB method size boundary.
The change below drastically reduces the size of the generated loader method, reducing the chances that people run into an issue. Of course, that can't be the final state, but it seems like a good option, as long as we don't implement the means to split this method. Implementing means to split specifically this method however, doesn't seem good enough: all of our methods have the potential of overrunning the 64kB boundary and it would be nice if we could implement general method-splitting logic instead, to be applied when methods overrun their 64kB boundary size.
This commit is in our upcoming release, aleviating (but not solving) the Big FASLs problem.
Bye,
Erik.
On Mon, Nov 8, 2010 at 11:34 PM, Erik Huelsmann ehuelsmann@common-lisp.net wrote:
Author: ehuelsmann Date: Mon Nov 8 17:34:18 2010 New Revision: 13013
Log: Reduce the impact of the fasl-loader "_0" class's maximum size of 64kB: this change reduces the size of pprint_0.cls from 23001 to 19380 bytes, a saving of 18.64%, which is probably much more when counting the size of the execute() method alone.
Modified: trunk/abcl/src/org/armedbear/lisp/compile-file.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/compile-file.lisp
--- trunk/abcl/src/org/armedbear/lisp/compile-file.lisp (original) +++ trunk/abcl/src/org/armedbear/lisp/compile-file.lisp Mon Nov 8 17:34:18 2010 @@ -679,7 +679,14 @@ (defun generate-loader-function () (let* ((basename (base-classname)) (expr `(lambda (fasl-loader fn-index)
- (identity fasl-loader) ;;to avoid unused arg
- (declare (type (integer 0 256000) fn-index))
- (identity fasl-loader) ;;to avoid unused arg
- (jvm::with-inline-code ()
- (jvm::emit 'jvm::aload 1)
- (jvm::emit-invokevirtual jvm::+lisp-object+ "javaInstance"
- nil jvm::+java-object+)
- (jvm::emit-checkcast +fasl-classloader+)
- (jvm::emit 'jvm::iload 2))
(ncase fn-index 0 ,(1- *class-number*) ,@(loop :for i :from 1 :to *class-number* @@ -687,20 +694,14 @@ (let* ((class (%format nil "org/armedbear/lisp/~A_~A" basename i)) (class-name (jvm::make-class-name class)))
- `(,(1- i)
- (jvm::with-inline-code ()
- (jvm::emit 'jvm::aload 1)
- (jvm::emit-invokevirtual jvm::+lisp-object+ "javaInstance"
- nil jvm::+java-object+)
- (jvm::emit-checkcast +fasl-classloader+)
- (jvm::emit 'jvm::dup)
- (jvm::emit-push-constant-int ,(1- i))
- (jvm::emit-new ,class-name)
- (jvm::emit 'jvm::dup)
- (jvm::emit-invokespecial-init ,class-name '())
- (jvm::emit-invokevirtual +fasl-classloader+
- `(,(1- i)
- (jvm::with-inline-code ()
- (jvm::emit-new ,class-name)
- (jvm::emit 'jvm::dup)
- (jvm::emit-invokespecial-init ,class-name '())
- (jvm::emit-invokevirtual +fasl-classloader+
"putFunction"
- (list :int jvm::+lisp-object+) jvm::+lisp-object+)
- (list :int jvm::+lisp-object+) jvm::+lisp-object+)
(jvm::emit 'jvm::pop)) t)))))) (classname (fasl-loader-classname))
armedbear-cvs mailing list armedbear-cvs@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-cvs
armedbear-devel@common-lisp.net