2015-07-17 12:21:57 +02:00
|
|
|
module Register
|
|
|
|
|
|
|
|
# "Boot" the virtual machine at the function given
|
|
|
|
# meaning jump to that function currently. Maybe better to do some machine setup
|
|
|
|
# and possibly some cleanup/exit has to tie in, but that is not this day
|
|
|
|
|
|
|
|
class MainImplementation
|
|
|
|
def run block
|
|
|
|
block.codes.dup.each do |code|
|
|
|
|
next unless code.is_a? Virtual::VirtualMain
|
2015-07-18 10:21:49 +02:00
|
|
|
branch = Register::Branch.new( code , code.method.source.blocks.first )
|
2015-07-17 12:21:57 +02:00
|
|
|
block.replace(code , branch )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Virtual.machine.add_pass "Register::MainImplementation"
|
|
|
|
end
|