extractTupleElement

Produce an L2ReadBoxedOperand that provides the specified index of the tuple in the given register. If the source of that index is not readily available, generate code to produce it from the tuple, and answer the resulting L2ReadBoxedOperand.

Parameters

tupleReg

The L2ReadBoxedOperand holding the tuple.

index

The one-based index of the tuple element to extract.

generator

The L2Generator on which to write code to extract the tuple element, if necessary.

An L2ReadBoxedOperand that will contain the specified tuple element.