Class RegisterFormatter


  • public class RegisterFormatter
    extends java.lang.Object
    This class contains the logic used for formatting registers
    • Field Detail

      • registerCount

        public final int registerCount
      • parameterRegisterCount

        public final int parameterRegisterCount
    • Constructor Detail

      • RegisterFormatter

        public RegisterFormatter​(@Nonnull
                                 BaksmaliOptions options,
                                 int registerCount,
                                 int parameterRegisterCount)
    • Method Detail

      • writeRegisterRange

        public void writeRegisterRange​(BaksmaliWriter writer,
                                       int startRegister,
                                       int lastRegister)
                                throws java.io.IOException
        Write out the register range value used by Format3rc. If baksmali.noParameterRegisters is true, it will always output the registers in the v format. But if false, then it will check if *both* registers are parameter registers, and if so, use the p format for both. If only the last register is a parameter register, it will use the v format for both, otherwise it would be confusing to have something like {v20 .. p1}
        Parameters:
        writer - the BaksmaliWriter to write to
        startRegister - the first register in the range
        lastRegister - the last register in the range
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(BaksmaliWriter writer,
                            int register)
                     throws java.io.IOException
        Writes a register with the appropriate format. If baksmali.noParameterRegisters is true, then it will always output a register in the v format. If false, then it determines if the register is a parameter register, and if so, formats it in the p format instead.
        Parameters:
        writer - the BaksmaliWriter to write to
        register - the register number
        Throws:
        java.io.IOException