adds a return jump

that will be used to jump to the return sequence
This commit is contained in:
Torsten Ruger 2018-08-02 17:34:44 +03:00
parent 050659ea12
commit 4d4b691a4b
2 changed files with 17 additions and 0 deletions

View File

@ -37,6 +37,7 @@ require_relative "resolve_method"
require_relative "truth_check"
require_relative "not_same_check"
require_relative "jump"
require_relative "return_jump"
require_relative "slot_load"
require_relative "return_sequence"
require_relative "message_setup"

View File

@ -0,0 +1,16 @@
module Mom
# the return jump jumps to the return label
# the method setup is such that there is exactly one return_label in a method
# This is so the actual code that executes the return can be quite complicated
# and big, and won't be repeated
#
class ReturnJump < Instruction
def to_risc(compiler)
Risc::Branch.new(self , compiler.return_label)
end
end
end