2014-08-26 11:05:49 +02:00
|
|
|
module Register
|
|
|
|
|
|
|
|
class EnterImplementation
|
|
|
|
def run block
|
|
|
|
block.codes.dup.each do |code|
|
|
|
|
next unless code.is_a? Virtual::MethodEnter
|
|
|
|
# save return register and create a new frame
|
2014-08-26 15:15:00 +02:00
|
|
|
to = RegisterReference.new(:r0) # message base
|
|
|
|
pc = RegisterReference.new(:pc)
|
2014-09-20 16:06:11 +02:00
|
|
|
move1 = RegisterMachine.instance.str( pc , to , Virtual::Slot::MESSAGE_RETURN_VALUE )
|
2014-09-11 18:00:14 +02:00
|
|
|
block.replace(code , [move1] )
|
2014-08-26 11:05:49 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Virtual::BootSpace.space.add_pass_after EnterImplementation , CallImplementation
|
|
|
|
end
|