2014-10-04 11:52:28 +02:00
|
|
|
module Virtual
|
2014-08-26 11:05:49 +02:00
|
|
|
|
|
|
|
class EnterImplementation
|
|
|
|
def run block
|
|
|
|
block.codes.dup.each do |code|
|
|
|
|
next unless code.is_a? Virtual::MethodEnter
|
2014-09-24 17:25:18 +02:00
|
|
|
new_codes = []
|
2015-06-29 19:58:06 +02:00
|
|
|
# save return register to the message at instance return_address
|
2015-07-27 11:13:39 +02:00
|
|
|
new_codes << Register.save_return(code, :message , :return_address)
|
2014-09-24 17:25:18 +02:00
|
|
|
block.replace(code , new_codes )
|
2014-08-26 11:05:49 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-06-01 07:40:17 +02:00
|
|
|
Virtual.machine.add_pass "Virtual::EnterImplementation"
|
2014-08-26 11:05:49 +02:00
|
|
|
end
|