Search in sources :

Example 1 with INVOKESPECIAL

use of org.objectweb.asm.Opcodes.INVOKESPECIAL in project groovy by apache.

the class StaticTypesCallSiteWriter method writeListDotProperty.

private void writeListDotProperty(final Expression receiver, final String propertyName, final boolean safe) {
    // for lists, replace list.foo with:
    // def result = new ArrayList(list.size())
    // for (item in list) result.add(item.foo)
    // result
    ClassNode componentType = receiver.getNodeMetaData(StaticCompilationMetadataKeys.COMPONENT_TYPE);
    if (componentType == null) {
        componentType = OBJECT_TYPE;
    }
    CompileStack compileStack = controller.getCompileStack();
    MethodVisitor mv = controller.getMethodVisitor();
    Label exit = new Label();
    if (safe) {
        receiver.visit(controller.getAcg());
        Label doGet = new Label();
        mv.visitJumpInsn(IFNONNULL, doGet);
        controller.getOperandStack().remove(1);
        mv.visitInsn(ACONST_NULL);
        mv.visitJumpInsn(GOTO, exit);
        mv.visitLabel(doGet);
    }
    Variable tmpList = varX("tmpList", ClassHelper.make(ArrayList.class));
    int var = compileStack.defineTemporaryVariable(tmpList, false);
    Variable iterator = varX("iterator", Iterator_TYPE);
    int it = compileStack.defineTemporaryVariable(iterator, false);
    Variable nextVar = varX("next", componentType);
    final int next = compileStack.defineTemporaryVariable(nextVar, false);
    mv.visitTypeInsn(NEW, "java/util/ArrayList");
    mv.visitInsn(DUP);
    receiver.visit(controller.getAcg());
    mv.visitMethodInsn(INVOKEINTERFACE, "java/util/List", "size", "()I", true);
    controller.getOperandStack().remove(1);
    mv.visitMethodInsn(INVOKESPECIAL, "java/util/ArrayList", "<init>", "(I)V", false);
    mv.visitVarInsn(ASTORE, var);
    Label l1 = new Label();
    mv.visitLabel(l1);
    receiver.visit(controller.getAcg());
    mv.visitMethodInsn(INVOKEINTERFACE, "java/util/List", "iterator", "()Ljava/util/Iterator;", true);
    controller.getOperandStack().remove(1);
    mv.visitVarInsn(ASTORE, it);
    Label l2 = new Label();
    mv.visitLabel(l2);
    mv.visitVarInsn(ALOAD, it);
    mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true);
    Label l3 = new Label();
    mv.visitJumpInsn(IFEQ, l3);
    mv.visitVarInsn(ALOAD, it);
    mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true);
    mv.visitTypeInsn(CHECKCAST, BytecodeHelper.getClassInternalName(componentType));
    mv.visitVarInsn(ASTORE, next);
    Label l4 = new Label();
    mv.visitLabel(l4);
    mv.visitVarInsn(ALOAD, var);
    PropertyExpression pexp = propX(bytecodeX(componentType, v -> v.visitVarInsn(ALOAD, next)), propertyName);
    pexp.visit(controller.getAcg());
    controller.getOperandStack().box();
    controller.getOperandStack().remove(1);
    mv.visitMethodInsn(INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true);
    mv.visitInsn(POP);
    Label l5 = new Label();
    mv.visitLabel(l5);
    mv.visitJumpInsn(GOTO, l2);
    mv.visitLabel(l3);
    mv.visitVarInsn(ALOAD, var);
    if (safe) {
        mv.visitLabel(exit);
    }
    controller.getOperandStack().push(ClassHelper.make(ArrayList.class));
    controller.getCompileStack().removeVar(next);
    controller.getCompileStack().removeVar(it);
    controller.getCompileStack().removeVar(var);
}
Also used : ASTORE(org.objectweb.asm.Opcodes.ASTORE) MethodVisitor(org.objectweb.asm.MethodVisitor) GETSTATIC(org.objectweb.asm.Opcodes.GETSTATIC) GeneralUtils.classX(org.codehaus.groovy.ast.tools.GeneralUtils.classX) Number_TYPE(org.codehaus.groovy.ast.ClassHelper.Number_TYPE) ClassHelper.isBigDecimalType(org.codehaus.groovy.ast.ClassHelper.isBigDecimalType) Variable(org.codehaus.groovy.ast.Variable) NEW(org.objectweb.asm.Opcodes.NEW) StaticTypeCheckingSupport.chooseBestMethod(org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.chooseBestMethod) INVOKEINTERFACE(org.objectweb.asm.Opcodes.INVOKEINTERFACE) BytecodeHelper(org.codehaus.groovy.classgen.asm.BytecodeHelper) GeneralUtils.nullX(org.codehaus.groovy.ast.tools.GeneralUtils.nullX) Map(java.util.Map) GeneralUtils.propX(org.codehaus.groovy.ast.tools.GeneralUtils.propX) AALOAD(org.objectweb.asm.Opcodes.AALOAD) ClassHelper.isBigIntegerType(org.codehaus.groovy.ast.ClassHelper.isBigIntegerType) BytecodeExpression(org.codehaus.groovy.classgen.BytecodeExpression) PropertyNode(org.codehaus.groovy.ast.PropertyNode) ClassHelper.isWrapperLong(org.codehaus.groovy.ast.ClassHelper.isWrapperLong) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) GROOVY_OBJECT_TYPE(org.codehaus.groovy.ast.ClassHelper.GROOVY_OBJECT_TYPE) LIST_TYPE(org.codehaus.groovy.ast.ClassHelper.LIST_TYPE) Collection(java.util.Collection) GeneralUtils.args(org.codehaus.groovy.ast.tools.GeneralUtils.args) BeanUtils.capitalize(org.apache.groovy.util.BeanUtils.capitalize) IFNULL(org.objectweb.asm.Opcodes.IFNULL) MethodCallerMultiAdapter(org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter) ClassNodeUtils.getField(org.apache.groovy.ast.tools.ClassNodeUtils.getField) ClassHelper.getUnwrapper(org.codehaus.groovy.ast.ClassHelper.getUnwrapper) GeneralUtils.callX(org.codehaus.groovy.ast.tools.GeneralUtils.callX) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) GETFIELD(org.objectweb.asm.Opcodes.GETFIELD) GroovyBugError(org.codehaus.groovy.GroovyBugError) CallSiteWriter(org.codehaus.groovy.classgen.asm.CallSiteWriter) ExpressionUtils.isThisExpression(org.apache.groovy.ast.tools.ExpressionUtils.isThisExpression) StaticTypeCheckingSupport.findDGMMethodsByNameAndArguments(org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.findDGMMethodsByNameAndArguments) DUP(org.objectweb.asm.Opcodes.DUP) CLASS_Type(org.codehaus.groovy.ast.ClassHelper.CLASS_Type) List(java.util.List) StaticTypeCheckingSupport.implementsInterfaceOrIsSubclassOf(org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.implementsInterfaceOrIsSubclassOf) CompileStack(org.codehaus.groovy.classgen.asm.CompileStack) OBJECT_TYPE(org.codehaus.groovy.ast.ClassHelper.OBJECT_TYPE) GeneralUtils.bytecodeX(org.codehaus.groovy.ast.tools.GeneralUtils.bytecodeX) ACC_PUBLIC(org.objectweb.asm.Opcodes.ACC_PUBLIC) IFNONNULL(org.objectweb.asm.Opcodes.IFNONNULL) STRING_TYPE(org.codehaus.groovy.ast.ClassHelper.STRING_TYPE) ClassHelper.getWrapper(org.codehaus.groovy.ast.ClassHelper.getWrapper) GOTO(org.objectweb.asm.Opcodes.GOTO) GeneralUtils.constX(org.codehaus.groovy.ast.tools.GeneralUtils.constX) GeneralUtils.isOrImplements(org.codehaus.groovy.ast.tools.GeneralUtils.isOrImplements) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) ClassHelper.int_TYPE(org.codehaus.groovy.ast.ClassHelper.int_TYPE) ClassHelper.isWrapperInteger(org.codehaus.groovy.ast.ClassHelper.isWrapperInteger) Label(org.objectweb.asm.Label) ACC_STATIC(org.objectweb.asm.Opcodes.ACC_STATIC) ArrayList(java.util.ArrayList) PUTFIELD(org.objectweb.asm.Opcodes.PUTFIELD) IFEQ(org.objectweb.asm.Opcodes.IFEQ) INVOKESTATIC(org.objectweb.asm.Opcodes.INVOKESTATIC) MethodNode(org.codehaus.groovy.ast.MethodNode) ACONST_NULL(org.objectweb.asm.Opcodes.ACONST_NULL) CLOSURE_TYPE(org.codehaus.groovy.ast.ClassHelper.CLOSURE_TYPE) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) GeneralUtils.varX(org.codehaus.groovy.ast.tools.GeneralUtils.varX) Expression(org.codehaus.groovy.ast.expr.Expression) CHECKCAST(org.objectweb.asm.Opcodes.CHECKCAST) POP(org.objectweb.asm.Opcodes.POP) Parameter(org.codehaus.groovy.ast.Parameter) MAP_TYPE(org.codehaus.groovy.ast.ClassHelper.MAP_TYPE) InvokerHelper(org.codehaus.groovy.runtime.InvokerHelper) ClassNode(org.codehaus.groovy.ast.ClassNode) OperandStack(org.codehaus.groovy.classgen.asm.OperandStack) ClassHelper(org.codehaus.groovy.ast.ClassHelper) ClassHelper.isStringType(org.codehaus.groovy.ast.ClassHelper.isStringType) AsmClassGenerator(org.codehaus.groovy.classgen.AsmClassGenerator) ClassHelper.isPrimitiveBoolean(org.codehaus.groovy.ast.ClassHelper.isPrimitiveBoolean) GeneralUtils.castX(org.codehaus.groovy.ast.tools.GeneralUtils.castX) StaticCompilationMetadataKeys(org.codehaus.groovy.transform.sc.StaticCompilationMetadataKeys) StaticTypesMarker(org.codehaus.groovy.transform.stc.StaticTypesMarker) ClassHelper.isGeneratedFunction(org.codehaus.groovy.ast.ClassHelper.isGeneratedFunction) ARRAYLENGTH(org.objectweb.asm.Opcodes.ARRAYLENGTH) StaticTypeCheckingSupport.isClassClassNodeWrappingConcreteType(org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.isClassClassNodeWrappingConcreteType) TypeChooser(org.codehaus.groovy.classgen.asm.TypeChooser) GeneralUtils.callThisX(org.codehaus.groovy.ast.tools.GeneralUtils.callThisX) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) ASTNode(org.codehaus.groovy.ast.ASTNode) ClassHelper.isClassType(org.codehaus.groovy.ast.ClassHelper.isClassType) ClassHelper.isPrimitiveType(org.codehaus.groovy.ast.ClassHelper.isPrimitiveType) FieldNode(org.codehaus.groovy.ast.FieldNode) PUTSTATIC(org.objectweb.asm.Opcodes.PUTSTATIC) VariableSlotLoader(org.codehaus.groovy.classgen.asm.VariableSlotLoader) INVOKESPECIAL(org.objectweb.asm.Opcodes.INVOKESPECIAL) Iterator_TYPE(org.codehaus.groovy.ast.ClassHelper.Iterator_TYPE) SyntaxException(org.codehaus.groovy.syntax.SyntaxException) ALOAD(org.objectweb.asm.Opcodes.ALOAD) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) ClassNode(org.codehaus.groovy.ast.ClassNode) Variable(org.codehaus.groovy.ast.Variable) Label(org.objectweb.asm.Label) ArrayList(java.util.ArrayList) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) CompileStack(org.codehaus.groovy.classgen.asm.CompileStack) MethodVisitor(org.objectweb.asm.MethodVisitor)

