more renaming of frame

This commit is contained in:
Torsten Ruger
2016-12-21 18:51:22 +02:00
parent 0040baae28
commit 93ba5543b3
13 changed files with 35 additions and 35 deletions

View File

@ -19,13 +19,13 @@ module Typed
# TODO, check type @method.arguments[index].type
return Register.set_slot(statement , value , :message , Parfait::Message.get_indexed(index) )
end
# or a local so it is in the frame
# or a local so it is in the named_list
index = @method.has_local( name )
return nil unless index
# TODO, check type @method.locals[index].type
frame = use_reg(:NamedList)
add_code Register.get_slot(statement , :message , :frame , frame )
return Register.set_slot(statement , value , frame , Parfait::NamedList.get_indexed(index) )
named_list = use_reg(:NamedList)
add_code Register.get_slot(statement , :message , :named_list , named_list )
return Register.set_slot(statement , value , named_list , Parfait::NamedList.get_indexed(index) )
end
end
end

View File

@ -17,7 +17,7 @@ module Typed
add_code Register.get_slot(statement , :message , Parfait::Message.get_indexed(index), ret )
return ret
end
# or a local so it is in the frame
# or a local so it is in the named_list
handle_local(statement)
end
@ -26,10 +26,10 @@ module Typed
def handle_local statement
index = @method.has_local( statement.name )
raise "must define variable '#{statement.name}' before using it" unless index
frame = use_reg :NamedList
add_code Register.get_slot(statement , :message , :frame , frame )
named_list = use_reg :NamedList
add_code Register.get_slot(statement , :message , :named_list , named_list )
ret = use_reg @method.locals_type( index )
add_code Register.get_slot(statement , frame , Parfait::NamedList.get_indexed(index), ret )
add_code Register.get_slot(statement , named_list , Parfait::NamedList.get_indexed(index), ret )
return ret
end

View File

@ -9,7 +9,7 @@
module Parfait
class Message < Object
attributes [:next_message , :receiver , :frame , :return_address ]
attributes [:next_message , :receiver , :named_list , :return_address ]
attributes [:return_value, :caller , :name ]
include Indexed
@ -17,7 +17,7 @@ module Parfait
def initialize next_m
self.next_message = next_m
self.frame = NamedList.new()
self.named_list = NamedList.new()
self.caller = nil
super()
end

View File

@ -8,10 +8,10 @@
# A Message with is arguments, and a NamedList make up the two sides of message passing:
# A Message (see details there) is created by the caller and control is transferred
# A NamedList is created by the receiver
# PS: it turns out that both messages and frames are created at compile, not run-time, and
# just constantly reused. Each message has a frame object ready and is also linked
# PS: it turns out that both messages and named_lists are created at compile, not run-time, and
# just constantly reused. Each message has a named_list object ready and is also linked
# to the next message.
# The better way to say above is that a message is *used* by the caller, and a frame by the callee.
# The better way to say above is that a message is *used* by the caller, and a named_list by the callee.
# Also at runtime Messages and NamedLists remain completely "normal" objects.
# Ie they have have type and instances and so on.*