Package org.objectweb.asm.commons

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


  protected final void compile_util_scaleDown( long _b ) throws CompilerException
  {
    final GeneratorAdapter mv = mv();
    final int loc = localsOffset();
    mv.push( _b );
    mv.visitInsn( Opcodes.LDIV );
  }

  protected final void compile_util_fromInt() throws CompilerException
  {
View Full Code Here


  protected final void compile_util_fromScaledLong( int _b ) throws CompilerException
  {
    final GeneratorAdapter mv = mv();
    final int loc = localsOffset();
    mv.push( _b );
    mv.visitMethodInsn( Opcodes.INVOKESTATIC, "org/formulacompiler/runtime/internal/RuntimeBigDecimal_v2", "fromScaledLong", "(JI)Ljava/math/BigDecimal;" );
    compileValueAdjustment();
  }

  protected final void compile_util_toScaledLong( int _b ) throws CompilerException
View Full Code Here

  protected final void compile_util_toScaledLong( int _b ) throws CompilerException
  {
    final GeneratorAdapter mv = mv();
    final int loc = localsOffset();
    mv.push( _b );
    mv.visitMethodInsn( Opcodes.INVOKESTATIC, "org/formulacompiler/runtime/internal/RuntimeBigDecimal_v2", "toScaledLong", "(Ljava/math/BigDecimal;I)J" );
  }

  private final void compile_op_MINUS() throws CompilerException
  {
View Full Code Here

  protected final void compile_util_round( int _b ) throws CompilerException
  {
    final GeneratorAdapter mv = mv();
    final int loc = localsOffset();
    mv.push( _b );
    mv.visitMethodInsn( Opcodes.INVOKESTATIC, "org/formulacompiler/runtime/internal/RuntimeBigDecimal_v2", "round", "(Ljava/math/BigDecimal;I)Ljava/math/BigDecimal;" );
    compileValueAdjustment();
  }

  protected final void compile_util_fromInt() throws CompilerException
View Full Code Here

    fv.visitEnd();

    final GeneratorAdapter mv = root.initializer();
    mv.visitTypeInsn( Opcodes.NEW, RUNTIME_CONTEXT_TYPE.getInternalName() );
    mv.visitInsn( Opcodes.DUP );
    mv.push( numericType().scale() );
    mv.visitMethodInsn( Opcodes.INVOKESPECIAL, RUNTIME_CONTEXT_TYPE.getInternalName(), "<init>", "(I)V" );
    mv.visitFieldInsn( Opcodes.PUTSTATIC, root.classInternalName(), RUNTIME_CONTEXT_NAME, RUNTIME_CONTEXT_DESCRIPTOR );
  }

View Full Code Here

        m = Method.getMethod("void main (String[])");
        mg = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC, m, null, null, cw);
        mg.getStatic(Type.getType(System.class),
                "out",
                Type.getType(PrintStream.class));
        mg.push("Hello world!");
        mg.invokeVirtual(Type.getType(PrintStream.class),
                Method.getMethod("void println (String)"));
        mg.returnValue();
        mg.endMethod();
View Full Code Here

                             Type.getDescriptor(FieldAccessor.class), null, null);
      // this.fieldAccessorName
      //  = accessorFactory.getFieldAccessor(TypeToken.of(Class.forName("className")), "fieldName");
      mg.loadThis();
      mg.loadArg(1);
      mg.push(entry.getKey().getRawType().getName());
      mg.invokeStatic(Type.getType(Class.class), getMethod(Class.class, "forName", String.class));
      mg.invokeStatic(Type.getType(TypeToken.class), getMethod(TypeToken.class, "of", Class.class));
      mg.push(entry.getValue());
      mg.invokeInterface(Type.getType(FieldAccessorFactory.class),
                         getMethod(FieldAccessor.class, "getFieldAccessor", TypeToken.class, String.class));
View Full Code Here

      mg.loadThis();
      mg.loadArg(1);
      mg.push(entry.getKey().getRawType().getName());
      mg.invokeStatic(Type.getType(Class.class), getMethod(Class.class, "forName", String.class));
      mg.invokeStatic(Type.getType(TypeToken.class), getMethod(TypeToken.class, "of", Class.class));
      mg.push(entry.getValue());
      mg.invokeInterface(Type.getType(FieldAccessorFactory.class),
                         getMethod(FieldAccessor.class, "getFieldAccessor", TypeToken.class, String.class));
      mg.putField(classType, fieldAccessorName, Type.getType(FieldAccessor.class));
    }
View Full Code Here

      compilePredefinedMathContext( mv, "UNLIMITED" );
    }
    else {
      mv.visitTypeInsn( Opcodes.NEW, RUNTIME_CONTEXT_TYPE.getInternalName() );
      mv.visitInsn( Opcodes.DUP );
      mv.push( mc.getPrecision() );
      final Type modeType = Type.getType( RoundingMode.class );
      mv.getStatic( modeType, mc.getRoundingMode().name(), modeType );
      mv.visitMethodInsn( Opcodes.INVOKESPECIAL, RUNTIME_CONTEXT_TYPE.getInternalName(), "<init>",
          "(ILjava/math/RoundingMode;)V" );
    }
View Full Code Here

      mv.visitMethodInsn( Opcodes.INVOKESPECIAL, ARRAYLIST_CLASS.getInternalName(), "<init>", "(I)V" );
      mv.storeLocal( l_lst );

      // for (int i = 0; i < len; i++) {
      final int l_i = mv.newLocal( Type.INT_TYPE );
      mv.push( 0 );
      mv.storeLocal( l_i );
      final Label test = mv.newLabel();
      mv.goTo( test );
      final Label again = mv.mark();
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.