Rename SetRegister to CopyRegister

This name matches the purpose of the instruction more closely: copying
the value of one register into another.
parent 0fdaf451
Pipeline #163666747 passed with stages
in 66 minutes and 22 seconds
......@@ -86,7 +86,7 @@ module Inkoc
GetGlobal
SetGlobal
Throw
SetRegister
CopyRegister
TailCall
ProcessSuspendCurrent
IntegerGreaterOrEqual
......
......@@ -1450,7 +1450,7 @@ module Inkoc
# The block used for the "false" argument.
if_false = process_node(node.arguments.fetch(2), body)
body.instruct(:Unary, :SetRegister, result, if_false, loc)
body.instruct(:Unary, :CopyRegister, result, if_false, loc)
body.instruct(:SkipNextBlock, loc)
# The block used for the "true" argument.
......@@ -1458,7 +1458,7 @@ module Inkoc
if_true = process_node(node.arguments.fetch(1), body)
body.instruct(:Unary, :SetRegister, result, if_true, loc)
body.instruct(:Unary, :CopyRegister, result, if_true, loc)
body.add_connected_basic_block
......@@ -1517,14 +1517,14 @@ module Inkoc
try_block = body.add_connected_basic_block
try_reg = process_node(node.expression, body)
body.instruct(:Unary, :SetRegister, ret_reg, try_reg, node.location)
body.instruct(:Unary, :CopyRegister, ret_reg, try_reg, node.location)
body.instruct(:SkipNextBlock, node.location)
# Block for error handling
else_block = body.add_connected_basic_block
else_reg = register_for_else_block(node, body, catch_reg)
body.instruct(:Unary, :SetRegister, ret_reg, else_reg, node.location)
body.instruct(:Unary, :CopyRegister, ret_reg, else_reg, node.location)
# Block for everything that comes after our "try" expression.
body.add_connected_basic_block
......
......@@ -84,7 +84,7 @@ pub enum InstructionType {
GetGlobal,
SetGlobal,
Throw,
SetRegister,
CopyRegister,
TailCall,
ProcessSuspendCurrent,
IntegerGreaterOrEqual,
......
......@@ -1130,7 +1130,7 @@ impl Machine {
throw_value!(self, process, value, context, index);
}
InstructionType::SetRegister => {
InstructionType::CopyRegister => {
let value = context.get_register(instruction.arg(1));
context.set_register(instruction.arg(0), value);
......
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