diff --git a/lib/mom/instruction/instruction.rb b/lib/mom/instruction/instruction.rb index de6cc5a4..0e4d5d21 100644 --- a/lib/mom/instruction/instruction.rb +++ b/lib/mom/instruction/instruction.rb @@ -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" diff --git a/lib/mom/instruction/return_jump.rb b/lib/mom/instruction/return_jump.rb new file mode 100644 index 00000000..d5de1131 --- /dev/null +++ b/lib/mom/instruction/return_jump.rb @@ -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