| Modifier and Type | Field and Description |
|---|---|
| private InstructionSelect | |
| private int[] | |
| private int | |
| private InstructionHandle[] |
| Access | Constructor and Description |
|---|---|
| public | SwitchBuilder(int[]
array of match values (case 2: ... case 7: ..., etc.) match, InstructionHandle[] the instructions to be branched to for each case targets, InstructionHandle the default target target, int maximum gap that may between case branches max_gap)Template for switch() constructs. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private final void | |
| public final InstructionSelect | |
| private final boolean | Returns: match is sorted in ascending order with no gap bigger than max_gap?
|
| private final void |
| instruction | back to summary |
|---|---|
| private InstructionSelect instruction | |
| match | back to summary |
|---|---|
| private int[] match | |
| match_length | back to summary |
|---|---|
| private int match_length | |
| targets | back to summary |
|---|---|
| private InstructionHandle[] targets | |
| SwitchBuilder | back to summary |
|---|---|
| public SwitchBuilder(int[] match, InstructionHandle[] targets, InstructionHandle target, int max_gap) Template for switch() constructs. If the match array can be sorted in ascending order with gaps no larger than max_gap between the numbers, a TABLESWITCH instruction is generated, and a LOOKUPSWITCH otherwise. The former may be more efficient, but needs more space. Note, that the key array always will be sorted, though we leave the original arrays unaltered.
| |
| SwitchBuilder | back to summary |
|---|---|
| public SwitchBuilder(int[] match, InstructionHandle[] targets, InstructionHandle target) | |
| fillup | back to summary |
|---|---|
| private final void fillup(int max_gap, InstructionHandle target) | |
| getInstruction | back to summary |
|---|---|
| public final InstructionSelect getInstruction() | |
| matchIsOrdered | back to summary |
|---|---|
private final boolean matchIsOrdered(int max_gap)
| |
| sort | back to summary |
|---|---|
| private final void sort(int l, int r) Sort match and targets array with QuickSort. | |