Class DexArrayIndexConstantInliner

java.lang.Object
sootup.apk.frontend.interceptors.DexArrayIndexConstantInliner
All Implemented Interfaces:
BodyInterceptor

public class DexArrayIndexConstantInliner extends Object implements BodyInterceptor
Inlines constant array indices.

Dex has no array instruction with an immediate index: arr[1] = x compiles to const/4 v0, 1; aput v1, v2, v0, so the Jimple index is a local (arr[v0] = x) where javac-compiled bytecode has the constant (arr[1] = x). This rewrites an array index local to its constant when every definition reaching that use assigns the same int constant, so dex bodies get the same shape as bytecode bodies and an analysis can tell array elements apart.

Reaching definitions follow normal and exceptional predecessors, so a definition that reaches a handler only through an exception is not missed. A use with any non-constant reaching definition, or with none found, is left unchanged.

  • Constructor Details

    • DexArrayIndexConstantInliner

      public DexArrayIndexConstantInliner()
  • Method Details