more index fixes, this time arguments

This commit is contained in:
Torsten Ruger 2015-07-01 09:48:20 +03:00
parent 4c315a8115
commit fb67f550ec
3 changed files with 6 additions and 3 deletions

View File

@ -14,7 +14,7 @@ module Register
#Set up the Space as self upon init
space = Parfait::Space.object_space
function.info.add_code LoadConstant.new( space , Register.self_reg)
message_ind = space.get_layout().index_of( :init_message )
message_ind = Register.resolve_index( :space , :init_message )
# Load the message to new message register (r3)
function.info.add_code Register.get_slot( :self , message_ind , :new_message)
# And store the space as the new self (so the call can move it back as self)

View File

@ -26,7 +26,8 @@ module Virtual
layouts = { :Word => [] ,
:List => [] ,
# Assumtion is that name is the last of message
:Message => [:next_message , :receiver , :frame , :return_address , :caller , :name ],
:Message => [:next_message , :receiver , :frame , :return_address , :return_value,
:caller , :name ],
:MetaClass => [],
:BinaryCode => [],
:Space => [:classes ,:init_message , :next_message ,:next_frame, :syscall_message],

View File

@ -14,7 +14,9 @@ module Virtual
#compile in the running method, ie before passing control
val = Compiler.compile( arg , method)
# move the compiled value to it's slot in the new message
to = NewArgSlot.new(i ,val.type , val)
# + 1 as this is a ruby 0-start , but 0 is the last message ivar.
# so the next free is +1
to = NewArgSlot.new(i + 1 ,val.type , val)
# (doing this immediately, not after the loop, so if it's a return it won't get overwritten)
method.info.add_code Set.new( val , to )
compiled_args << to