extractTupleElement

fun extractTupleElement(tupleReg: L2ReadBoxedOperand, index: Int): L2ReadBoxedOperand

Given a register that will hold a tuple and a fixed index that is known to be in range, generate code and answer a L2ReadBoxedOperand that accesses that element.

Depending on the source of the tuple, this may cause the creation of the tuple to be entirely elided.

This must only be used while the controlFlowGraph is still in SSA form.

Return

A L2ReadBoxedOperands that provides that element of the tuple, whether by tracing the source of the instruction that created the tuple or by extracting the value from the tuple.

Parameters

tupleReg

The L2BoxedRegister containing the tuple.

index

The one-based subscript into the tuple.