Package soot.toDex
Class RegisterAllocator
- java.lang.Object
-
- soot.toDex.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 Summary
Constructors Constructor Description RegisterAllocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegisterasImmediate(Value v, ConstantVisitor constantV)RegisterasLocal(Local local)voidasParameter(SootMethod sm, Local l)RegisterasTmpReg(Type regType)Map<Local,Integer>getLocalToRegisterMapping()intgetParamRegCount()intgetRegCount()voidincreaseRegCount(int amount)voidlockRegister(Register reg)Locks the given register.voidresetImmediateConstantsPool()
-
-
-
Method Detail
-
resetImmediateConstantsPool
public void resetImmediateConstantsPool()
-
asParameter
public void asParameter(SootMethod sm, Local l)
-
asImmediate
public Register asImmediate(Value v, ConstantVisitor constantV)
-
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
-
-