adds a return jump
that will be used to jump to the return sequence
This commit is contained in:
parent
050659ea12
commit
4d4b691a4b
@ -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"
|
||||
|
16
lib/mom/instruction/return_jump.rb
Normal file
16
lib/mom/instruction/return_jump.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user