Package proguard.classfile.util
Class ArrayInitializationMatcher
- java.lang.Object
-
- proguard.classfile.util.ArrayInitializationMatcher
-
public class ArrayInitializationMatcher extends java.lang.Object
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
Constructors Constructor Description ArrayInitializationMatcher()
Creates a new ArrayInitializationMatcher.ArrayInitializationMatcher(PartialEvaluator partialEvaluator)
Creates a new ArrayInitializationMatcher that will use the given partial evaluator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
array()
Returns the recent static array initialization.int
arrayInitializationEnd()
Returns the last offset of the recent static array initialization.int
arrayInitializationStart()
Returns the first offset of the recent static array initialization, i.e.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.
-
-
-
Constructor Detail
-
ArrayInitializationMatcher
public ArrayInitializationMatcher()
Creates a new ArrayInitializationMatcher.
-
ArrayInitializationMatcher
public ArrayInitializationMatcher(PartialEvaluator partialEvaluator)
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 Detail
-
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
public java.lang.Object array()
Returns the recent static array initialization.
-
-