| Modifier and Type | Field and Description |
|---|---|
| private final IntList | cases
|
| private final boolean | packed
whether the output table will be packed (vs. sparse) |
| private final CodeAddress[] | targets
|
| private final CodeAddress | user
|
| Access | Constructor and Description |
|---|---|
| public | SwitchData(SourcePosition
non-null; source positionnon-null; address representing the instruction that
uses this instancenon-null; sorted list of switch cases (keys)non-null; corresponding list of code addresses; the
branch target for each caseConstructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| protected String | argString()
Implements abstract org. |
| public int | codeSize()
Implements abstract org. |
| public boolean | Returns: true iff the data is to be packedReturns whether or not this instance's data will be output as packed. |
| protected String | listingString0(boolean
whether to include an explicit notation of
constant pool indices noteIndices)Implements abstract org. listingString, which returns the string
form of this instance suitable for inclusion in a
human-oriented listing dump, not including the instruction
address and without respect for any output formatting.
|
| private static long | Returns: >= -1; the packed table size or -1 if the
cases couldn't possibly be represented as a packed tablenon-null; sorted list of casesGets the size of a packed table for the given cases, in 16-bit code units. |
| private static boolean | Returns: true iff the table encoding the cases
should be packednon-null; sorted list of casesDetermines whether the given list of cases warrant being packed. |
| private static long | Returns: > 0; the sparse table sizenon-null; sorted list of casesGets the size of a sparse table for the given cases, in 16-bit code units. |
| public DalvInsn | withRegisters(RegisterSpecList
non-null; new register listImplements abstract org. |
| public void | writeTo(AnnotatedOutput
non-null; where to write toImplements abstract org. |
| cases | back to summary |
|---|---|
| private final IntList cases
| |
| packed | back to summary |
|---|---|
| private final boolean packed whether the output table will be packed (vs. sparse) | |
| targets | back to summary |
|---|---|
| private final CodeAddress[] targets
| |
| user | back to summary |
|---|---|
| private final CodeAddress user
| |
| SwitchData | back to summary |
|---|---|
| public SwitchData(SourcePosition position, CodeAddress user, IntList cases, CodeAddress[] targets) Constructs an instance. The output address of this instance is initially
unknown (
| |
| argString | back to summary |
|---|---|
| protected String argString() Implements abstract org. Doc from org. Gets the string form for any arguments to this instance. Subclasses must override this. | |
| codeSize | back to summary |
|---|---|
| public int codeSize() Implements abstract org. Doc from org. Gets the size of this instruction, in 16-bit code units.
| |
| isPacked | back to summary |
|---|---|
| public boolean isPacked() Returns whether or not this instance's data will be output as packed.
| |
| listingString0 | back to summary |
|---|---|
| protected String listingString0(boolean noteIndices) Implements abstract org. Doc from org. Helper for | |
| packedCodeSize | back to summary |
|---|---|
| private static long packedCodeSize(IntList cases) Gets the size of a packed table for the given cases, in 16-bit code units.
| |
| shouldPack | back to summary |
|---|---|
| private static boolean shouldPack(IntList cases) Determines whether the given list of cases warrant being packed.
| |
| sparseCodeSize | back to summary |
|---|---|
| private static long sparseCodeSize(IntList cases) Gets the size of a sparse table for the given cases, in 16-bit code units.
| |
| withRegisters | back to summary |
|---|---|
| public DalvInsn withRegisters(RegisterSpecList registers) Implements abstract org. Doc from org. Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(AnnotatedOutput out) Implements abstract org. Doc from org. Writes this instance to the given output. This method should never annotate the output.
| |