Package soot.toDex

Class RegisterAllocator


  • public class RegisterAllocator
    extends Object
    An allocator for registers. It keeps track of locals to re-use their registers.

    Note that a register number can increase beyond 65535 / 16 bit, since the instruction formats should check for their register limits themselves.
    • Constructor Detail

      • RegisterAllocator

        public RegisterAllocator()
    • Method Detail

      • resetImmediateConstantsPool

        public void resetImmediateConstantsPool()
      • getLocalToRegisterMapping

        public Map<Local,​Integer> getLocalToRegisterMapping()
      • increaseRegCount

        public void increaseRegCount​(int amount)
      • getParamRegCount

        public int getParamRegCount()
      • getRegCount

        public int getRegCount()
      • lockRegister

        public void lockRegister​(Register reg)
        Locks the given register. This prevents the register from being re-used for storing constants.
        Parameters:
        reg - The register to lock