diff --git a/lib/mom/instruction/message_setup.rb b/lib/mom/instruction/message_setup.rb index ba9c36f6..5214ae64 100644 --- a/lib/mom/instruction/message_setup.rb +++ b/lib/mom/instruction/message_setup.rb @@ -60,7 +60,7 @@ module Mom def build_message_data( builder ) builder.build do space << Parfait.object_space - next_message << space[:first_message] + next_message << space[:next_message] message[:next_message] << next_message next_message[:caller] << message @@ -79,7 +79,7 @@ module Mom #FIXME in a multithreaded future this should be done soon after getting # the first_message, using lock free compare and swap. Now saving regs next_message << next_message[:next_message] - space[:first_message] << next_message + space[:next_message] << next_message end end end diff --git a/lib/parfait/space.rb b/lib/parfait/space.rb index a62235f9..80d2096c 100644 --- a/lib/parfait/space.rb +++ b/lib/parfait/space.rb @@ -34,24 +34,27 @@ module Parfait def initialize( classes ) @classes = classes @types = Dictionary.new - message = Message.new(nil) - 101.times { @next_integer = Integer.new(0,@next_integer) } - 10.times { @next_address = ReturnAddress.new(0,@next_address) } - - 50.times do - @first_message = Message.new message - message.set_caller @first_message - message = @first_message - end @classes.each do |name , cl| add_type(cl.instance_type) end + 101.times { @integers = Integer.new(0,@integers) } + 10.times { @addresses = ReturnAddress.new(0,@addresses) } + message = Message.new(nil) + 50.times do + @messages = Message.new message + message.set_caller @messages + message = @messages + end + @next_message = @messages + @next_integer = @integers + @next_address = @addresses @true_object = Parfait::TrueClass.new @false_object = Parfait::FalseClass.new @nil_object = Parfait::NilClass.new end - attr_reader :classes , :types , :first_message , :next_integer , :next_address + attr_reader :classes , :types , :next_message , :next_integer , :next_address + attr_reader :messages, :integers , :addresses attr_reader :true_object , :false_object , :nil_object # hand out one of the preallocated ints for use as constant @@ -68,7 +71,7 @@ module Parfait def get_address 10.times do # 10 for whole pages @next_address = ReturnAddress.new(0,@next_address) - end unless @next_address + end unless @next_address.next_integer addr = @next_address @next_address = @next_address.next_integer addr diff --git a/lib/risc/builtin/object.rb b/lib/risc/builtin/object.rb index c2672455..e10f5679 100644 --- a/lib/risc/builtin/object.rb +++ b/lib/risc/builtin/object.rb @@ -51,9 +51,9 @@ module Risc builder = compiler.compiler_builder(compiler.method) builder.build do space << Parfait.object_space - message << space[:first_message] + message << space[:next_message] next_message << message[:next_message] - space[:first_message] << next_message + space[:next_message] << next_message end Mom::MessageSetup.new(Parfait.object_space.get_main).build_with( builder ) diff --git a/lib/risc/parfait_boot.rb b/lib/risc/parfait_boot.rb index a5586471..2140deba 100644 --- a/lib/risc/parfait_boot.rb +++ b/lib/risc/parfait_boot.rb @@ -141,9 +141,10 @@ module Parfait Object: {}, BinaryCode: {next: :BinaryCode} , Space: {classes: :Dictionary , types: :Dictionary , - first_message: :Message , next_integer: :Integer , - true_object: :TrueClass, next_address: :ReturnAddress , - false_object: :FalseClass , nil_object: :NilClass}, + next_message: :Message , messages: :Message , + next_integer: :Integer, integers: :Integer , + next_address: :ReturnAddress ,addresses: :ReturnAddress , + true_object: :TrueClass, false_object: :FalseClass , nil_object: :NilClass}, NamedList: {}, Type: {names: :List , types: :List , object_class: :Class, methods: :TypedMethod } , diff --git a/stash/parfait/test_type.rb b/stash/parfait/test_type.rb index 499a8c52..b068f8c6 100644 --- a/stash/parfait/test_type.rb +++ b/stash/parfait/test_type.rb @@ -45,7 +45,7 @@ HERE # copy of register parfait tests, in order def test_message_type @main = <