got it down to string equality/identity
This commit is contained in:
@ -60,6 +60,7 @@ module Virtual
|
||||
raise "no such pass-class as #{pass_class}" unless pass
|
||||
pass.new.run(block)
|
||||
end
|
||||
#puts @space.get_main if pass_class == "Virtual::SendImplementation"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -9,8 +9,6 @@ module FakeMem
|
||||
super()
|
||||
@memory = [0,nil]
|
||||
@position = nil
|
||||
@length = -1
|
||||
# Virtual::Machine.instance.add_object self
|
||||
if Virtual::Machine.instance.class_mappings
|
||||
init_layout
|
||||
else
|
||||
@ -26,12 +24,14 @@ module FakeMem
|
||||
end
|
||||
#TODO, this is copied from module Positioned, maybe avoid duplication ?
|
||||
def position
|
||||
if @position == nil
|
||||
raise "position not set for #{self.class} at #{mem_length} for #{self.inspect[0...1000]}"
|
||||
if @position.nil?
|
||||
str = "IN machine #{Virtual::Machine.instance.objects.include?(self)}\n"
|
||||
raise str + "position not set for #{self.class} at #{mem_length} for #{self.inspect[0...100]}"
|
||||
end
|
||||
@position
|
||||
end
|
||||
def set_position pos
|
||||
raise "Setting of nil not allowed" if pos.nil?
|
||||
# resetting of position used to be error, but since relink and dynamic instruction size it is ok.
|
||||
# in measures (of 32)
|
||||
if @position != nil and ((@position - pos).abs > 32)
|
||||
|
@ -39,7 +39,7 @@ module Virtual
|
||||
if ref.type.is_a?(Reference) and ref.type.of_class
|
||||
#find method and call
|
||||
clazz = ref.type.of_class
|
||||
method = clazz.resolve_method code.name
|
||||
method = clazz.resolve_method code.name.to_s
|
||||
raise "No method found #{code.name}" unless method
|
||||
new_codes << MethodCall.new( method )
|
||||
else
|
||||
|
Reference in New Issue
Block a user