Package org.objectweb.asm.commons

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


      // create an array of the method parm class[] arg
      staticAdapter.push(targetMethodParameters.length);
      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
        staticAdapter.push(t);
        staticAdapter.arrayStore(CLASS_TYPE);
        index++;
      }
View Full Code Here


        clazzInit.visitLdcInsn(selfType.getClassName());
        clazzInit.invokeStatic(JAVA_LANG_CLASS_TYPE, CLASS_FORNAME_METHOD);
        clazzInit
                .invokeStatic(PROXY_HELPER_TYPE, HELPER_GET_PROXY_CLASS_METHOD);
        clazzInit.dup();
        clazzInit.putStatic(selfType, PROXY_CLASS_FIELD_NAME, PROXY_CLASS_TYPE);
        return clazzInit;
    }

    private static void generateProxyMethod(Type selfType, Type superType,
View Full Code Here

        // if the method is extending something, then we have
        // to test if the handler is initialized...

        if (md.isImplemented()) {
            ga.dup();
            Label ok = ga.newLabel();
            ga.ifNonNull(ok);

            ga.loadThis();
            ga.loadArgs();
View Full Code Here

        Label handler = ga.mark();
        Type udt = Type.getType(UndeclaredThrowableException.class);
        int loc = ga.newLocal(thr);
        ga.storeLocal(loc, thr);
        ga.newInstance(udt);
        ga.dup();
        ga.loadLocal(loc, thr);
        ga.invokeConstructor(udt, org.objectweb.asm.commons.Method
                .getMethod("void <init>(java.lang.Throwable)"));
        ga.throwException();
View Full Code Here

        Label handler = ga.mark();
        Type udt = Type.getType(UndeclaredThrowableException.class);
        int loc = ga.newLocal(thr);
        ga.storeLocal(loc, thr);
        ga.newInstance(udt);
        ga.dup();
        ga.loadLocal(loc, thr);
        ga.invokeConstructor(udt, org.objectweb.asm.commons.Method
                .getMethod("void <init>(java.lang.Throwable)"));
        ga.throwException();
View Full Code Here

                null, EMPTY_TYPE_ARR, cw);

        clazzInit.visitLdcInsn(selfType.getClassName());
        clazzInit.invokeStatic(JAVA_LANG_CLASS_TYPE, CLASS_FORNAME_METHOD);
        clazzInit.invokeStatic(PROXY_HELPER_TYPE, HELPER_GET_PROXY_CLASS_METHOD);
        clazzInit.dup();
        clazzInit.putStatic(selfType, PROXY_CLASS_FIELD_NAME, PROXY_CLASS_TYPE);
       
        return clazzInit;
    }
View Full Code Here

        // if the method is extending something, then we have
        // to test if the handler is initialized...

        if (md.isImplemented()) {
            ga.dup();
            Label ok = ga.newLabel();
            ga.ifNonNull(ok);

            ga.loadThis();
            ga.loadArgs();
View Full Code Here

      mv.storeLocal( l_len );

      // List lst = new ArrayList( arr.length );
      final int l_lst = mv.newLocal( ARRAYLIST_CLASS );
      mv.newInstance( ARRAYLIST_CLASS );
      mv.dup();
      mv.loadLocal( l_len );
      mv.visitMethodInsn( Opcodes.INVOKESPECIAL, ARRAYLIST_CLASS.getInternalName(), "<init>", "(I)V" );
      mv.storeLocal( l_lst );

      // for (int i = 0; i < len; i++) {
View Full Code Here

        }

        if (RootSectionCompiler.this.computationTimeCompiled) {
          mv.loadThis();
          mv.newInstance( COMP_TIME_CLASS );
          mv.dup();
          mv.invokeConstructor( COMP_TIME_CLASS, EMPTY_CONSTRUCTOR_METHOD );
          mv.putField( section().classType(), COMP_TIME_MEMBER_NAME, COMP_TIME_CLASS );
        }

        if (RootSectionCompiler.this.computationModeCompiled) {
View Full Code Here

  private void buildComputationFactoryMethod()
  {
    final GeneratorAdapter mv = newMethod( "newComputation", "(Ljava/lang/Object;)"
        + ByteCodeEngineCompiler.COMPUTATION_INTF.getDescriptor() );
    mv.newInstance( ByteCodeEngineCompiler.GEN_ROOT_CLASS );
    mv.dup();
    mv.loadArg( 0 );
    compileClassRef( this.userInputClass, this.userInputType );
    mv.checkCast( this.userInputType );
    mv.loadThis();
    mv.getField( classType(), ByteCodeEngineCompiler.ENV_MEMBER_NAME, ByteCodeEngineCompiler.ENV_CLASS );
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.