bit more on booting of the space

This commit is contained in:
Torsten Ruger
2015-05-24 19:59:19 +03:00
parent 2ccbea04b9
commit 5670f07eac
6 changed files with 29 additions and 17 deletions

View File

@ -21,12 +21,9 @@
# Which resolves the dichotomy of objects on the stack or heap. Sama sama.
module Parfait
class Frame < Object
def initialize locals , temps
class Frame < List
def initialize
super()
@locals = locals
@tmps = tmps
end
attr_accessor :locals , :tmps
end
end

View File

@ -44,6 +44,11 @@ module Parfait
self.set( self.get_length + 1 , value)
end
def first
return nil unless empty?
get(1)
end
# set the value at index.
# Lists start from index 1
def set( index , value)

View File

@ -37,8 +37,14 @@ module Parfait
# need a two phase init for the object space (and generally parfait) because the space
# is an interconnected graph, so not everthing is ready
def late_init
@frames = 100.times.collect{ ::Parfait::Frame.new([],[])}
@messages = 100.times.collect{ ::Parfait::Message.new }
@frames = List.new_object
@messages = List.new_object
counter = 0
while( counter < 100)
@frames.push Frame.new_object
@messages.push Message.new_object
counter = counter + 1
end
@next_message = @messages.first
@next_frame = @frames.first
end
@ -70,8 +76,8 @@ module Parfait
end
def create_class name , superclass
c = Class.new_object(name , superclass)
raise "uups " if name.is_a? String
c = Class.new_object(name , superclass)
@classes[name] = c
end
end