Examples of invokeConstructor()


Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

        mgen.visitCode();
        final Label begin = mgen.mark();

        // invoke super constructor
        mgen.loadThis();
        mgen.invokeConstructor(Type.getType(Object.class), Method.getMethod("void <init> ()"));
        // assign remaining fields

        int arg = 0;
        for (final Field field : fields) {
            mgen.loadThis();
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

                            mgen.visitCode();
                            mgen.loadThis();
                            for (int i = 0; i < argumentTypes.length; i++) {
                                mgen.loadArg(i);
                            }
                            mgen.invokeConstructor(supertype, staticCtor);
                            mgen.returnValue();
                            mgen.endMethod();
                        }
                        /*
                         * now declare a dummy constructor that will match, and discard,
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

                            mgen.visitCode();
                            mgen.loadThis();
                            for (int i = 0; i < argumentTypes.length; i++) {
                                mgen.loadArg(i + 1);
                            }
                            mgen.invokeConstructor(supertype, staticCtor);
                            mgen.returnValue();
                            mgen.endMethod();
                        }
                        return null;
                    }
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

    GeneratorAdapter methodAdapter = new GeneratorAdapter(ACC_PUBLIC, m, null, null, cv);
    // loadthis
    methodAdapter.loadThis();
    // if we have java.* as a supertype call that zero args constructor
    if (superclassBinaryName.startsWith("java.") || superclassBinaryName.startsWith("javax.")) {
      methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>",
          Type.VOID_TYPE, NO_ARGS));
    }
    // otherwise invoke the java.lang.Object no args constructor
    else {
      methodAdapter.invokeConstructor(OBJECT_TYPE, new Method("<init>", Type.VOID_TYPE, NO_ARGS));
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

      methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>",
          Type.VOID_TYPE, NO_ARGS));
    }
    // otherwise invoke the java.lang.Object no args constructor
    else {
      methodAdapter.invokeConstructor(OBJECT_TYPE, new Method("<init>", Type.VOID_TYPE, NO_ARGS));
    }
    // call from the constructor to setInvocationHandler
    Method setter = new Method("setInvocationHandler", Type.VOID_TYPE, new Type[] { IH_TYPE });
    // load this
    methodAdapter.loadThis();
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

    GeneratorAdapter methodAdapter = new GeneratorAdapter(ACC_PUBLIC, m, null, null, cv);
    // loadthis
    methodAdapter.loadThis();
    // if we have java.* as a supertype call that zero args constructor
    if (superclassBinaryName.startsWith("java.") || superclassBinaryName.startsWith("javax.")) {
      methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>",
          Type.VOID_TYPE, NO_ARGS));
    }
    else {
         try {
            // if the superclass has a no-arg constructor that we can call,
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

            // newer JDK's, there is NOTHING we can do and the proxy will
            // fail.
            Constructor<?> cons = superclassClass.getDeclaredConstructor();
            if (!Modifier.isPrivate(cons.getModifiers())) {
               // This should work ...
               methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>", Type.VOID_TYPE, NO_ARGS));
            } else {
               // We have a private constructor, so this may work, but not on
               // recent HotSpot VMs
               LOGGER.debug(NLS.MESSAGES.getMessage("no.nonprivate.constructor", superclassClass.getName()));
               methodAdapter.invokeConstructor(OBJECT_TYPE, new Method("<init>", Type.VOID_TYPE, NO_ARGS));
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

               methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>", Type.VOID_TYPE, NO_ARGS));
            } else {
               // We have a private constructor, so this may work, but not on
               // recent HotSpot VMs
               LOGGER.debug(NLS.MESSAGES.getMessage("no.nonprivate.constructor", superclassClass.getName()));
               methodAdapter.invokeConstructor(OBJECT_TYPE, new Method("<init>", Type.VOID_TYPE, NO_ARGS));
            }

         } catch (NoSuchMethodException e) {
            // There's no no-args constructor, so may work, but not on recent
            // HotSpot VMs
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

         } catch (NoSuchMethodException e) {
            // There's no no-args constructor, so may work, but not on recent
            // HotSpot VMs
            LOGGER.debug(NLS.MESSAGES.getMessage("no.noargs.constructor", superclassClass.getName()));
            methodAdapter.invokeConstructor(OBJECT_TYPE, new Method("<init>", Type.VOID_TYPE, NO_ARGS));
         }
      
    }
    // call from the constructor to setInvocationHandler
    Method setter = new Method("setInvocationHandler", Type.VOID_TYPE, new Type[] { IH_TYPE });
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.invokeConstructor()

    GeneratorAdapter gen = new GeneratorAdapter(writer.visitMethod(
        Opcodes.ACC_PUBLIC, "<init>", "()V", null, new String[0]),
        Opcodes.ACC_PUBLIC, "<init>", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.invokeConstructor(Type.getType(Object.class), new Method("<init>",
        "()V"));
    gen.loadThis();
    final int size = runtime.generateDataAccessor(classid, className, 2,
        gen);
    gen.putField(classType, "data", GeneratorConstants.PROBEDATA_TYPE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.