more ripples from removing index constants

This commit is contained in:
Torsten Ruger
2015-06-29 20:58:06 +03:00
parent 1e18db00c9
commit 553f30c874
5 changed files with 15 additions and 15 deletions

View File

@ -30,21 +30,21 @@ module Register
next
end
# a place to store a reference to the space, we grab the next_frame from the space
space_tmp = RegisterReference.tmp_reg
space_tmp = Register.tmp_reg
# move the spave to it's register (mov instruction gets the address of the object)
new_codes = [ LoadConstant.new( Parfait::Space.object_space , space_tmp )]
# find index in the space where to grab frame/message
space_index = Parfait::Space.object_space.get_layout().index_of( kind )
space_index = Register.resolve_index( :space , kind )
raise "index not found for #{kind}.#{kind.class}" unless space_index
# load the frame/message from space by index
new_codes << GetSlot.new( space_tmp , space_index , RegisterReference.frame_reg )
new_codes << GetSlot.new( space_tmp , space_index , Register.resolve_to_register(:frame) )
# a temporary place to store the new frame
frame_tmp = space_tmp.next_reg_use
# get the next_frame
from = Parfait::Space.object_space.send( kind )
kind_index = from.get_layout().index_of( kind )
raise "index not found for #{kind}.#{kind.class}" unless kind_index
new_codes << GetSlot.new( RegisterReference.frame_reg , kind_index , frame_tmp) # 2 index of next_frame
new_codes << GetSlot.new( Register.frame_reg , kind_index , frame_tmp) # 2 index of next_frame
# save next frame into space
new_codes << SetSlot.new( frame_tmp , space_tmp , space_index)
block.replace(code , new_codes )