move space to parfait

Also make the machine the singleton
and space hang off it

Many repercussions, not all fixed in this commit
This commit is contained in:
Torsten Ruger
2015-05-12 15:36:44 +03:00
parent 2e8b514e9c
commit b980def84e
35 changed files with 185 additions and 195 deletions

View File

@ -62,7 +62,7 @@ module Virtual
def self.compile_module expression , method
clazz = BootSpace.space.get_or_create_class name
clazz = Space.space.get_or_create_class name
raise "uups #{clazz}.#{name}" unless clazz
to = Return.new(Reference , clazz )
method.add_code Set.new( to , clazz )
@ -73,7 +73,7 @@ module Virtual
def self.compile_string expression , method
value = StringConstant.new(expression.string)
to = Return.new(Reference , value)
BootSpace.space.add_object value
Space.space.add_object value
method.add_code Set.new( to , value )
to
end

View File

@ -9,7 +9,7 @@ module Virtual
r = expression.receiver ? Compiler.compile(expression.receiver, method ) : Self.new()
new_method = CompiledMethod.new(expression.name , args , r )
new_method.class_name = r.is_a?(BootClass) ? r.name : method.class_name
clazz = BootSpace.space.get_or_create_class(new_method.class_name)
clazz = Space.space.get_or_create_class(new_method.class_name)
clazz.add_instance_method new_method
#frame = frame.new_frame

View File

@ -6,7 +6,7 @@ module Virtual
end
def self.compile_class expression , method
clazz = ::BootSpace.space.get_or_create_class expression.name
clazz = ::Space.space.get_or_create_class expression.name
puts "Created class #{clazz.name.inspect}"
expression.expressions.each do |expr|
# check if it's a function definition and add