fix calling to binaries

used to be to the method, but we assemble the method to its own
position.
Throw in a test for binary calling
This commit is contained in:
Torsten Ruger
2018-03-28 13:00:03 +03:00
parent 7493d738e1
commit 606e3f8cb3
3 changed files with 11 additions and 5 deletions

View File

@ -47,11 +47,11 @@ module Arm
# but because of the arm "theoretical" 3- stage pipeline,
# we have to subtract 2 words (fetch/decode)
arg = Positioned.position(@first) - Positioned.position(self) - 8
when Parfait::TypedMethod
when Parfait::BinaryCode
# 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
arg = arg.binary.position - self.position
arg = Positioned.position(@first) - Positioned.position(self)
else
arg = @first
end