passing compiler to to_mom, not method

To be able to delegate scope (block/method) things later
This commit is contained in:
Torsten Ruger
2018-07-05 14:02:38 +03:00
parent 16d91f24ce
commit 3f80953385
15 changed files with 78 additions and 74 deletions

View File

@ -24,8 +24,9 @@ module Vool
# To return form a method in mom instructions we only need to do two things:
# - store the given return value, this is a SlotMove
# - activate return sequence (reinstantiate old message and jump to return address)
def to_mom( method )
ret = Mom::SlotLoad.new( [:message , :return_value] , @return_value.slot_definition(method) )
def to_mom( compiler )
ret = Mom::SlotLoad.new( [:message , :return_value] ,
@return_value.slot_definition(compiler) )
ret << Mom::ReturnSequence.new
end