Rename "block return" to "method return"

What was called a "block return" didn't return from just the block, it
would return from the surrounding method. Thus, using the term "method
return" is more accurate and less confusing.
parent 7f3364b3
Pipeline #162183457 passed with stages
in 58 minutes and 3 seconds
......@@ -120,11 +120,11 @@ module Inkoc
end
def on_return(tir_ins, compiled_code, *)
block_return = tir_ins.block_return ? 1 : 0
method_return = tir_ins.method_return ? 1 : 0
register = tir_ins.register.id
compiled_code
.instruct(:Return, [block_return, register], tir_ins.location)
.instruct(:Return, [method_return, register], tir_ins.location)
end
def on_run_block(tir_ins, compiled_code, *)
......
......@@ -1490,9 +1490,9 @@ module Inkoc
get_nil(body, location)
end
block_return = body.type.closure?
method_return = body.type.closure?
body.instruct(:Return, block_return, register, location)
body.instruct(:Return, method_return, register, location)
body.add_basic_block
end
......
......@@ -7,10 +7,10 @@ module Inkoc
include Predicates
include Inspect
attr_reader :block_return, :register, :location
attr_reader :method_return, :register, :location
def initialize(block_return, register, location)
@block_return = block_return
def initialize(method_return, register, location)
@method_return = method_return
@register = register
@location = location
end
......
......@@ -396,14 +396,14 @@ impl Machine {
break 'exec_loop;
}
let block_return = instruction.arg(0) == 1;
let method_return = instruction.arg(0) == 1;
let object = instruction
.arg_opt(1)
.map(|r| context.get_register(r))
.unwrap_or(self.state.nil_object);
if block_return {
if method_return {
process::unwind_until_defining_scope(process);
context = process.context_mut();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment