use message reg not message

for upcoming change
This commit is contained in:
Torsten Ruger 2018-07-15 15:14:38 +03:00
parent 69385c863f
commit a71a6d34fb
4 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ module Mom
return_label = Risc.label(self, "continue_#{object_id}")
save_return = SlotLoad.new([:message,:next_message,:return_address],[return_label],self)
moves = save_return.to_risc(compiler)
moves << Risc.slot_to_reg(self, :message , :next_message , Risc.message_reg)
moves << Risc.slot_to_reg(self, Risc.message_reg , :next_message , Risc.message_reg)
moves << Risc.load_constant( self , @cache_entry , reg )
method_index = Risc.resolve_to_index(:cache_entry , :cached_method)
moves << Risc::SlotToReg.new( self , reg ,method_index, reg)

View File

@ -26,7 +26,7 @@ module Mom
return_label = Risc.label(self,"continue_#{object_id}")
save_return = SlotLoad.new([:message,:next_message,:return_address],[return_label],self)
moves = save_return.to_risc(compiler)
moves << Risc.slot_to_reg(self, :message , :next_message , Risc.message_reg)
moves << Risc.slot_to_reg(self, Risc.message_reg , :next_message , Risc.message_reg)
moves << Risc::FunctionCall.new(self, method )

View File

@ -15,7 +15,7 @@ module Risc
builder.add_load_data( source , 2 , two )
builder.add_code Risc.op( source , :>> , me , two)
builder.add_new_int(source,me , two)
builder.add_reg_to_slot( source , two , :message , :return_value)
builder.add_reg_to_slot( source , two , Risc.message_reg , :return_value)
compiler.add_mom( Mom::ReturnSequence.new)
return compiler
end
@ -52,7 +52,7 @@ module Risc
builder.add_code false_label
builder.add_load_constant("#{operator} new int", Parfait.object_space.false_object , other)
builder.add_code merge_label
builder.add_reg_to_slot( "#{operator} save ret" , other , :message , :return_value)
builder.add_reg_to_slot( "#{operator} save ret" , other , Risc.message_reg , :return_value)
compiler.add_mom( Mom::ReturnSequence.new)
return compiler
end
@ -69,7 +69,7 @@ module Risc
builder.reduce_int( op_sym.to_s + " fix arg", other )
builder.add_code Risc.op( op_sym.to_s + " operator", op_sym , me , other)
builder.add_new_int(op_sym.to_s + " new int", me , other)
builder.add_reg_to_slot( op_sym.to_s + "save ret" , other , :message , :return_value)
builder.add_reg_to_slot( op_sym.to_s + "save ret" , other , Risc.message_reg , :return_value)
compiler.add_mom( Mom::ReturnSequence.new)
return compiler
end
@ -131,7 +131,7 @@ module Risc
builder.add_code Risc.op( s , :+ , q , tmp )
builder.add_new_int(s,q , tmp)
builder.add_reg_to_slot( s , tmp , :message , :return_value)
builder.add_reg_to_slot( s , tmp , Risc.message_reg , :return_value)
compiler.add_mom( Mom::ReturnSequence.new)
return compiler

View File

@ -15,7 +15,7 @@ module Risc
# reduce me to me[index]
builder.add_slot_to_reg( source , me , index , me)
# and put it back into the return value
builder.add_reg_to_slot( source , me , :message , :return_value)
builder.add_reg_to_slot( source , me , Risc.message_reg , :return_value)
compiler.add_mom( Mom::ReturnSequence.new)
return compiler
end
@ -67,7 +67,7 @@ module Risc
ret_tmp = compiler.use_reg(:Label)
builder.build do
add_load_constant("__init__ load return", exit_label , ret_tmp)
add_reg_to_slot("__init__ store return", ret_tmp , :message , :return_address)
add_reg_to_slot("__init__ store return", ret_tmp , Risc.message_reg , :return_address)
add_function_call( "__init__ issue call" , Parfait.object_space.get_main)
add_code exit_label
end
@ -80,8 +80,8 @@ module Risc
# Used by exit and __init__ (so it doesn't have to call it)
def exit_sequence(builder)
save_message( builder )
builder.add_slot_to_reg "get return" , :message , :return_value , :message
builder.reduce_int( "reduce return" , :message)
builder.add_slot_to_reg "get return" , Risc.message_reg , :return_value , Risc.message_reg
builder.reduce_int( "reduce return" , Risc.message_reg)
builder.add_code Syscall.new("emit_syscall(exit)", :exit )
end
@ -120,7 +120,7 @@ module Risc
int = builder.compiler.use_reg(:Integer)
builder.add_new_int(source , return_tmp , int )
# save the return value into the message
builder.add_code Risc.reg_to_slot( source , int , :message , :return_value )
builder.add_code Risc.reg_to_slot( source , int , Risc.message_reg , :return_value )
end
end