Package proguard.classfile.util
Class ArrayInitializationMatcher
java.lang.Object
proguard.classfile.util.ArrayInitializationMatcher
This class finds sequences of instructions that correspond to primitive array initializations.
Such initializations may be represented more efficiently in other bytecode languages.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ArrayInitializationMatcher.ArrayInitializationMatcher(PartialEvaluator partialEvaluator) Creates a new ArrayInitializationMatcher that will use the given partial evaluator. -
Method Summary
Modifier and TypeMethodDescriptionarray()Returns the recent static array initialization.intReturns the last offset of the recent static array initialization.intReturns the first offset of the recent static array initialization, i.e.booleanmatchesArrayInitialization(Clazz clazz, Method method, CodeAttribute codeAttribute, int newArrayOffset, SimpleInstruction newArrayInstruction) Returns whether the code fragment starting at the specified newarray instruction is followed by a static array initialization.
-
Constructor Details
-
ArrayInitializationMatcher
public ArrayInitializationMatcher()Creates a new ArrayInitializationMatcher. -
ArrayInitializationMatcher
Creates a new ArrayInitializationMatcher that will use the given partial evaluator. The evaluator must have been initialized before trying to match any array initializations.- Parameters:
partialEvaluator- the evaluator to be used for the analysis.
-
-
Method Details
-
matchesArrayInitialization
public boolean matchesArrayInitialization(Clazz clazz, Method method, CodeAttribute codeAttribute, int newArrayOffset, SimpleInstruction newArrayInstruction) Returns whether the code fragment starting at the specified newarray instruction is followed by a static array initialization.- Parameters:
clazz- the class.method- the method.codeAttribute- the code attribute.newArrayOffset- the offset of the newarray instruction.newArrayInstruction- the newarray instruction.- Returns:
- whether there is a static array initialization.
-
arrayInitializationStart
public int arrayInitializationStart()Returns the first offset of the recent static array initialization, i.e. the first initialization instruction after the newarray. -
arrayInitializationEnd
public int arrayInitializationEnd()Returns the last offset of the recent static array initialization. -
array
Returns the recent static array initialization.
-