start on passes
after all that booting and vm/parfait changes passes have gone out of sync, start to fix
This commit is contained in:
parent
47abdffd1a
commit
6786855e95
@ -23,7 +23,7 @@ module Virtual
|
|||||||
else
|
else
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
space = Space.space
|
space = Parfait::Space.object_space
|
||||||
slot = Virtual::Slot
|
slot = Virtual::Slot
|
||||||
# a place to store a reference to the space, we grab the next_frame from the space
|
# a place to store a reference to the space, we grab the next_frame from the space
|
||||||
space_tmp = Register::RegisterReference.new(Virtual::Message::TMP_REG)
|
space_tmp = Register::RegisterReference.new(Virtual::Message::TMP_REG)
|
||||||
|
@ -13,7 +13,7 @@ module Virtual
|
|||||||
next unless code.is_a? MessageSend
|
next unless code.is_a? MessageSend
|
||||||
new_codes = [ ]
|
new_codes = [ ]
|
||||||
ref = code.me
|
ref = code.me
|
||||||
raise "only refs implemented #{ref.inspect}" unless ( ref.type == Reference)
|
raise "only refs implemented #{ref.type}" unless ( ref.type.is_a? Reference)
|
||||||
# value known at compile time, got do something with it
|
# value known at compile time, got do something with it
|
||||||
if(ref.value)
|
if(ref.value)
|
||||||
me = ref.value
|
me = ref.value
|
||||||
@ -34,9 +34,17 @@ module Virtual
|
|||||||
raise "unimplemented: \n#{code}"
|
raise "unimplemented: \n#{code}"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# must defer send to run-time
|
if ref.type.is_a?(Reference) and ref.type.of_class
|
||||||
# So inlining the code from message.send (in the future)
|
#find method and call
|
||||||
raise "not constant/ known object for send #{ref.inspect}"
|
clazz = ref.type.of_class
|
||||||
|
method = clazz.resolve_method Virtual.new_word(code.name)
|
||||||
|
raise "No method found #{code.name}" unless method
|
||||||
|
new_codes << MethodCall.new( method )
|
||||||
|
else
|
||||||
|
# must defer send to run-time
|
||||||
|
# So inlining the code from message.send (in the future)
|
||||||
|
raise "not constant/ known object for send #{ref.inspect}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
block.replace(code , new_codes )
|
block.replace(code , new_codes )
|
||||||
end
|
end
|
||||||
|
@ -13,6 +13,11 @@ module Virtual
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Reference < Type
|
class Reference < Type
|
||||||
|
# possibly unknown value, but known class (as in methods)
|
||||||
|
def initialize clazz = nil
|
||||||
|
@of_class = clazz
|
||||||
|
end
|
||||||
|
attr_reader :of_class
|
||||||
end
|
end
|
||||||
|
|
||||||
class Mystery < Type
|
class Mystery < Type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user