L2IntRegister

class L2IntRegister(debugValue: Int) : L2Register

L2IntRegister models the conceptual usage of a register that can store a machine integer.

Author

Todd L Smith

Parameters

debugValue

A value used to distinguish the new instance visually during debugging of L2 translations.

Constructors

Link copied to clipboard
fun L2IntRegister(debugValue: Int)

Construct a new L2IntRegister.

Functions

Link copied to clipboard
fun addDefinition(write: L2WriteOperand<*>)

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
open override fun copyAfterColoring(): L2IntRegister

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

Link copied to clipboard
open override fun copyForRegenerator(regenerator: L2Regenerator): L2IntRegister

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

Link copied to clipboard
open override fun copyForTranslator(generator: L2Generator): L2IntRegister

Answer a new register like this one.

Link copied to clipboard
fun definition(): L2WriteOperand<*>

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
fun definitions(): Collection<L2WriteOperand<*>>

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
fun finalIndex(): Int

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

Link copied to clipboard
fun namePrefix(): String

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

Link copied to clipboard
fun removeDefinition(write: L2WriteOperand<*>)

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
fun uses(): Set<L2ReadOperand<*>>

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

Properties

Link copied to clipboard
open override val registerKind: L2Register.RegisterKind

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
val uniqueValue: Int

A value used to distinguish distinct registers.