fix bug where layout wasn't initialized

This commit is contained in:
Torsten Ruger
2015-05-30 11:55:46 +03:00
parent 3e9e650764
commit bea10cc560
5 changed files with 23 additions and 11 deletions

View File

@ -26,7 +26,7 @@ module Virtual
layouts = { "Word" => [] ,
"List" => [] ,
"Message" => [],
"BinaryCode" => [],
"BinaryCode" => [],
"Space" => ["classes","objects","frames","messages","next_message","next_frame"],
"Frame" => ["locals" , "tmps" ],
"Layout" => ["object_class"] ,
@ -51,6 +51,7 @@ module Virtual
clazz.object_layout.add_instance_variable Virtual.new_word(var_name)
end
end
# now store the classes so we can hand them out later during object creation
# this can not be done earlier, as parfait objects are all the time created and would
# lookup half created class info
@ -61,11 +62,9 @@ module Virtual
class_mappings["Object"] = value_classes[3] #need for further booting
# add space and instances which get created before the objects list
@space.add_object @space
@space.add_object @space.classes
@space.add_object @space.classes.keys
@space.add_object @space.classes.values
@space.add_object @space.objects
[@space,@space.classes,@space.classes.keys, @space.classes.values,@space.objects].each do |o|
@space.add_object o
end
@space.late_init

View File

@ -11,7 +11,10 @@ module FakeMem
@length = -1
if Parfait::Space.object_space and Parfait::Space.object_space.objects
Parfait::Space.object_space.add_object self
end #Note: the else is handled in boot, by ading the space "by hand", as it slips though
else
#Note: the else is handled in boot, by ading the space "by hand", as it slips though
#puts "Got away #{self.class}"
end
init_layout if Virtual::Machine.instance.class_mappings
end
def init_layout