public class OldClassInstrumentor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
org.robolectric.internal.bytecode.ClassInstrumentor.Decorator |
Constructor and Description |
---|
OldClassInstrumentor(org.robolectric.internal.bytecode.ClassInstrumentor.Decorator decorator) |
Modifier and Type | Method and Description |
---|---|
protected void |
addDirectCallConstructor(MutableClass mutableClass)
Generates code like this:
|
MutableClass |
analyzeClass(byte[] origClassBytes,
InstrumentationConfiguration config,
ClassNodeProvider classNodeProvider) |
protected void |
generateClassHandlerCall(MutableClass mutableClass,
org.objectweb.asm.tree.MethodNode originalMethod,
java.lang.String originalMethodName,
org.robolectric.internal.bytecode.RobolectricGeneratorAdapter generator) |
byte[] |
instrument(byte[] origBytes,
InstrumentationConfiguration config,
ClassNodeProvider classNodeProvider) |
void |
instrument(MutableClass mutableClass) |
protected void |
interceptInvokeVirtualMethod(MutableClass mutableClass,
java.util.ListIterator<org.objectweb.asm.tree.AbstractInsnNode> instructions,
org.objectweb.asm.tree.MethodInsnNode targetMethod)
Decides to call through the appropriate method to intercept the method with an INVOKEVIRTUAL Opcode, depending if the invokedynamic bytecode instruction is available (Java 7+).
|
protected void |
writeCallToInitializing(MutableClass mutableClass,
org.robolectric.internal.bytecode.RobolectricGeneratorAdapter generator) |
public OldClassInstrumentor(org.robolectric.internal.bytecode.ClassInstrumentor.Decorator decorator)
protected void addDirectCallConstructor(MutableClass mutableClass)
Generates code like this:
public ThisClass(DirectObjectMarker dom, ThisClass domInstance) {
super(dom, domInstance);
__robo_data__ = domInstance;
}
protected void writeCallToInitializing(MutableClass mutableClass, org.robolectric.internal.bytecode.RobolectricGeneratorAdapter generator)
protected void generateClassHandlerCall(MutableClass mutableClass, org.objectweb.asm.tree.MethodNode originalMethod, java.lang.String originalMethodName, org.robolectric.internal.bytecode.RobolectricGeneratorAdapter generator)
protected void interceptInvokeVirtualMethod(MutableClass mutableClass, java.util.ListIterator<org.objectweb.asm.tree.AbstractInsnNode> instructions, org.objectweb.asm.tree.MethodInsnNode targetMethod)
Decides to call through the appropriate method to intercept the method with an INVOKEVIRTUAL Opcode, depending if the invokedynamic bytecode instruction is available (Java 7+).
public MutableClass analyzeClass(byte[] origClassBytes, InstrumentationConfiguration config, ClassNodeProvider classNodeProvider)
public byte[] instrument(byte[] origBytes, InstrumentationConfiguration config, ClassNodeProvider classNodeProvider)
public void instrument(MutableClass mutableClass)