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

Alessio Stalla astalla at common-lisp.net
Fri Jan 14 20:24:19 UTC 2011


Author: astalla
Date: Fri Jan 14 15:24:18 2011
New Revision: 13148

Log:
Restored disassembly for compiled functions loaded from FASLs by always storing the class bytes greedily.


Modified:
   trunk/abcl/src/org/armedbear/lisp/FaslClassLoader.java

Modified: trunk/abcl/src/org/armedbear/lisp/FaslClassLoader.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/FaslClassLoader.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/FaslClassLoader.java	Fri Jan 14 15:24:18 2011
@@ -39,8 +39,7 @@
 
 public class FaslClassLoader extends JavaClassLoader {
 
-    private String baseName;
-    private LispObject loader; //The function used to load FASL functions by number
+    private final String baseName;
     private final JavaObject boxedThis = new JavaObject(this);
 
     public FaslClassLoader(String baseName) {
@@ -63,13 +62,13 @@
             String internalName = "org/armedbear/lisp/" + name;
             Class<?> c = this.findLoadedClass(internalName);
 
-            if (c == null)
+            if (c == null) {
                 c = findClass(name);
-
+            }
             if (c != null) {
-                if (resolve)
+                if (resolve) {
                     resolveClass(c);
-
+                }
                 return c;
             }
         }
@@ -94,7 +93,7 @@
         Pathname pathname = new Pathname(name.substring("org/armedbear/lisp/".length()) + ".cls");
         return readFunctionBytes(pathname);
     }
-    
+
     public byte[] getFunctionClassBytes(Class<?> functionClass) {
         return getFunctionClassBytes(functionClass.getName());
     }
@@ -108,8 +107,10 @@
     public LispObject loadFunction(int fnNumber) {
         try {
             //Function name is fnIndex + 1
-            LispObject o = (LispObject) loadClass(baseName + "_" + (fnNumber + 1)).newInstance();
-            return o;
+            String name = baseName + "_" + (fnNumber + 1);
+            Function f = (Function) loadClass(name).newInstance();
+            f.setClassBytes(getFunctionClassBytes(name));
+            return f;
         } catch(Exception e) {
             if(e instanceof ControlTransfer) { throw (ControlTransfer) e; }
             Debug.trace(e);




More information about the armedbear-cvs mailing list