about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc18
1 files changed, 12 insertions, 6 deletions
diff --git a/mu.arc b/mu.arc
index b728c51a..afcd1620 100644
--- a/mu.arc
+++ b/mu.arc
@@ -128,13 +128,15 @@
 
 (def run (fn-name)
 ;?   (prn "AAA")
+  (point return
   (let context (list (obj fn-name fn-name  pc 0  caller-arg-idx 0))
 ;?     (prn "BBB")
     (for ninstrs 0 (< ninstrs scheduling-interval*) (++ ninstrs)
 ;?       (prn "CCC " pc.context " " context " " (len body.context))
-      (if (>= pc.context (len body.context))
-        (pop context))
-      (if (no context) (break))
+      (while (>= pc.context (len body.context))
+        (pop context)
+        (if no.context (return ninstrs))
+        (++ pc.context))
 ;?       (prn "--- " context.0!fn-name " " pc.context ": " (body.context pc.context))
 ;?       (prn "  " memory*)
       (let (oarg op arg)  (parse-instr (body.context pc.context))
@@ -215,11 +217,15 @@
                   (array-ref arg.0 (v arg.1))
                 reply
                   (do (pop context)
-                      (if no.context (break))
+                      (if no.context (return ninstrs))
                       (let (caller-oargs _ _)  (parse-instr (body.context pc.context))
                         (each (dest src)  (zip caller-oargs arg)
                           (setm dest  (m src))))
                       (++ pc.context)
+                      (while (>= pc.context (len body.context))
+                        (pop context)
+                        (if no.context (return ninstrs))
+                        (++ pc.context))
                       (continue))
                 new
                   (let type (v arg.0)
@@ -239,8 +245,8 @@
 ;?                   (prn oarg.0)
                   (setm oarg.0 tmp)))
               )
-        (++ pc.context))))
-  nil)
+        (++ pc.context)))
+    (return scheduling-interval*))))
 
 (enq (fn () (= Memory-in-use-until 1000))
      initialization-fns*)