diff --git a/lib/mom/instruction/message_setup.rb b/lib/mom/instruction/message_setup.rb index bd6a3be3..efd30e14 100644 --- a/lib/mom/instruction/message_setup.rb +++ b/lib/mom/instruction/message_setup.rb @@ -59,25 +59,10 @@ module Mom "method setup " end - # get the next message from space and unlink it there - # also put it into next_message of current message (and reverse) # set the method into the message def build_message_data( builder ) builder.build do - factory? << Parfait.object_space.get_factory_for(:Message) - next_message? << factory[:next_object] - - #FIXME in a multithreaded future this should be done using lock free compare and swap. - next_message_reg! << next_message[:next_message] - factory[:next_object] << next_message_reg - - # FIXME: Also we relink used messages at the moment. This will have to stop - # when implementing continuations (or block passing/bindings) - # then we may run out and that means cheking and maybe getting more - message[:next_message] << next_message - next_message[:caller] << message - next_message[:method] << callable - + next_message?[:method] << callable end end end diff --git a/lib/mom/instruction/return_sequence.rb b/lib/mom/instruction/return_sequence.rb index f22f6794..c78f68cb 100644 --- a/lib/mom/instruction/return_sequence.rb +++ b/lib/mom/instruction/return_sequence.rb @@ -26,19 +26,12 @@ module Mom object! << message[:return_value] caller_reg! << message[:caller] caller_reg[:return_value] << object - factory? << Parfait.object_space.get_factory_for(:Message) - # here we return the current message to the list of messages - # which is only correct without blocks or real continuations - next_message! << factory[:next_object] - message[:next_message] << next_message - factory[:next_object] << message end - compiler.reset_regs builder.build do return_address! << message[:return_address] return_address << return_address[ Parfait::Integer.integer_index] message << message[:caller] - return_address.function_return + add_code Risc.function_return("return", return_address) end end diff --git a/lib/risc/register_value.rb b/lib/risc/register_value.rb index b4ef70a8..36c0471f 100644 --- a/lib/risc/register_value.rb +++ b/lib/risc/register_value.rb @@ -171,14 +171,6 @@ module Risc op end - # generate a Function return instruction - # using the register as the parameter where the return address is passed - def function_return - ret = Risc.function_return("return", self) - builder.add_code(ret) if builder - ret - end - # create operator instruction for self and add # doesn't read quite as smoothly as one would like, but better than the compiler version def op( operator , right)