Moves the contents of a given operand register into a given target register. This is similar to an
assign
bytecode, except that the register's contents are
voided afterwards. This guarantees that the register is no longer live, which is useful for determining the live ranges of registers in a function or method. For example, the following Whiley code:
function f(int x, int y) => int: x = x + 1 return x
can be translated into the following WyIL code:
function f(int x, int y) => int: body: ifge %0, %1 goto blklab0 : int move %0 = %1 : int .blklab0 return %0 : int
Here we see that when
x < y
the value of
y
(held in register
%1
) is
moved into variable
x
(held in register
%0
). This is safe because register
%1
is no longer live at that point.
@author David J. Pearce