Class Instrumenter
java.lang.Object
com.offbynull.coroutines.instrumenter.Instrumenter
Instruments methods in Java classes that are intended to be run as coroutines. Tested with Java 1.4 and Java 8, so hopefully thing should
work with all versions of Java inbetween.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aInstrumenterobject.Instrumenter(List<File> classpath) Constructs aInstrumenterobject from a filesystem classpath (folders and JARs). -
Method Summary
Modifier and TypeMethodDescriptioninstrument(byte[] input, InstrumentationSettings settings) Instruments a class.private org.objectweb.asm.tree.ClassNodereconstructStackMapFrames(org.objectweb.asm.tree.ClassNode classNode) private voidverifyClassIntegrity(org.objectweb.asm.tree.ClassNode classNode)
-
Field Details
-
classRepo
-
-
Constructor Details
-
Instrumenter
Constructs aInstrumenterobject from a filesystem classpath (folders and JARs).- Parameters:
classpath- classpath JARs and folders to use for instrumentation (this is needed by ASM to generate stack map frames).- Throws:
IOException- if classes in the classpath could not be loaded upNullPointerException- if any argument isnullor containsnull
-
Instrumenter
Constructs aInstrumenterobject.- Parameters:
repo- class information repository (this is needed by ASM to generate stack map frames).- Throws:
NullPointerException- if any argument isnull
-
-
Method Details
-
instrument
Instruments a class.- Parameters:
input- class file contentssettings- instrumentation settings- Returns:
- instrumentation results
- Throws:
IllegalArgumentException- if the class could not be instrumented for some reasonNullPointerException- if any argument isnull
-
verifyClassIntegrity
private void verifyClassIntegrity(org.objectweb.asm.tree.ClassNode classNode) -
reconstructStackMapFrames
private org.objectweb.asm.tree.ClassNode reconstructStackMapFrames(org.objectweb.asm.tree.ClassNode classNode)
-