L2Register

abstract class L2Register(val uniqueValue: Int) : L2Entity

L2Register models the conceptual use of a register by a level two Avail operation in the L2Generator.

Author

Mark van Gulik

Todd L Smith

Parameters

uniqueValue

A value used to distinguish distinct registers.

Inheritors

Constructors

Link copied to clipboard
constructor(uniqueValue: Int)

Construct a new L2BoxedRegister.

Types

Link copied to clipboard

One of the kinds of registers that Level Two supports.

Properties

Link copied to clipboard

Answer the kind of register this is. Different register kinds are allocated from different virtual banks, and do not interfere in terms of register liveness computation.

Link copied to clipboard

A value used to distinguish distinct registers.

Functions

Link copied to clipboard

Record this L2WriteOperand in my set of defining write operands.

Link copied to clipboard
fun addUse(read: L2ReadOperand<*>)

Capture another L2ReadOperand of an emitted L2Instruction that uses this register.

Link copied to clipboard

Answer a new register like this one, but where the uniqueValue has been set to the finalIndex.

Link copied to clipboard
abstract fun copyForRegenerator(regenerator: L2Regenerator): L2Register

Answer a copy of the receiver. Subclasses can be covariantly stronger in the return type.

Link copied to clipboard
abstract fun copyForTranslator(generator: L2Generator): L2Register

Answer a new register like this one.

Link copied to clipboard

Answer the L2WriteOperand of an L2Instruction which assigns this register in the SSA control flow graph. It must have been assigned already, and there must be exactly one (when the control flow graph is in SSA form).

Link copied to clipboard

Answer the L2WriteOperands which assign this register in the control flow graph, which is not necessarily in SSA form. It must be non-empty.

Link copied to clipboard

Answer the coloring number to be used by the interpreter at runtime to identify the storage location of a register.

Link copied to clipboard

Answer the prefix for non-constant registers. This is used only for register printing.

Link copied to clipboard

Remove the given L2WriteOperand as one of the writers to this register.

Link copied to clipboard
fun removeUse(read: L2ReadOperand<*>)

Drop a use of this register by an L2ReadOperand of an L2Instruction that is now dead.

Link copied to clipboard
fun setFinalIndex(theFinalIndex: Int)

Set the coloring number to be used by the interpreter at runtime to identify the storage location of an L2Register.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Answer the Set of L2ReadOperands that read from this register. Callers must not modify the returned collection.