debugging positions
This commit is contained in:
@ -11,7 +11,7 @@ module Arm
|
||||
# Riscs 0-6 hold the call values as for a normal c call
|
||||
class CallInstruction < Instruction
|
||||
attr_reader :first
|
||||
|
||||
|
||||
def initialize(first, attributes)
|
||||
super(nil, nil)
|
||||
@attributes = attributes
|
||||
@ -51,8 +51,8 @@ module Arm
|
||||
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 = Positioned.position(@first) - Positioned.position(self)
|
||||
# have to use the code, not the method object for methods
|
||||
arg = Positioned.position(@first) - Positioned.position(self) + 4
|
||||
else
|
||||
arg = @first
|
||||
end
|
||||
|
@ -21,11 +21,16 @@ module Arm
|
||||
ret
|
||||
end
|
||||
|
||||
def set_position( position )
|
||||
def set_position( position , count )
|
||||
Positioned.set_position(self,position)
|
||||
position += byte_length
|
||||
if self.next
|
||||
self.next.set_position( position )
|
||||
count += 1 #assumes 4 byte instructions, as does the whole setup
|
||||
if( 0 == count % 12) # 12 is the amount of instructions that fit into a BinaryCode
|
||||
count = 0
|
||||
position += 12 # 12=3*4 , 3 for marker,type,next words to jump over
|
||||
end
|
||||
self.next.set_position( position , count )
|
||||
else
|
||||
position
|
||||
end
|
||||
|
Reference in New Issue
Block a user