Class PhiTypeResolver

java.lang.Object
com.android.dx.ssa.PhiTypeResolver

public class PhiTypeResolver extends Object
Resolves the result types of phi instructions. When phi instructions are inserted, their result types are set to BT_VOID (which is a nonsensical type for a register) but must be resolve to a real type before converting out of SSA form.

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.

  • Method Details

    • process

      public static void process(SsaMethod ssaMeth)
      Resolves all phi types in the method
      Parameters:
      ssaMeth - method to process