Package org.objectweb.asm

Examples of org.objectweb.asm.MethodVisitor.visitMethodInsn()


        for (int t = 0; t < types.length; t++) {
            mv.visitVarInsn(types[t].getOpcode(ILOAD), i);
            i = i + types[t].getSize();
        }
        // Invocation
        mv.visitMethodInsn(INVOKEINTERFACE, itfName, methodName, desc);

        // Return the result
        Type returnType = Type.getReturnType(desc);
        if (returnType.getSort() != Type.VOID) {
            mv.visitInsn(returnType.getOpcode(IRETURN));
View Full Code Here


        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", '(' + DEPENDENCY_DESC + ")V", null, null);
        mv.visitCode();

        mv.visitVarInsn(ALOAD, 0); // Load this
        mv.visitInsn(DUP); // Dup
        mv.visitMethodInsn(INVOKESPECIAL, parent, "<init>", "()V"); // Call  super
        mv.visitVarInsn(ALOAD, 1); // Load the argument
        mv.visitFieldInsn(PUTFIELD, className, DEPENDENCY, DEPENDENCY_DESC); // Assign the dependency field
        mv.visitInsn(RETURN); // Return void

        mv.visitMaxs(0, 0);
View Full Code Here

      mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
      mv.visitCode();
      Label l0 = new Label();
      mv.visitLabel(l0);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
      mv.visitInsn(RETURN);
      Label l1 = new Label();
      mv.visitLabel(l1);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
View Full Code Here

      mv.visitIntInsn(NEWARRAY, T_DOUBLE);
      mv.visitInsn(DUP);
      mv.visitInsn(ICONST_0);
      mv.visitLdcInsn(new Double("42.0"));
      mv.visitInsn(DASTORE);
      mv.visitMethodInsn(INVOKESPECIAL, "org/renjin/eval/DoubleVector", "<init>", "([D)V");
      mv.visitTypeInsn(NEW, "org/renjin/eval/DoubleVector");
      mv.visitInsn(DUP);
      mv.visitInsn(ICONST_1);
      mv.visitIntInsn(NEWARRAY, T_DOUBLE);
      mv.visitInsn(DUP);
View Full Code Here

      mv.visitIntInsn(NEWARRAY, T_DOUBLE);
      mv.visitInsn(DUP);
      mv.visitInsn(ICONST_0);
      mv.visitInsn(DCONST_1);
      mv.visitInsn(DASTORE);
      mv.visitMethodInsn(INVOKESPECIAL, "org/renjin/eval/DoubleVector", "<init>", "([D)V");
      Label l2 = new Label();
      mv.visitLabel(l2);
      mv.visitMethodInsn(INVOKESTATIC, "r/base/primitives/R$primitive$_$43$_", "doApply", "(Lorg/renjin/eval/Context;Lorg/renjin/eval/Environment;Lorg/renjin/eval/SEXP;Lorg/renjin/eval/SEXP;)Lorg/renjin/eval/SEXP;");
      mv.visitInsn(ARETURN);
      Label l3 = new Label();
View Full Code Here

      mv.visitInsn(DCONST_1);
      mv.visitInsn(DASTORE);
      mv.visitMethodInsn(INVOKESPECIAL, "org/renjin/eval/DoubleVector", "<init>", "([D)V");
      Label l2 = new Label();
      mv.visitLabel(l2);
      mv.visitMethodInsn(INVOKESTATIC, "r/base/primitives/R$primitive$_$43$_", "doApply", "(Lorg/renjin/eval/Context;Lorg/renjin/eval/Environment;Lorg/renjin/eval/SEXP;Lorg/renjin/eval/SEXP;)Lorg/renjin/eval/SEXP;");
      mv.visitInsn(ARETURN);
      Label l3 = new Label();
      mv.visitLabel(l3);
      mv.visitMaxs(10, 3);
      mv.visitEnd();
View Full Code Here

    mv.visitVarInsn(ILOAD, colTempLocal);
    operandAccessor.pushDouble(method);

    // x[row] - x[col]
    mv.visitInsn(DSUB);
    mv.visitMethodInsn(INVOKESTATIC, "java/lang/Math", "abs", "(D)D");
  }
}
View Full Code Here

    mv.visitInsn(IREM);
    // stack => { value1, index2 }
    operandAccessor2.pushDouble(method);
    // stack => { value1, value2}

    mv.visitMethodInsn(INVOKESTATIC,
            Type.getInternalName(applyMethod.getDeclaringClass()),
            applyMethod.getName(),
            Type.getMethodDescriptor(applyMethod));

}
View Full Code Here

  @Override
  public void pushLength(ComputeMethod method) {
    MethodVisitor mv = method.getVisitor();
    mv.visitVarInsn(ALOAD, ptrLocalIndex);
    mv.visitMethodInsn(INVOKEVIRTUAL, vectorClass, "length", "()I");
  }

  @Override
  public void pushDouble(ComputeMethod method) {
    MethodVisitor mv = method.getVisitor();
View Full Code Here

  @Override
  public void pushDouble(ComputeMethod method) {
    MethodVisitor mv = method.getVisitor();
    mv.visitVarInsn(ALOAD, ptrLocalIndex);
    mv.visitInsn(SWAP);
    mv.visitMethodInsn(INVOKEVIRTUAL, vectorClass, "getElementAsDouble", "(I)D");
  }

  @Override
  public void pushInt(ComputeMethod method) {
    MethodVisitor mv = method.getVisitor();
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.