From a71a6d34fb4da3908cf103906aa1408f4620d012 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 15 Jul 2018 15:14:38 +0300 Subject: [PATCH] use message reg not message for upcoming change --- lib/mom/instruction/dynamic_call.rb | 2 +- lib/mom/instruction/simple_call.rb | 2 +- lib/risc/builtin/integer.rb | 8 ++++---- lib/risc/builtin/object.rb | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/mom/instruction/dynamic_call.rb b/lib/mom/instruction/dynamic_call.rb index f4125e3b..fc65b223 100644 --- a/lib/mom/instruction/dynamic_call.rb +++ b/lib/mom/instruction/dynamic_call.rb @@ -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) diff --git a/lib/mom/instruction/simple_call.rb b/lib/mom/instruction/simple_call.rb index c780f40f..e3f9b5c3 100644 --- a/lib/mom/instruction/simple_call.rb +++ b/lib/mom/instruction/simple_call.rb @@ -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 ) diff --git a/lib/risc/builtin/integer.rb b/lib/risc/builtin/integer.rb index 19b65996..9548ef3c 100644 --- a/lib/risc/builtin/integer.rb +++ b/lib/risc/builtin/integer.rb @@ -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 diff --git a/lib/risc/builtin/object.rb b/lib/risc/builtin/object.rb index 25689074..fa93e6ab 100644 --- a/lib/risc/builtin/object.rb +++ b/lib/risc/builtin/object.rb @@ -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