add a list of symbols to boot space
This commit is contained in:
parent
0ad147f70b
commit
21177bd7ce
@ -110,7 +110,7 @@ module Register
|
|||||||
end
|
end
|
||||||
|
|
||||||
def assemble_BootSpace(space)
|
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
|
end
|
||||||
|
|
||||||
def assemble_BootClass(clazz)
|
def assemble_BootClass(clazz)
|
||||||
@ -179,6 +179,9 @@ module Register
|
|||||||
def add_BootSpace(space)
|
def add_BootSpace(space)
|
||||||
add_object(space.classes)
|
add_object(space.classes)
|
||||||
add_object(space.objects)
|
add_object(space.objects)
|
||||||
|
add_object(space.symbols)
|
||||||
|
add_object(space.messages)
|
||||||
|
add_object(space.frames)
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_BootClass(clazz)
|
def add_BootClass(clazz)
|
||||||
|
@ -22,9 +22,12 @@ module Virtual
|
|||||||
@main = Virtual::CompiledMethod.new("main" , [] )
|
@main = Virtual::CompiledMethod.new("main" , [] )
|
||||||
#global objects (data)
|
#global objects (data)
|
||||||
@objects = []
|
@objects = []
|
||||||
|
@symbols = []
|
||||||
|
@messages = []
|
||||||
|
@frames = []
|
||||||
@passes = [ Virtual::SendImplementation ]
|
@passes = [ Virtual::SendImplementation ]
|
||||||
end
|
end
|
||||||
attr_reader :main , :classes , :objects
|
attr_reader :main , :classes , :objects , :symbols,:messages,:frames
|
||||||
|
|
||||||
def run_passes
|
def run_passes
|
||||||
@passes.each do |pass|
|
@passes.each do |pass|
|
||||||
@ -91,16 +94,19 @@ module Virtual
|
|||||||
end
|
end
|
||||||
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
|
def layout
|
||||||
@@SPACE
|
@@SPACE
|
||||||
end
|
end
|
||||||
|
|
||||||
# Objects are data and get assembled after functions
|
# Objects are data and get assembled after functions
|
||||||
def add_object o
|
def add_object o
|
||||||
return if @objects.include? o
|
return if @objects.include?(o)
|
||||||
# raise "must be derived from Code #{o.inspect}" unless o.is_a? Virtual::Code
|
@objects << o
|
||||||
@objects << o # TODO check type , no basic values allowed (must be wrapped)
|
if o.is_a? Symbol
|
||||||
|
@symbols << o
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# this is the way to instantiate classes (not BootClass.new)
|
# this is the way to instantiate classes (not BootClass.new)
|
||||||
@ -115,7 +121,7 @@ module Virtual
|
|||||||
c
|
c
|
||||||
end
|
end
|
||||||
def mem_length
|
def mem_length
|
||||||
padded_words( 2 )
|
padded_words( 5 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user