public class AsmClassGenerator extends ClassGenerator
Modifier and Type | Field and Description |
---|---|
static boolean |
ASM_DEBUG |
static boolean |
CREATE_DEBUG_INFO |
static boolean |
CREATE_LINE_NUMBER_INFO |
static MethodCallerMultiAdapter |
getField |
static MethodCallerMultiAdapter |
getGroovyObjectField |
static MethodCallerMultiAdapter |
setProperty |
innerClasses
AALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASM4, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DOUBLE, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F_APPEND, F_CHOP, F_FULL, F_NEW, F_SAME, F_SAME1, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAT, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, H_GETFIELD, H_GETSTATIC, H_INVOKEINTERFACE, H_INVOKESPECIAL, H_INVOKESTATIC, H_INVOKEVIRTUAL, H_NEWINVOKESPECIAL, H_PUTFIELD, H_PUTSTATIC, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INTEGER, INVOKEDYNAMIC, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LONG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, NULL, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, TOP, UNINITIALIZED_THIS, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7
Constructor and Description |
---|
AsmClassGenerator(SourceUnit source,
GeneratorContext context,
org.objectweb.asm.ClassVisitor classVisitor,
String sourceFile) |
getInnerClasses
addError, visitClassCodeContainer, visitImports, visitObjectInitializerStatements, visitPackage
visitEmptyStatement, visitListOfExpressions, visitShortTernaryExpression
public static final MethodCallerMultiAdapter getField
public static final MethodCallerMultiAdapter getGroovyObjectField
public static final MethodCallerMultiAdapter setProperty
public static final boolean CREATE_DEBUG_INFO
public static final boolean CREATE_LINE_NUMBER_INFO
public static final boolean ASM_DEBUG
public AsmClassGenerator(SourceUnit source, GeneratorContext context, org.objectweb.asm.ClassVisitor classVisitor, String sourceFile)
public SourceUnit getSourceUnit()
getSourceUnit
in class ClassGenerator
public WriterController getController()
public void visitClass(ClassNode classNode)
GroovyClassVisitor
visitClass
in interface GroovyClassVisitor
visitClass
in class ClassCodeVisitorSupport
public void visitGenericType(GenericsType genericsType)
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)
visitConstructorOrMethod
in class ClassCodeVisitorSupport
public void visitConstructor(ConstructorNode node)
GroovyClassVisitor
visitConstructor
in interface GroovyClassVisitor
visitConstructor
in class ClassCodeVisitorSupport
public void visitMethod(MethodNode node)
GroovyClassVisitor
visitMethod
in interface GroovyClassVisitor
visitMethod
in class ClassCodeVisitorSupport
public void visitField(FieldNode fieldNode)
GroovyClassVisitor
visitField
in interface GroovyClassVisitor
visitField
in class ClassCodeVisitorSupport
public void visitProperty(PropertyNode statement)
GroovyClassVisitor
visitProperty
in interface GroovyClassVisitor
visitProperty
in class ClassCodeVisitorSupport
protected void visitStatement(Statement statement)
visitStatement
in class ClassCodeVisitorSupport
public void visitCatchStatement(CatchStatement statement)
visitCatchStatement
in interface GroovyCodeVisitor
visitCatchStatement
in class ClassCodeVisitorSupport
public void visitBlockStatement(BlockStatement block)
visitBlockStatement
in interface GroovyCodeVisitor
visitBlockStatement
in class ClassCodeVisitorSupport
public void visitForLoop(ForStatement loop)
visitForLoop
in interface GroovyCodeVisitor
visitForLoop
in class ClassCodeVisitorSupport
public void visitWhileLoop(WhileStatement loop)
visitWhileLoop
in interface GroovyCodeVisitor
visitWhileLoop
in class ClassCodeVisitorSupport
public void visitDoWhileLoop(DoWhileStatement loop)
visitDoWhileLoop
in interface GroovyCodeVisitor
visitDoWhileLoop
in class ClassCodeVisitorSupport
public void visitIfElse(IfStatement ifElse)
visitIfElse
in interface GroovyCodeVisitor
visitIfElse
in class ClassCodeVisitorSupport
public void visitAssertStatement(AssertStatement statement)
visitAssertStatement
in interface GroovyCodeVisitor
visitAssertStatement
in class ClassCodeVisitorSupport
public void visitTryCatchFinally(TryCatchStatement statement)
visitTryCatchFinally
in interface GroovyCodeVisitor
visitTryCatchFinally
in class ClassCodeVisitorSupport
public void visitSwitch(SwitchStatement statement)
visitSwitch
in interface GroovyCodeVisitor
visitSwitch
in class ClassCodeVisitorSupport
public void visitCaseStatement(CaseStatement statement)
visitCaseStatement
in interface GroovyCodeVisitor
visitCaseStatement
in class ClassCodeVisitorSupport
public void visitBreakStatement(BreakStatement statement)
visitBreakStatement
in interface GroovyCodeVisitor
visitBreakStatement
in class ClassCodeVisitorSupport
public void visitContinueStatement(ContinueStatement statement)
visitContinueStatement
in interface GroovyCodeVisitor
visitContinueStatement
in class ClassCodeVisitorSupport
public void visitSynchronizedStatement(SynchronizedStatement statement)
visitSynchronizedStatement
in interface GroovyCodeVisitor
visitSynchronizedStatement
in class ClassCodeVisitorSupport
public void visitThrowStatement(ThrowStatement statement)
visitThrowStatement
in interface GroovyCodeVisitor
visitThrowStatement
in class ClassCodeVisitorSupport
public void visitReturnStatement(ReturnStatement statement)
visitReturnStatement
in interface GroovyCodeVisitor
visitReturnStatement
in class ClassCodeVisitorSupport
public void visitExpressionStatement(ExpressionStatement statement)
visitExpressionStatement
in interface GroovyCodeVisitor
visitExpressionStatement
in class ClassCodeVisitorSupport
public void visitTernaryExpression(TernaryExpression expression)
visitTernaryExpression
in interface GroovyCodeVisitor
visitTernaryExpression
in class CodeVisitorSupport
public void visitDeclarationExpression(DeclarationExpression expression)
visitDeclarationExpression
in interface GroovyCodeVisitor
visitDeclarationExpression
in class ClassCodeVisitorSupport
public void visitBinaryExpression(BinaryExpression expression)
visitBinaryExpression
in interface GroovyCodeVisitor
visitBinaryExpression
in class CodeVisitorSupport
public void visitPostfixExpression(PostfixExpression expression)
visitPostfixExpression
in interface GroovyCodeVisitor
visitPostfixExpression
in class CodeVisitorSupport
public void throwException(String s)
public void visitPrefixExpression(PrefixExpression expression)
visitPrefixExpression
in interface GroovyCodeVisitor
visitPrefixExpression
in class CodeVisitorSupport
public void visitClosureExpression(ClosureExpression expression)
visitClosureExpression
in interface GroovyCodeVisitor
visitClosureExpression
in class CodeVisitorSupport
protected void loadThisOrOwner()
public void visitConstantExpression(ConstantExpression expression)
visitConstantExpression
in interface GroovyCodeVisitor
visitConstantExpression
in class CodeVisitorSupport
public void visitSpreadExpression(SpreadExpression expression)
visitSpreadExpression
in interface GroovyCodeVisitor
visitSpreadExpression
in class CodeVisitorSupport
public void visitSpreadMapExpression(SpreadMapExpression expression)
visitSpreadMapExpression
in interface GroovyCodeVisitor
visitSpreadMapExpression
in class CodeVisitorSupport
public void visitMethodPointerExpression(MethodPointerExpression expression)
visitMethodPointerExpression
in interface GroovyCodeVisitor
visitMethodPointerExpression
in class CodeVisitorSupport
public void visitUnaryMinusExpression(UnaryMinusExpression expression)
visitUnaryMinusExpression
in interface GroovyCodeVisitor
visitUnaryMinusExpression
in class CodeVisitorSupport
public void visitUnaryPlusExpression(UnaryPlusExpression expression)
visitUnaryPlusExpression
in interface GroovyCodeVisitor
visitUnaryPlusExpression
in class CodeVisitorSupport
public void visitBitwiseNegationExpression(BitwiseNegationExpression expression)
visitBitwiseNegationExpression
in interface GroovyCodeVisitor
visitBitwiseNegationExpression
in class CodeVisitorSupport
public void visitCastExpression(CastExpression castExpression)
visitCastExpression
in interface GroovyCodeVisitor
visitCastExpression
in class CodeVisitorSupport
public void visitNotExpression(NotExpression expression)
visitNotExpression
in interface GroovyCodeVisitor
visitNotExpression
in class CodeVisitorSupport
public void visitBooleanExpression(BooleanExpression expression)
visitBooleanExpression
in interface GroovyCodeVisitor
visitBooleanExpression
in class CodeVisitorSupport
expression
- public void visitMethodCallExpression(MethodCallExpression call)
visitMethodCallExpression
in interface GroovyCodeVisitor
visitMethodCallExpression
in class CodeVisitorSupport
protected boolean emptyArguments(Expression arguments)
public static boolean containsSpreadExpression(Expression arguments)
public static int argumentSize(Expression arguments)
public void visitStaticMethodCallExpression(StaticMethodCallExpression call)
visitStaticMethodCallExpression
in interface GroovyCodeVisitor
visitStaticMethodCallExpression
in class CodeVisitorSupport
public void visitConstructorCallExpression(ConstructorCallExpression call)
visitConstructorCallExpression
in interface GroovyCodeVisitor
visitConstructorCallExpression
in class CodeVisitorSupport
public void visitPropertyExpression(PropertyExpression expression)
visitPropertyExpression
in interface GroovyCodeVisitor
visitPropertyExpression
in class CodeVisitorSupport
public void visitAttributeExpression(AttributeExpression expression)
visitAttributeExpression
in interface GroovyCodeVisitor
visitAttributeExpression
in class CodeVisitorSupport
public void visitFieldExpression(FieldExpression expression)
visitFieldExpression
in interface GroovyCodeVisitor
visitFieldExpression
in class CodeVisitorSupport
public void loadStaticField(FieldExpression fldExp)
fldExp
- public void loadInstanceField(FieldExpression fldExp)
fldExp
- public void visitVariableExpression(VariableExpression expression)
visitVariableExpression
in interface GroovyCodeVisitor
visitVariableExpression
in class CodeVisitorSupport
protected void createInterfaceSyntheticStaticFields()
protected void createSyntheticStaticFields()
public void visitClassExpression(ClassExpression expression)
visitClassExpression
in interface GroovyCodeVisitor
visitClassExpression
in class CodeVisitorSupport
public void visitRangeExpression(RangeExpression expression)
visitRangeExpression
in interface GroovyCodeVisitor
visitRangeExpression
in class CodeVisitorSupport
public void visitMapEntryExpression(MapEntryExpression expression)
visitMapEntryExpression
in interface GroovyCodeVisitor
visitMapEntryExpression
in class CodeVisitorSupport
public void visitMapExpression(MapExpression expression)
visitMapExpression
in interface GroovyCodeVisitor
visitMapExpression
in class CodeVisitorSupport
public void visitArgumentlistExpression(ArgumentListExpression ale)
visitArgumentlistExpression
in interface GroovyCodeVisitor
visitArgumentlistExpression
in class CodeVisitorSupport
public void despreadList(List expressions, boolean wrap)
public void visitTupleExpression(TupleExpression expression)
visitTupleExpression
in interface GroovyCodeVisitor
visitTupleExpression
in class CodeVisitorSupport
public void loadWrapper(Expression argument)
public void visitArrayExpression(ArrayExpression expression)
visitArrayExpression
in interface GroovyCodeVisitor
visitArrayExpression
in class CodeVisitorSupport
public void visitClosureListExpression(ClosureListExpression expression)
visitClosureListExpression
in interface GroovyCodeVisitor
visitClosureListExpression
in class CodeVisitorSupport
public void visitBytecodeSequence(BytecodeSequence bytecodeSequence)
visitBytecodeSequence
in class ClassGenerator
public void visitListExpression(ListExpression expression)
visitListExpression
in interface GroovyCodeVisitor
visitListExpression
in class CodeVisitorSupport
public void visitGStringExpression(GStringExpression expression)
visitGStringExpression
in interface GroovyCodeVisitor
visitGStringExpression
in class CodeVisitorSupport
public void visitAnnotations(AnnotatedNode node)
visitAnnotations
in class ClassCodeVisitorSupport
public void visitBytecodeExpression(BytecodeExpression cle)
visitBytecodeExpression
in interface GroovyCodeVisitor
visitBytecodeExpression
in class CodeVisitorSupport
public static boolean isThisExpression(Expression expression)
protected CompileUnit getCompileUnit()
public boolean addInnerClass(ClassNode innerClass)