The resolve is done as an iterative merge of each phi's operand types. Phi operands may be themselves be the result of unresolved phis, and the algorithm tries to find the most-fit type (for example, if every operand is the same constant value or the same local variable info, we want that to be reflected).
This algorithm assumes a dead-code remover has already removed all circular-only phis that may have been inserted.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv SsaMethod | |
| private final BitSet | worklist
indexed by register; all registers still defined by unresolved phis |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | Returns: true if equalReturns true if a and b are equal, whether or not either of them are null. |
| public static void | |
| pack-priv boolean | Returns: true if the result type changed, false if no changeResolves the result of a phi insn based on its operands. |
| private void |
| ssaMeth | back to summary |
|---|---|
| pack-priv SsaMethod ssaMeth | |
| worklist | back to summary |
|---|---|
| private final BitSet worklist indexed by register; all registers still defined by unresolved phis | |
| PhiTypeResolver | back to summary |
|---|---|
| private PhiTypeResolver(SsaMethod ssaMeth) | |
| equalsHandlesNulls | back to summary |
|---|---|
| private static boolean equalsHandlesNulls(LocalItem a, LocalItem b) Returns true if a and b are equal, whether or not either of them are null.
| |
| process | back to summary |
|---|---|
| public static void process(SsaMethod ssaMeth) Resolves all phi types in the method
| |
| resolveResultType | back to summary |
|---|---|
| pack-priv boolean resolveResultType(PhiInsn insn) Resolves the result of a phi insn based on its operands. The "void" type, which is a nonsensical type for a register, is used for registers defined by as-of-yet-unresolved phi operations.
| |
| run | back to summary |
|---|---|
| private void run() Runs the phi-type resolver. | |