fix method call addresses
was jumping to the method but needs to jump to the code of the method
This commit is contained in:
parent
6f111a5ae0
commit
d8fa266b5d
@ -35,12 +35,16 @@ module Arm
|
||||
#puts "BLAB #{arg.inspect}"
|
||||
if arg.is_a?(Virtual::Block) or arg.is_a?(Parfait::Method)
|
||||
#relative addressing for jumps/calls
|
||||
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)
|
||||
if(arg.is_a? Virtual::Block)
|
||||
diff = arg.position - self.position - 8
|
||||
else
|
||||
# But, for methods, this happens to be the size of the object header,
|
||||
# so there it balances out, but not blocks
|
||||
# have to use the code, not the mthod object for methods
|
||||
diff = arg.code.position - self.position
|
||||
end
|
||||
arg = diff
|
||||
end
|
||||
if (arg.is_a?(Numeric))
|
||||
|
Loading…
Reference in New Issue
Block a user