remove instance_get instruction
This commit is contained in:
parent
4334b68736
commit
8642207158
@ -13,7 +13,6 @@ require "virtual/type"
|
||||
# the passes _are_ order dependant
|
||||
require "virtual/passes/minimizer"
|
||||
require "virtual/passes/collector"
|
||||
require "virtual/passes/get_implementation"
|
||||
require "virtual/passes/enter_implementation"
|
||||
require "virtual/passes/set_optimisation"
|
||||
|
||||
|
@ -14,7 +14,6 @@ module Virtual
|
||||
end
|
||||
|
||||
require_relative "instructions/halt"
|
||||
require_relative "instructions/instance_get"
|
||||
require_relative "instructions/method_call"
|
||||
require_relative "instructions/method_enter"
|
||||
require_relative "instructions/method_return"
|
||||
|
@ -1,13 +0,0 @@
|
||||
module Virtual
|
||||
|
||||
# Get a instance variable by _name_ . So we have to resolve the name to an index to
|
||||
# transform into a Slot
|
||||
# The slot may the be used in a set on left or right hand.
|
||||
# The transformation is done by GetImplementation
|
||||
class InstanceGet < Instruction
|
||||
def initialize name
|
||||
@name = name.to_sym
|
||||
end
|
||||
attr_reader :name
|
||||
end
|
||||
end
|
@ -36,7 +36,7 @@ module Virtual
|
||||
|
||||
class Machine
|
||||
|
||||
FIRST_PASS = "Virtual::GetImplementation"
|
||||
FIRST_PASS = "Virtual::EnterImplementation"
|
||||
LAST_PASS = "Virtual::SetOptimisation"
|
||||
|
||||
def initialize
|
||||
|
@ -1,16 +0,0 @@
|
||||
module Virtual
|
||||
# This implements instance variable get (not the opposite of Set,
|
||||
# such a thing does not exists, their slots)
|
||||
|
||||
# Ivar get needs to acces the layout, find the index of the name,
|
||||
# and shuffle the data to return register
|
||||
# In short it's so complicated we implement it in ruby and stick the implementation here
|
||||
class GetImplementation
|
||||
def run block
|
||||
block.codes.dup.each do |code|
|
||||
next unless code.is_a? Virtual::InstanceGet
|
||||
raise "Start coding"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user