remove MethodCall and thus all virtual instructions
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
|
||||
module Virtual
|
||||
|
||||
# Instruction is an abstract for all the code of the object-machine.
|
||||
# Derived classes make up the actual functionality of the machine.
|
||||
# All functions on the machine are captured as instances of instructions
|
||||
#
|
||||
# It is actually the point of the virtual machine layer to express oo functionality in the set of
|
||||
# instructions, thus defining a minimal set of instructions needed to implement oo.
|
||||
|
||||
class Instruction
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
require_relative "instructions/method_call"
|
@ -1,12 +0,0 @@
|
||||
module Virtual
|
||||
|
||||
|
||||
# MethodCall involves shuffling some registers about and doing a machine call
|
||||
class MethodCall < Instruction
|
||||
def initialize method
|
||||
@method = method
|
||||
end
|
||||
attr_reader :method
|
||||
end
|
||||
|
||||
end
|
@ -81,7 +81,7 @@ module Virtual
|
||||
# add an instruction after the current (insertion point)
|
||||
# the added instruction will become the new insertion point
|
||||
def add_code instruction
|
||||
unless (instruction.is_a?(Instruction) or instruction.is_a?(Register::Instruction))
|
||||
unless instruction.is_a?(Register::Instruction)
|
||||
raise instruction.to_s
|
||||
end
|
||||
@current.add_code(instruction) #insert after current
|
||||
|
Reference in New Issue
Block a user