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

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Jul 26 20:33:31 UTC 2009


Author: ehuelsmann
Date: Sun Jul 26 16:33:16 2009
New Revision: 12063

Log:
Do stack frame handling only in LispThread;
dispatch funcall to the execute() methods there.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Sun Jul 26 16:33:16 2009
@@ -140,58 +140,38 @@
                                          LispThread thread)
     throws ConditionThrowable
   {
-    LispObject stack = thread.getStack();
-    thread.pushStackFrame(fun, args);
     thread._values = null;
-    LispObject result;
-    if (profiling)
-      if (!sampling)
-        fun.incrementCallCount();
-    try
-      {
-        switch (args.length)
-          {
-          case 0:
-            result = fun.execute();
-            break;
-          case 1:
-            result = fun.execute(args[0]);
-            break;
-          case 2:
-            result = fun.execute(args[0], args[1]);
-            break;
-          case 3:
-            result = fun.execute(args[0], args[1], args[2]);
-            break;
-          case 4:
-            result = fun.execute(args[0], args[1], args[2], args[3]);
-            break;
-          case 5:
-            result = fun.execute(args[0], args[1], args[2], args[3],
-                                 args[4]);
-            break;
-          case 6:
-            result = fun.execute(args[0], args[1], args[2], args[3],
-                                 args[4], args[5]);
-            break;
-          case 7:
-            result = fun.execute(args[0], args[1], args[2], args[3],
-                                 args[4], args[5], args[6]);
-            break;
-          case 8:
-            result = fun.execute(args[0], args[1], args[2], args[3],
-                                 args[4], args[5], args[6], args[7]);
-            break;
-          default:
-            result = fun.execute(args);
-            break;
-          }
-      }
-    finally
-      {
-        thread.setStack(stack);
-      }
-    return result;
+
+    // 26-07-2009: For some reason we cannot "just" call the array version;
+    // it causes an error (Wrong number of arguments for LOOP-FOR-IN)
+    // which is probably a sign of an issue in our design?
+    switch (args.length)
+      {
+      case 0:
+        return thread.execute(fun);
+      case 1:
+        return thread.execute(fun, args[0]);
+      case 2:
+        return thread.execute(fun, args[0], args[1]);
+      case 3:
+        return thread.execute(fun, args[0], args[1], args[2]);
+      case 4:
+        return thread.execute(fun, args[0], args[1], args[2], args[3]);
+      case 5:
+        return thread.execute(fun, args[0], args[1], args[2], args[3],
+                              args[4]);
+      case 6:
+        return thread.execute(fun, args[0], args[1], args[2], args[3],
+                              args[4], args[5]);
+      case 7:
+        return thread.execute(fun, args[0], args[1], args[2], args[3],
+                              args[4], args[5], args[6]);
+      case 8:
+        return thread.execute(fun, args[0], args[1], args[2], args[3],
+                              args[4], args[5], args[6], args[7]);
+      default:
+        return thread.execute(fun, args);
+    }
   }
 
   public static final LispObject macroexpand(LispObject form,




More information about the armedbear-cvs mailing list