diff --git a/lib/parfait/space.rb b/lib/parfait/space.rb index eb709f7c..5b274d0e 100644 --- a/lib/parfait/space.rb +++ b/lib/parfait/space.rb @@ -39,6 +39,7 @@ module Parfait @next_message = Message.new @next_message @next_frame = Frame.new @next_frame end + @init_message = Message.new @next_message init_layout end diff --git a/lib/register/builtin/kernel.rb b/lib/register/builtin/kernel.rb index 8cf6ae1d..6d1cf407 100644 --- a/lib/register/builtin/kernel.rb +++ b/lib/register/builtin/kernel.rb @@ -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( :next_message ) + message_ind = space.get_layout().index_of( :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) diff --git a/lib/virtual/boot.rb b/lib/virtual/boot.rb index 0c1ca6ef..e8dfd645 100644 --- a/lib/virtual/boot.rb +++ b/lib/virtual/boot.rb @@ -29,7 +29,7 @@ module Virtual :Message => [:next_message , :receiver , :frame , :return_address , :caller , :name ], :MetaClass => [], :BinaryCode => [], - :Space => [:classes ,:next_message ,:next_frame, :syscall_message], + :Space => [:classes ,:init_message , :next_message ,:next_frame, :syscall_message], :Frame => [:next_frame ], :Layout => [:object_class] , :Class => [:object_layout ],