Example 2 with INVOKESPECIAL

use of org.objectweb.asm.Opcodes.INVOKESPECIAL in project groovy by apache.

the class StaticTypesLambdaWriter method newGroovyLambdaWrapperAndLoad.

private void newGroovyLambdaWrapperAndLoad(final ClassNode lambdaClass, final LambdaExpression expression, final boolean accessingInstanceMembers) {
    CompileStack compileStack = controller.getCompileStack();
    OperandStack operandStack = controller.getOperandStack();
    MethodVisitor mv = controller.getMethodVisitor();
    String lambdaClassInternalName = BytecodeHelper.getClassInternalName(lambdaClass);
    mv.visitTypeInsn(NEW, lambdaClassInternalName);
    mv.visitInsn(DUP);
    if (controller.isStaticMethod() || compileStack.isInSpecialConstructorCall() || !accessingInstanceMembers) {
        classX(controller.getThisType()).visit(controller.getAcg());
    } else {
        loadThis();
    }
    operandStack.dup();
    loadSharedVariables(expression);
    Optional<ConstructorNode> generatedConstructor = lambdaClass.getDeclaredConstructors().stream().filter(ctor -> Boolean.TRUE.equals(ctor.getNodeMetaData(IS_GENERATED_CONSTRUCTOR))).findFirst();
    if (!generatedConstructor.isPresent()) {
        throw new GroovyBugError("Failed to find the generated constructor");
    }
    Parameter[] lambdaClassConstructorParameters = generatedConstructor.get().getParameters();
    mv.visitMethodInsn(INVOKESPECIAL, lambdaClassInternalName, "<init>", BytecodeHelper.getMethodDescriptor(VOID_TYPE, lambdaClassConstructorParameters), lambdaClass.isInterface());
    operandStack.replace(CLOSURE_TYPE, lambdaClassConstructorParameters.length);
}
Also used : OperandStack(org.codehaus.groovy.classgen.asm.OperandStack) MethodVisitor(org.objectweb.asm.MethodVisitor) WriterController(org.codehaus.groovy.classgen.asm.WriterController) LambdaWriter(org.codehaus.groovy.classgen.asm.LambdaWriter) GeneralUtils.classX(org.codehaus.groovy.ast.tools.GeneralUtils.classX) ClassHelper.findSAM(org.codehaus.groovy.ast.ClassHelper.findSAM) H_INVOKEVIRTUAL(org.objectweb.asm.Opcodes.H_INVOKEVIRTUAL) NEW(org.objectweb.asm.Opcodes.NEW) BytecodeHelper(org.codehaus.groovy.classgen.asm.BytecodeHelper) Map(java.util.Map) GeneralUtils.block(org.codehaus.groovy.ast.tools.GeneralUtils.block) VOID_TYPE(org.codehaus.groovy.ast.ClassHelper.VOID_TYPE) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) AstStringCompiler(org.codehaus.groovy.ast.builder.AstStringCompiler) INVOKEVIRTUAL(org.objectweb.asm.Opcodes.INVOKEVIRTUAL) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) SERIALIZABLE_TYPE(org.codehaus.groovy.ast.ClassHelper.SERIALIZABLE_TYPE) GroovyBugError(org.codehaus.groovy.GroovyBugError) DUP(org.objectweb.asm.Opcodes.DUP) List(java.util.List) CompileStack(org.codehaus.groovy.classgen.asm.CompileStack) OBJECT_TYPE(org.codehaus.groovy.ast.ClassHelper.OBJECT_TYPE) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) ACC_PUBLIC(org.objectweb.asm.Opcodes.ACC_PUBLIC) Optional(java.util.Optional) ClassHelper.long_TYPE(org.codehaus.groovy.ast.ClassHelper.long_TYPE) Statement(org.codehaus.groovy.ast.stmt.Statement) GeneralUtils.constX(org.codehaus.groovy.ast.tools.GeneralUtils.constX) CodeVisitorSupport(org.codehaus.groovy.ast.CodeVisitorSupport) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) ACC_FINAL(org.objectweb.asm.Opcodes.ACC_FINAL) ACC_PRIVATE(org.objectweb.asm.Opcodes.ACC_PRIVATE) HashMap(java.util.HashMap) GeneralUtils.declS(org.codehaus.groovy.ast.tools.GeneralUtils.declS) ACC_STATIC(org.objectweb.asm.Opcodes.ACC_STATIC) ClosureUtils.getParametersSafe(org.codehaus.groovy.ast.tools.ClosureUtils.getParametersSafe) GENERATED_LAMBDA_TYPE(org.codehaus.groovy.ast.ClassHelper.GENERATED_LAMBDA_TYPE) MethodNode(org.codehaus.groovy.ast.MethodNode) GeneralUtils.returnS(org.codehaus.groovy.ast.tools.GeneralUtils.returnS) CLOSURE_TYPE(org.codehaus.groovy.ast.ClassHelper.CLOSURE_TYPE) Expression(org.codehaus.groovy.ast.expr.Expression) SERIALIZEDLAMBDA_TYPE(org.codehaus.groovy.ast.ClassHelper.SERIALIZEDLAMBDA_TYPE) LinkedList(java.util.LinkedList) CHECKCAST(org.objectweb.asm.Opcodes.CHECKCAST) Parameter(org.codehaus.groovy.ast.Parameter) BytecodeInstruction(org.codehaus.groovy.classgen.BytecodeInstruction) ICONST_0(org.objectweb.asm.Opcodes.ICONST_0) ClassNode(org.codehaus.groovy.ast.ClassNode) OperandStack(org.codehaus.groovy.classgen.asm.OperandStack) GeneralUtils.cloneParams(org.codehaus.groovy.ast.tools.GeneralUtils.cloneParams) GeneralUtils.localVarX(org.codehaus.groovy.ast.tools.GeneralUtils.localVarX) StaticCompilationMetadataKeys(org.codehaus.groovy.transform.sc.StaticCompilationMetadataKeys) StaticTypesMarker(org.codehaus.groovy.transform.stc.StaticTypesMarker) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) INVOKESPECIAL(org.objectweb.asm.Opcodes.INVOKESPECIAL) BytecodeSequence(org.codehaus.groovy.classgen.BytecodeSequence) WriterControllerFactory(org.codehaus.groovy.classgen.asm.WriterControllerFactory) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) ALOAD(org.objectweb.asm.Opcodes.ALOAD) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) GroovyBugError(org.codehaus.groovy.GroovyBugError) Parameter(org.codehaus.groovy.ast.Parameter) CompileStack(org.codehaus.groovy.classgen.asm.CompileStack) MethodVisitor(org.objectweb.asm.MethodVisitor)

