This commit is contained in:
Kartik K. Agaram 2014-08-28 19:54:37 -07:00
parent 2f2c241800
commit a1ef151196
1 changed files with 5 additions and 2 deletions

7
mu.arc
View File

@ -118,6 +118,10 @@
; context contains the call-stack of functions that haven't yet returned
(def make-context (fn-name)
(annotate 'context (obj call-stack (list
(obj fn-name fn-name pc 0 caller-arg-idx 0)))))
(defextend empty (x) (isa x 'context)
(no rep.x!call-stack))
@ -162,8 +166,7 @@
(def run (fn-name)
(ret result 0
(let context (annotate 'context (obj call-stack (list
(obj fn-name fn-name pc 0 caller-arg-idx 0))))
(let context (make-context fn-name)
(while (~empty context)
;? (prn "== " context)
(let insts-run (run-for-time-slice context scheduling-interval*)