add position to instruction (for relative calculations)

This commit is contained in:
Torsten Ruger 2014-08-30 16:57:34 +03:00
parent 18f33770b5
commit 48b33e5f9d
2 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,7 @@ module Register
@objects.each do |id , slot| @objects.each do |id , slot|
next unless slot.object.is_a? Virtual::CompiledMethod next unless slot.object.is_a? Virtual::CompiledMethod
slot.position = at slot.position = at
slot.object.set_position at
at += slot.length at += slot.length
end end
@objects.each do |id , slot| @objects.each do |id , slot|

View File

@ -17,6 +17,7 @@ module Register
@attributes = options @attributes = options
end end
attr_reader :attributes attr_reader :attributes
attr_accessor :position
def opcode def opcode
@attributes[:opcode] @attributes[:opcode]
end end