Example 3 with INVOKESPECIAL

use of org.objectweb.asm.Opcodes.INVOKESPECIAL in project groovy by apache.

the class AsmClassGenerator method visitStdMethod.

private void visitStdMethod(final MethodNode node, final boolean isConstructor, final Parameter[] parameters, final Statement code) {
    controller.getCompileStack().init(node.getVariableScope(), parameters);
    controller.getCallSiteWriter().makeSiteEntry();
    MethodVisitor mv = controller.getMethodVisitor();
    if (isConstructor && (code == null || !((ConstructorNode) node).firstStatementIsSpecialConstructorCall())) {
        boolean hasCallToSuper = false;
        if (code != null && controller.getClassNode().getOuterClass() != null) {
            // the call to super is already added so we must ensure not to add it twice
            if (code instanceof BlockStatement) {
                hasCallToSuper = ((BlockStatement) code).getStatements().stream().map(statement -> statement instanceof ExpressionStatement ? ((ExpressionStatement) statement).getExpression() : null).anyMatch(expression -> expression instanceof ConstructorCallExpression && ((ConstructorCallExpression) expression).isSuperCall());
            }
        }
        if (!hasCallToSuper) {
            if (code != null) {
                // GROOVY-9373
                controller.visitLineNumber(code.getLineNumber());
            }
            // add call to "super()"
            mv.visitVarInsn(ALOAD, 0);
            mv.visitMethodInsn(INVOKESPECIAL, controller.getInternalBaseClassName(), "<init>", "()V", false);
        }
    }
    if (code != null) {
        code.visit(this);
    }
    if (code == null || maybeFallsThrough(code)) {
        if (code != null) {
            // GROOVY-7647, GROOVY-9373
            controller.visitLineNumber(code.getLastLineNumber());
        }
        if (node.isVoidMethod()) {
            mv.visitInsn(RETURN);
        } else {
            ClassNode type = node.getReturnType();
            if (isPrimitiveType(type)) {
                mv.visitLdcInsn(Integer.valueOf(0));
                OperandStack operandStack = controller.getOperandStack();
                operandStack.push(ClassHelper.int_TYPE);
                operandStack.doGroovyCast(type);
                BytecodeHelper.doReturn(mv, type);
                operandStack.remove(1);
            } else {
                mv.visitInsn(ACONST_NULL);
                BytecodeHelper.doReturn(mv, type);
            }
        }
    }
    controller.getCompileStack().clear();
}
Also used : ASTORE(org.objectweb.asm.Opcodes.ASTORE) ATHROW(org.objectweb.asm.Opcodes.ATHROW) WriterController(org.codehaus.groovy.classgen.asm.WriterController) GeneralUtils.attrX(org.codehaus.groovy.ast.tools.GeneralUtils.attrX) GeneralUtils.classX(org.codehaus.groovy.ast.tools.GeneralUtils.classX) OptimizingStatementWriter(org.codehaus.groovy.classgen.asm.OptimizingStatementWriter) BytecodeHelper(org.codehaus.groovy.classgen.asm.BytecodeHelper) Map(java.util.Map) GeneralUtils.propX(org.codehaus.groovy.ast.tools.GeneralUtils.propX) Sealed(groovy.transform.Sealed) PropertyNode(org.codehaus.groovy.ast.PropertyNode) ACC_VARARGS(org.objectweb.asm.Opcodes.ACC_VARARGS) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) ClassHelper.isPrimitiveLong(org.codehaus.groovy.ast.ClassHelper.isPrimitiveLong) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) ClassNodeUtils.getField(org.apache.groovy.ast.tools.ClassNodeUtils.getField) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) T_BYTE(org.objectweb.asm.Opcodes.T_BYTE) SealedASTTransformation.sealedSkipAnnotation(org.codehaus.groovy.transform.SealedASTTransformation.sealedSkipAnnotation) ACC_SYNTHETIC(org.objectweb.asm.Opcodes.ACC_SYNTHETIC) TraceMethodVisitor(org.objectweb.asm.util.TraceMethodVisitor) ClassHelper.isPrimitiveDouble(org.codehaus.groovy.ast.ClassHelper.isPrimitiveDouble) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) ACC_FINAL(org.objectweb.asm.Opcodes.ACC_FINAL) ACC_PRIVATE(org.objectweb.asm.Opcodes.ACC_PRIVATE) InterfaceHelperClassNode(org.codehaus.groovy.ast.InterfaceHelperClassNode) ClassHelper.isPrimitiveShort(org.codehaus.groovy.ast.ClassHelper.isPrimitiveShort) ACC_PROTECTED(org.objectweb.asm.Opcodes.ACC_PROTECTED) T_INT(org.objectweb.asm.Opcodes.T_INT) PUTFIELD(org.objectweb.asm.Opcodes.PUTFIELD) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) INVOKESTATIC(org.objectweb.asm.Opcodes.INVOKESTATIC) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) ACONST_NULL(org.objectweb.asm.Opcodes.ACONST_NULL) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) GeneralUtils.maybeFallsThrough(org.codehaus.groovy.ast.tools.GeneralUtils.maybeFallsThrough) Expression(org.codehaus.groovy.ast.expr.Expression) DASTORE(org.objectweb.asm.Opcodes.DASTORE) ICONST_1(org.objectweb.asm.Opcodes.ICONST_1) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) SourceUnit(org.codehaus.groovy.control.SourceUnit) ICONST_0(org.objectweb.asm.Opcodes.ICONST_0) ClassNode(org.codehaus.groovy.ast.ClassNode) ClassHelper.isStringType(org.codehaus.groovy.ast.ClassHelper.isStringType) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) ClassHelper.isPrimitiveInt(org.codehaus.groovy.ast.ClassHelper.isPrimitiveInt) GenericsType(org.codehaus.groovy.ast.GenericsType) ClassHelper.isPrimitiveBoolean(org.codehaus.groovy.ast.ClassHelper.isPrimitiveBoolean) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) INVOKESPECIAL(org.objectweb.asm.Opcodes.INVOKESPECIAL) MopWriter(org.codehaus.groovy.classgen.asm.MopWriter) RecordComponentNode(org.codehaus.groovy.ast.RecordComponentNode) MethodVisitor(org.objectweb.asm.MethodVisitor) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) AnnotatedNode(org.codehaus.groovy.ast.AnnotatedNode) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) ModuleNode(org.codehaus.groovy.ast.ModuleNode) TypeReference.newTypeReference(org.objectweb.asm.TypeReference.newTypeReference) LASTORE(org.objectweb.asm.Opcodes.LASTORE) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) T_SHORT(org.objectweb.asm.Opcodes.T_SHORT) MethodCallerMultiAdapter(org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter) INVOKEVIRTUAL(org.objectweb.asm.Opcodes.INVOKEVIRTUAL) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) GETFIELD(org.objectweb.asm.Opcodes.GETFIELD) Objects(java.util.Objects) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) FieldExpression(org.codehaus.groovy.ast.expr.FieldExpression) T_LONG(org.objectweb.asm.Opcodes.T_LONG) ClassHelper.isPrimitiveByte(org.codehaus.groovy.ast.ClassHelper.isPrimitiveByte) ExpressionUtils(org.apache.groovy.ast.tools.ExpressionUtils) CASTORE(org.objectweb.asm.Opcodes.CASTORE) GOTO(org.objectweb.asm.Opcodes.GOTO) ARETURN(org.objectweb.asm.Opcodes.ARETURN) AnnotationNode(org.codehaus.groovy.ast.AnnotationNode) TypeReference(org.objectweb.asm.TypeReference) SealedASTTransformation.sealedNative(org.codehaus.groovy.transform.SealedASTTransformation.sealedNative) T_DOUBLE(org.objectweb.asm.Opcodes.T_DOUBLE) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) LinkedList(java.util.LinkedList) TypeReference.newExceptionReference(org.objectweb.asm.TypeReference.newExceptionReference) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) OperandStack(org.codehaus.groovy.classgen.asm.OperandStack) ClassHelper(org.codehaus.groovy.ast.ClassHelper) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) Consumer(java.util.function.Consumer) ASTNode(org.codehaus.groovy.ast.ASTNode) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) TypePath(org.objectweb.asm.TypePath) AASTORE(org.objectweb.asm.Opcodes.AASTORE) METHOD_TYPE_PARAMETER_BOUND(org.objectweb.asm.TypeReference.METHOD_TYPE_PARAMETER_BOUND) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) PUTSTATIC(org.objectweb.asm.Opcodes.PUTSTATIC) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) WriterControllerFactory(org.codehaus.groovy.classgen.asm.WriterControllerFactory) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) ClassHelper.isObjectType(org.codehaus.groovy.ast.ClassHelper.isObjectType) Arrays(java.util.Arrays) MethodCaller(org.codehaus.groovy.classgen.asm.MethodCaller) ACC_ENUM(org.objectweb.asm.Opcodes.ACC_ENUM) T_FLOAT(org.objectweb.asm.Opcodes.T_FLOAT) TypeReference.newSuperTypeReference(org.objectweb.asm.TypeReference.newSuperTypeReference) BASTORE(org.objectweb.asm.Opcodes.BASTORE) BytecodeVariable(org.codehaus.groovy.classgen.asm.BytecodeVariable) StringBuilderWriter(org.apache.groovy.io.StringBuilderWriter) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) PrintWriter(java.io.PrintWriter) GroovyRuntimeException(groovy.lang.GroovyRuntimeException) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) PackageNode(org.codehaus.groovy.ast.PackageNode) ExpressionUtils.isThisOrSuper(org.apache.groovy.ast.tools.ExpressionUtils.isThisOrSuper) GeneralUtils.callX(org.codehaus.groovy.ast.tools.GeneralUtils.callX) DUP(org.objectweb.asm.Opcodes.DUP) SASTORE(org.objectweb.asm.Opcodes.SASTORE) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) AnnotationVisitor(org.objectweb.asm.AnnotationVisitor) StaticMethodCallExpression(org.codehaus.groovy.ast.expr.StaticMethodCallExpression) TypeReference.newTypeParameterBoundReference(org.objectweb.asm.TypeReference.newTypeParameterBoundReference) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) GeneralUtils.thisPropX(org.codehaus.groovy.ast.tools.GeneralUtils.thisPropX) ACC_STATIC(org.objectweb.asm.Opcodes.ACC_STATIC) SWAP(org.objectweb.asm.Opcodes.SWAP) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) ArrayList(java.util.ArrayList) MethodNode(org.codehaus.groovy.ast.MethodNode) ClassHelper.isPrimitiveFloat(org.codehaus.groovy.ast.ClassHelper.isPrimitiveFloat) T_BOOLEAN(org.objectweb.asm.Opcodes.T_BOOLEAN) POP(org.objectweb.asm.Opcodes.POP) Parameter(org.codehaus.groovy.ast.Parameter) NEWARRAY(org.objectweb.asm.Opcodes.NEWARRAY) ClassHelper.isClassType(org.codehaus.groovy.ast.ClassHelper.isClassType) ClassHelper.isPrimitiveType(org.codehaus.groovy.ast.ClassHelper.isPrimitiveType) ClassHelper.isPrimitiveChar(org.codehaus.groovy.ast.ClassHelper.isPrimitiveChar) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) ALOAD(org.objectweb.asm.Opcodes.ALOAD) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) ACC_SUPER(org.objectweb.asm.Opcodes.ACC_SUPER) TypeReference.newFormalParameterReference(org.objectweb.asm.TypeReference.newFormalParameterReference) GETSTATIC(org.objectweb.asm.Opcodes.GETSTATIC) Type(org.objectweb.asm.Type) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) NEW(org.objectweb.asm.Opcodes.NEW) ScriptBytecodeAdapter(org.codehaus.groovy.runtime.ScriptBytecodeAdapter) ClassVisitor(org.objectweb.asm.ClassVisitor) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) IASTORE(org.objectweb.asm.Opcodes.IASTORE) METHOD_RETURN(org.objectweb.asm.TypeReference.METHOD_RETURN) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) FIELD(org.objectweb.asm.TypeReference.FIELD) GroovyBugError(org.codehaus.groovy.GroovyBugError) List(java.util.List) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) ACC_PUBLIC(org.objectweb.asm.Opcodes.ACC_PUBLIC) Modifier(java.lang.reflect.Modifier) FASTORE(org.objectweb.asm.Opcodes.FASTORE) IFNONNULL(org.objectweb.asm.Opcodes.IFNONNULL) Writer(java.io.Writer) Optional(java.util.Optional) CLASS_TYPE_PARAMETER_BOUND(org.objectweb.asm.TypeReference.CLASS_TYPE_PARAMETER_BOUND) Statement(org.codehaus.groovy.ast.stmt.Statement) GeneralUtils.fieldX(org.codehaus.groovy.ast.tools.GeneralUtils.fieldX) FieldVisitor(org.objectweb.asm.FieldVisitor) METHOD_TYPE_PARAMETER(org.objectweb.asm.TypeReference.METHOD_TYPE_PARAMETER) TypeReference.newTypeParameterReference(org.objectweb.asm.TypeReference.newTypeParameterReference) Label(org.objectweb.asm.Label) HashMap(java.util.HashMap) T_CHAR(org.objectweb.asm.Opcodes.T_CHAR) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) CHECKCAST(org.objectweb.asm.Opcodes.CHECKCAST) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) CLASS_TYPE_PARAMETER(org.objectweb.asm.TypeReference.CLASS_TYPE_PARAMETER) Iterator(java.util.Iterator) DUP2(org.objectweb.asm.Opcodes.DUP2) RecordComponentVisitor(org.objectweb.asm.RecordComponentVisitor) PROPERTY_OWNER(org.codehaus.groovy.transform.sc.StaticCompilationMetadataKeys.PROPERTY_OWNER) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) ANEWARRAY(org.objectweb.asm.Opcodes.ANEWARRAY) RETURN(org.objectweb.asm.Opcodes.RETURN) FieldNode(org.codehaus.groovy.ast.FieldNode) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) V_PREVIEW(org.objectweb.asm.Opcodes.V_PREVIEW) RuntimeParserException(org.codehaus.groovy.syntax.RuntimeParserException) WideningCategories(org.codehaus.groovy.ast.tools.WideningCategories) ILOAD(org.objectweb.asm.Opcodes.ILOAD) Collections(java.util.Collections) OperandStack(org.codehaus.groovy.classgen.asm.OperandStack) InterfaceHelperClassNode(org.codehaus.groovy.ast.InterfaceHelperClassNode) ClassNode(org.codehaus.groovy.ast.ClassNode) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) TraceMethodVisitor(org.objectweb.asm.util.TraceMethodVisitor) MethodVisitor(org.objectweb.asm.MethodVisitor)

Aggregations

List (java.util.List)3 Map (java.util.Map)3 GroovyBugError (org.codehaus.groovy.GroovyBugError)3 ClassNode (org.codehaus.groovy.ast.ClassNode)3 InnerClassNode (org.codehaus.groovy.ast.InnerClassNode)3 MethodNode (org.codehaus.groovy.ast.MethodNode)3 Parameter (org.codehaus.groovy.ast.Parameter)3 Expression (org.codehaus.groovy.ast.expr.Expression)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 LinkedList (java.util.LinkedList)2 Optional (java.util.Optional)2 ConstructorNode (org.codehaus.groovy.ast.ConstructorNode)2 ClosureExpression (org.codehaus.groovy.ast.expr.ClosureExpression)2 LambdaExpression (org.codehaus.groovy.ast.expr.LambdaExpression)2 VariableExpression (org.codehaus.groovy.ast.expr.VariableExpression)2 BlockStatement (org.codehaus.groovy.ast.stmt.BlockStatement)2 Statement (org.codehaus.groovy.ast.stmt.Statement)2 GeneralUtils.classX (org.codehaus.groovy.ast.tools.GeneralUtils.classX)2 BytecodeHelper (org.codehaus.groovy.classgen.asm.BytecodeHelper)2