fix the address for calls to jump past the method object header
This commit is contained in:
parent
e3fdbb30a5
commit
7036a87678
@ -35,8 +35,11 @@ module Arm
|
|||||||
arg = Virtual::IntegerConstant.new( arg )
|
arg = Virtual::IntegerConstant.new( arg )
|
||||||
end
|
end
|
||||||
if arg.is_a?(Virtual::Block) or arg.is_a?(Virtual::CompiledMethod)
|
if arg.is_a?(Virtual::Block) or arg.is_a?(Virtual::CompiledMethod)
|
||||||
diff = arg.position - 8
|
#relative addressing for jumps/calls
|
||||||
diff -= self.position
|
diff = arg.position - self.position
|
||||||
|
# but because of the arm "theoretical" 3- stage pipeline, we have to subtract 2 words (fetch/decode)
|
||||||
|
# But, for methods, this happens to be the size of the object header, so there it balances out, but not blocks
|
||||||
|
diff -= 8 if arg.is_a?(Virtual::Block)
|
||||||
arg = Virtual::IntegerConstant.new(diff)
|
arg = Virtual::IntegerConstant.new(diff)
|
||||||
end
|
end
|
||||||
if (arg.is_a?(Virtual::IntegerConstant))
|
if (arg.is_a?(Virtual::IntegerConstant))
|
||||||
|
Loading…
Reference in New Issue
Block a user