(include-book "irun") (in-package "M5") (defconst *Lecture16-ct* (make-ct (list (make class :name "Alpha" :supers '("Object") :fields '("xpos" "ypos") :methods nil) (make class :name "Beta" :supers '("Alpha" "Object") :fields '("zpos") :methods nil) (make class :name "Lecture16" :supers '("Object") :fields nil :methods (list (make method :name "ifact" :formals '(n) :sync nil :code '((const 1) (store 1) (load 0) (ifeq 10) (load 0) (load 1) (mul) (store 1) (load 0) (const -1) (add) (store 0) (goto -10) (load 1) (xreturn)) :xtbl nil ) (make method :name "main" :formals '() :sync nil :code '((const 7) (const 5) (invokestatic ("Lecture16" "ifact" 1)) (add) (pop) (new "Alpha") (store 0) (load 0) (const 1) (putfield ("Alpha" "xpos")) (load 0) (getfield ("Alpha" "xpos")) (pop) (new "Beta") (store 1) (load 1) (const 2) (putfield ("Alpha" "xpos")) (halt)) :xtbl nil ) ) ) ))) (irun (make state :tt (list (make thread :id 0 :cs (push (make frame :pc 0 :locs nil :stk nil :mloc '("Lecture16" "main" 1)) nil) :stat 'active :ref nil)) :hp nil :ct *Lecture16-ct*))