fixing load constant
which needs to add to pc to get an object reference
This commit is contained in:
parent
108cc8af45
commit
55b7ca83e1
@ -4,7 +4,13 @@ module Arm
|
|||||||
def run block
|
def run block
|
||||||
block.codes.dup.each do |code|
|
block.codes.dup.each do |code|
|
||||||
next unless code.is_a? Register::LoadConstant
|
next unless code.is_a? Register::LoadConstant
|
||||||
load = ArmMachine.ldr( code.register , code.constant )
|
constant = code.constant
|
||||||
|
|
||||||
|
if constant.is_a?(Parfait::Object) or constant.is_a? Symbol
|
||||||
|
load = ArmMachine.add( code.register , :pc , constant )
|
||||||
|
else
|
||||||
|
load = ArmMachine.mov( code.register , code.constant )
|
||||||
|
end
|
||||||
block.replace(code , load )
|
block.replace(code , load )
|
||||||
#puts "replaced #{load.inspect.to_s[0..1000]}"
|
#puts "replaced #{load.inspect.to_s[0..1000]}"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user