[armedbear-cvs] r12209 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Wed Oct 21 21:45:29 UTC 2009


Author: ehuelsmann
Date: Wed Oct 21 17:45:26 2009
New Revision: 12209

Log:
Reduce abcl.jar by ~10% and the number of objects in it by ~13%.

Note: This is due to the fact that single function calls no
  longer get compiled into lambda functions, but instead will
  be interpreted. For more information, study opcodes.abcl
  before and after this change.

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	Wed Oct 21 17:45:26 2009
@@ -372,6 +372,22 @@
 
 (declaim (ftype (function (t) t) convert-toplevel-form))
 (defun convert-toplevel-form (form)
+  (when (and (consp form)
+             (every #'(lambda (arg)
+                        (or (and (atom arg)
+                                 (not (and (symbolp arg)
+                                           (symbol-macro-p arg))))
+                            (and (consp arg)
+                                 (eq 'QUOTE (car arg)))))
+                    (cdr form)))
+    ;; single form with simple or constant arguments
+    ;; Without this exception, toplevel function calls
+    ;; will be compiled into lambdas which get compiled to
+    ;; compiled-functions. Those need to be loaded.
+    ;; Conclusion: Top level interpreting the function call
+    ;;  and its arguments may be (and should be) more efficient.
+    (return-from convert-toplevel-form
+      (precompiler:precompile-form form nil *compile-file-environment*)))
   (let* ((expr `(lambda () ,form))
          (classfile (next-classfile-name))
          (result




More information about the armedbear-cvs mailing list