correctly linking frames and messages
This commit is contained in:
@ -21,8 +21,9 @@
|
||||
# Which resolves the dichotomy of objects on the stack or heap. Sama sama.
|
||||
|
||||
module Parfait
|
||||
class Frame < List
|
||||
def initialize
|
||||
class Frame < Object
|
||||
def initialize next_f
|
||||
@next_frame = next_f
|
||||
super()
|
||||
end
|
||||
end
|
||||
|
@ -5,6 +5,11 @@
|
||||
module Parfait
|
||||
class Message < Object
|
||||
|
||||
def initialize next_m
|
||||
@next_message = next_m
|
||||
super()
|
||||
end
|
||||
|
||||
def get_type_for(name)
|
||||
index = @layout.get_index(name)
|
||||
get_at(index)
|
||||
|
@ -29,7 +29,7 @@ module Parfait
|
||||
@locals = List.new
|
||||
@tmps = List.new
|
||||
end
|
||||
attr_reader :name , :arg_names , :for_class , :code
|
||||
attr_reader :name , :arg_names , :for_class , :code , :locals , :tmps
|
||||
|
||||
|
||||
# determine whether this method has a variable by the given name
|
||||
|
@ -29,21 +29,18 @@ module Parfait
|
||||
@classes = Parfait::Dictionary.new_object
|
||||
@syscall_message = nil # a hack sto store the message during syscall
|
||||
end
|
||||
attr_reader :classes , :frames, :messages, :next_message , :next_frame
|
||||
attr_reader :classes , :next_message , :next_frame
|
||||
|
||||
# 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 = List.new_object
|
||||
@messages = List.new_object
|
||||
counter = 0
|
||||
while( counter < 5)
|
||||
@frames.push Frame.new_object
|
||||
@messages.push Message.new_object
|
||||
counter = counter + 1
|
||||
@next_message = Message.new(nil)
|
||||
@next_frame = Frame.new(nil)
|
||||
5.times do |i|
|
||||
@next_message = Message.new @next_message
|
||||
@next_frame = Frame.new @next_frame
|
||||
end
|
||||
@next_message = @messages.first
|
||||
@next_frame = @frames.first
|
||||
init_layout
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user