slot docs and rename

This commit is contained in:
Torsten Ruger
2015-06-21 00:21:42 +03:00
parent eeaf2d97de
commit 6867175bd1
9 changed files with 56 additions and 40 deletions

View File

@ -7,14 +7,14 @@ module Virtual
def self.compile_callsite expession , method
me = Compiler.compile( expession.receiver , method )
method.info.add_code NewMessage.new
method.info.add_code Set.new(NewSelf.new(me.type), me)
method.info.add_code Set.new(NewName.new(), expession.name.to_sym)
method.info.add_code Set.new(NextSelf.new(me.type), me)
method.info.add_code Set.new(NextMessageName.new(), expession.name.to_sym)
compiled_args = []
expession.args.each_with_index do |arg , i|
#compile in the running method, ie before passing control
val = Compiler.compile( arg , method)
# move the compiled value to it's slot in the new message
to = NewMessageSlot.new(i ,val.type , val)
to = NextMessageSlot.new(i ,val.type , val)
# (doing this immediately, not after the loop, so if it's a return it won't get overwritten)
method.info.add_code Set.new(to , val )
compiled_args << to