Class SimpleClassWriter
java.lang.Object
org.objectweb.asm.ClassVisitor
org.objectweb.asm.ClassWriter
com.offbynull.coroutines.instrumenter.asm.SimpleClassWriter
public final class SimpleClassWriter
extends org.objectweb.asm.ClassWriter
A
ClassWriter
that overrides getCommonSuperClass(java.lang.String, java.lang.String)
such that it uses
ClassInformationRepository
to derive the common super rather than querying loaded up classes.-
Field Summary
FieldsFields inherited from class org.objectweb.asm.ClassWriter
COMPUTE_FRAMES, COMPUTE_MAXS
Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleClassWriter
(int flags, ClassInformationRepository infoRepo) Constructs aSimpleClassWriter
object.SimpleClassWriter
(org.objectweb.asm.ClassReader classReader, int flags, ClassInformationRepository infoRepo) Constructs aSimpleClassWriter
object. -
Method Summary
Modifier and TypeMethodDescriptionprivate LinkedHashSet
<String> flattenHierarchy
(String type) protected String
getCommonSuperClass
(String type1, String type2) Derives common super class from the super name mapping passed in to the constructor.Methods inherited from class org.objectweb.asm.ClassWriter
getClassLoader, hasFlags, newClass, newConst, newConstantDynamic, newField, newHandle, newHandle, newInvokeDynamic, newMethod, newMethodType, newModule, newNameType, newPackage, newUTF8, setFlags, toByteArray, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate
-
Field Details
-
infoRepo
-
-
Constructor Details
-
SimpleClassWriter
Constructs aSimpleClassWriter
object. SeeClassWriter(int)
.- Parameters:
flags
- option flags that can be used to modify the default behavior of this class. SeeClassWriter.COMPUTE_MAXS
,ClassWriter.COMPUTE_FRAMES
.infoRepo
- class hierarchy mappings for deriving stack map frames- Throws:
NullPointerException
- if any argument isnull
-
SimpleClassWriter
public SimpleClassWriter(org.objectweb.asm.ClassReader classReader, int flags, ClassInformationRepository infoRepo) Constructs aSimpleClassWriter
object. SeeClassWriter(org.objectweb.asm.ClassReader, int)
.- Parameters:
classReader
- theClassReader
used to read the original class. It will be used to copy the entire constant pool from the original class and also to copy other fragments of original bytecode where applicable.flags
- option flags that can be used to modify the default behavior of this class. SeeClassWriter.COMPUTE_MAXS
,ClassWriter.COMPUTE_FRAMES
.infoRepo
- class hierarchy mappings for deriving stack map frames- Throws:
NullPointerException
- if any argument isnull
-
-
Method Details
-
getCommonSuperClass
Derives common super class from the super name mapping passed in to the constructor.- Overrides:
getCommonSuperClass
in classorg.objectweb.asm.ClassWriter
- Parameters:
type1
- the internal name of a class.type2
- the internal name of another class.- Returns:
- the internal name of the common super class of the two given classes
- Throws:
NullPointerException
- if any argument isnull
-
flattenHierarchy
-