Class OldClassInstrumentor
java.lang.Object
org.robolectric.internal.bytecode.ClassInstrumentor
org.robolectric.internal.bytecode.OldClassInstrumentor
public class OldClassInstrumentor extends ClassInstrumentor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.internal.bytecode.ClassInstrumentor
ClassInstrumentor.Decorator
-
Constructor Summary
Constructors Constructor Description OldClassInstrumentor(ClassInstrumentor.Decorator decorator)
-
Method Summary
Modifier and Type Method Description protected void
addDirectCallConstructor(MutableClass mutableClass)
Generates code like this:protected void
generateClassHandlerCall(MutableClass mutableClass, org.objectweb.asm.tree.MethodNode originalMethod, String originalMethodName, RobolectricGeneratorAdapter generator)
protected void
interceptInvokeVirtualMethod(MutableClass mutableClass, 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, RobolectricGeneratorAdapter generator)
Methods inherited from class org.robolectric.internal.bytecode.ClassInstrumentor
directMethodName, exceptionArray, instrument, instrument, instrumentNativeMethod, instrumentNormalMethod, makeMethodPrivate, makeMethodPublic
-
Constructor Details
-
Method Details
-
addDirectCallConstructor
Generates code like this:public ThisClass(DirectObjectMarker dom, ThisClass domInstance) { super(dom, domInstance); __robo_data__ = domInstance; }
- Specified by:
addDirectCallConstructor
in classClassInstrumentor
-
writeCallToInitializing
protected void writeCallToInitializing(MutableClass mutableClass, RobolectricGeneratorAdapter generator)- Specified by:
writeCallToInitializing
in classClassInstrumentor
-
generateClassHandlerCall
protected void generateClassHandlerCall(MutableClass mutableClass, org.objectweb.asm.tree.MethodNode originalMethod, String originalMethodName, RobolectricGeneratorAdapter generator)- Specified by:
generateClassHandlerCall
in classClassInstrumentor
-
interceptInvokeVirtualMethod
protected void interceptInvokeVirtualMethod(MutableClass mutableClass, 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+).- Specified by:
interceptInvokeVirtualMethod
in classClassInstrumentor
-