start implementing return for constant

This commit is contained in:
Torsten Ruger
2017-04-14 10:52:23 +03:00
parent 73b7e2b22f
commit c885888f4a
3 changed files with 41 additions and 1 deletions

View File

@ -10,5 +10,14 @@ module Vool
@return_value.collect(arr)
super
end
# To return form a method in mom instructions we need to do three things:
# - store the given return value, this is a SlotMove / SlotConstant
# - restore the previous message
# - jump to the return address
def to_mom( method )
[Mom::SlotConstant.new([:message , :return_value] , @return_value)]
end
end
end