rubyx/lib/arm/passes/constant_implementation.rb

15 lines
392 B
Ruby
Raw Normal View History

module Arm
class ConstantImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Register::LoadConstant
load = ArmMachine.ldr( code.register , code.constant )
block.replace(code , load )
2015-05-30 10:56:47 +02:00
#puts "replaced #{load.inspect.to_s[0..1000]}"
end
end
end
Virtual.machine.add_pass "Arm::ConstantImplementation"
end