add a list of symbols to boot space

This commit is contained in:
Torsten Ruger 2014-09-19 19:11:30 +03:00
parent 0ad147f70b
commit 21177bd7ce
2 changed files with 16 additions and 7 deletions

View File

@ -110,7 +110,7 @@ module Register
end
def assemble_BootSpace(space)
assemble_self(space , [space.classes,space.objects] )
assemble_self(space , [space.classes,space.objects, space.symbols,space.messages,space.frames] )
end
def assemble_BootClass(clazz)
@ -179,6 +179,9 @@ module Register
def add_BootSpace(space)
add_object(space.classes)
add_object(space.objects)
add_object(space.symbols)
add_object(space.messages)
add_object(space.frames)
end
def add_BootClass(clazz)

View File

@ -22,9 +22,12 @@ module Virtual
@main = Virtual::CompiledMethod.new("main" , [] )
#global objects (data)
@objects = []
@symbols = []
@messages = []
@frames = []
@passes = [ Virtual::SendImplementation ]
end
attr_reader :main , :classes , :objects
attr_reader :main , :classes , :objects , :symbols,:messages,:frames
def run_passes
@passes.each do |pass|
@ -91,16 +94,19 @@ module Virtual
end
end
@@SPACE = { :names => [:classes,:objects] , :types => [Virtual::Reference,Virtual::Reference]}
@@SPACE = { :names => [:classes,:objects,:symbols,:messages,:frames] ,
:types => [Virtual::Reference,Virtual::Reference,Virtual::Reference,Virtual::Reference,Virtual::Reference]}
def layout
@@SPACE
end
# Objects are data and get assembled after functions
def add_object o
return if @objects.include? o
# raise "must be derived from Code #{o.inspect}" unless o.is_a? Virtual::Code
@objects << o # TODO check type , no basic values allowed (must be wrapped)
return if @objects.include?(o)
@objects << o
if o.is_a? Symbol
@symbols << o
end
end
# this is the way to instantiate classes (not BootClass.new)
@ -115,7 +121,7 @@ module Virtual
c
end
def mem_length
padded_words( 2 )
padded_words( 5 )
end
end
end