rubyx/lib/virtual/passes/enter_implementation.rb
Torsten Ruger 6c7e4c0fe2 stop pinning self and frame
before: r0-message , r1-self , r2-frame , r3-new_message , r4 + tmps
now: r0-message , r1-new_message , r2 + tmps
programs got smaller, less fuss
also fix in return implementation that got the address from the wrong
message
2015-10-18 17:20:19 +03:00

16 lines
450 B
Ruby

module Virtual
class EnterImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Virtual::MethodEnter
new_codes = []
# save return register to the message at instance return_address
new_codes << Register.save_return(code, :message , :return_address)
block.replace(code , new_codes )
end
end
end
Virtual.machine.add_pass "Virtual::EnterImplementation"
end