Examples of invokeConstructor()


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

      methodAdapter.putField(typeBeingWoven, LISTENER_FIELD, LISTENER_TYPE);
    } else {
      //We just invoke the super with args
      methodAdapter.loadThis();
      methodAdapter.loadArgs();
      methodAdapter.invokeConstructor(superType, ARGS_CONSTRUCTOR);
    }
   
    //Throw an NPE if the dispatcher is null, return otherwise
    methodAdapter.loadArg(0);
    Label returnValue = methodAdapter.newLabel();
View Full Code Here

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

    Label returnValue = methodAdapter.newLabel();
    methodAdapter.ifNonNull(returnValue);
    methodAdapter.newInstance(NPE_TYPE);
    methodAdapter.dup();
    methodAdapter.push("The dispatcher must never be null!");
    methodAdapter.invokeConstructor(NPE_TYPE, NPE_CONSTRUCTOR);
    methodAdapter.throwException();
   
    methodAdapter.mark(returnValue);
    methodAdapter.returnValue();
    methodAdapter.endMethod();
View Full Code Here

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

        org.objectweb.asm.commons.Method constructor = org.objectweb.asm.commons.Method.getMethod(
                "void <init> (com.github.mustachejava.reflect.ReflectionWrapper)");
        GeneratorAdapter ga = new GeneratorAdapter(ACC_PUBLIC, constructor, null, null, cw);
        ga.loadThis();
        ga.loadArg(0);
        ga.invokeConstructor(Type.getType(IndyWrapper.class), constructor);
        ga.returnValue();
        ga.endMethod();
      }
      {
        GeneratorAdapter ga = new GeneratorAdapter(ACC_PUBLIC,
View Full Code Here

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

    final Label LABEL_LOOP_CMP = new Label();
    final Label LABEL_LOOP_START = new Label();
   
    mg.newInstance(Type.getType(Exception.class));
    mg.dup();
    mg.invokeConstructor(Type.getType(Exception.class),
        Method.getMethod("void <init> ()"));
    mg.invokeVirtual(Type.getType(Exception.class),
        Method.getMethod("StackTraceElement[] getStackTrace ()"));
    mg.storeLocal(1,Type.getType(StackTraceElement[].class));
View Full Code Here

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

//    mg.getStatic(Type.getType(System.class), "out", Type.getType(java.io.PrintStream.class));
//    mg.push("2");
//    mg.invokeVirtual(Type.getType(java.io.PrintStream.class), Method.getMethod("void println (String)"));
//    //XXX: DEBUG
    mg.loadThis();
    mg.invokeConstructor(Type.getType("Lorg/eclipse/swt/widgets/Control;"),
        Method.getMethod("org.eclipse.swt.graphics.Color getForeground ()"));
    mg.returnValue();
   
    mg.mark(LABEL_SKIP_CALL_TO_SUPER);
    mg.iinc(2, 1);
View Full Code Here

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

      // constructor.
      Method constructor = Method.getMethod(constructors[0].toGenericString());
     
      Type[] argTypes = constructor.getArgumentTypes();
      if (argTypes.length == 0) {
        methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>", Type.VOID_TYPE, NO_ARGS));
      } else {
        for (Type type : argTypes) {
          switch (type.getSort())
          {
            case Type.ARRAY:
View Full Code Here

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

    // Create and instantiate a new instance, then return it
    methodAdapter.newInstance(typeBeingWoven);
    methodAdapter.dup();
    methodAdapter.loadArgs();
    methodAdapter.invokeConstructor(typeBeingWoven, new Method("<init>",
        Type.VOID_TYPE, DISPATCHER_LISTENER_METHOD_ARGS));
    methodAdapter.returnValue();
    methodAdapter.endMethod();
    //////////////////////////////////////////////////////////
View Full Code Here

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

   
    if(implementWovenProxy) {
      methodAdapter.loadThis();

      if (superHasNoArgsConstructor)
        methodAdapter.invokeConstructor(superType, NO_ARGS_CONSTRUCTOR);
      else {
        if(hasNoArgsConstructor)
          methodAdapter.invokeConstructor(typeBeingWoven, NO_ARGS_CONSTRUCTOR);
        else
          throw new RuntimeException(new UnableToProxyException(typeBeingWoven.getClassName(),
View Full Code Here

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

      if (superHasNoArgsConstructor)
        methodAdapter.invokeConstructor(superType, NO_ARGS_CONSTRUCTOR);
      else {
        if(hasNoArgsConstructor)
          methodAdapter.invokeConstructor(typeBeingWoven, NO_ARGS_CONSTRUCTOR);
        else
          throw new RuntimeException(new UnableToProxyException(typeBeingWoven.getClassName(),
              NLS.MESSAGES.getMessage("type.lacking.no.arg.constructor", typeBeingWoven.getClassName(), superType.getClassName())));
      }
      methodAdapter.loadThis();
View Full Code Here

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

              methodAdapter.visitInsn(Opcodes.ACONST_NULL);
              break;
          }
        }
       
        methodAdapter.invokeConstructor(Type.getType(superclassClass), new Method("<init>", Type.VOID_TYPE, argTypes));
      }
    }
    methodAdapter.returnValue();
    methodAdapter.endMethod();
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.