checkpointing on the mad road to register allocation

This commit is contained in:
Torsten Ruger
2014-05-13 18:21:24 +03:00
parent b0302948dd
commit f6711ea49c
12 changed files with 86 additions and 76 deletions

View File

@@ -31,10 +31,10 @@ module Vm
@objects = []
# global functions
@functions = []
@entry = Core::Kernel::main_start
@entry = Core::Kernel::main_start Vm::Block.new("main_entry")
#main gets executed between entry and exit
@main = Block.new("main")
@exit = Core::Kernel::main_exit
@exit = Core::Kernel::main_exit Vm::Block.new("main_exit")
end
attr_reader :context , :main , :functions
@@ -58,9 +58,7 @@ module Vm
fun = get_function name
unless fun
puts @functions.inspect
fun = Function.new(name)
block = Core::Kernel.send(name)
fun.set_body block
fun = Core::Kernel.send(name)
@functions << fun
end
fun