remove virtual main instruction

on a quest to remove all virtual instructions
This commit is contained in:
Torsten Ruger
2015-10-10 11:14:31 +03:00
parent 4b8a4d4ef5
commit 4334b68736
5 changed files with 2 additions and 49 deletions

View File

@@ -21,4 +21,3 @@ require_relative "instructions/method_return"
require_relative "instructions/new_frame"
require_relative "instructions/new_message"
require_relative "instructions/set"
require_relative "instructions/virtual_main"

View File

@@ -1,23 +0,0 @@
module Virtual
# This starts the Virtual machine machine at the given function.
# The implementation is most likely a jump/branch , but since we have the extra layer
# we make good use of it, ie give things descriptive names (what they do, not how)
class VirtualMain < Instruction
include Positioned
def initialize method
@method = method
end
attr_reader :method
def word_length
4
end
def to_s
"#{self.class.name}( method: #{method.name})"
end
end
end

View File

@@ -119,15 +119,10 @@ module Virtual
end
def boot
# if @booted
# boot_functions!
# @init = Block.new("init", :__init__ )
# @init.add_code Virtual::VirtualMain.new( self.space.get_init )
# return self
# end
boot_parfait!
@init = Block.new("init", :__init__ )
@init.add_code Virtual::VirtualMain.new( self.space.get_init )
branch = Register::Branch.new( "__init__" , self.space.get_init.source.blocks.first )
@init.add_code branch
@booted = true
self
end