2014-10-05 01:05:18 +03:00
|
|
|
module Arm
|
|
|
|
|
|
|
|
class GetImplementation
|
|
|
|
def run block
|
|
|
|
block.codes.dup.each do |code|
|
|
|
|
next unless code.is_a? Register::GetSlot
|
2015-06-27 20:09:21 +03:00
|
|
|
# times 4 because arm works in bytes, but vm in words
|
2015-06-30 18:38:56 +03:00
|
|
|
load = ArmMachine.ldr( code.register , code.array , 4 * code.index )
|
2014-10-05 01:05:18 +03:00
|
|
|
block.replace(code , load )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-06-01 08:40:17 +03:00
|
|
|
Virtual.machine.add_pass "Arm::GetImplementation"
|
2014-10-05 01:05:18 +03:00
|
|
|
end
|