Package org.objectweb.asm

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


  @Override
  public void pushInt(ComputeMethod method) {
    MethodVisitor mv = method.getVisitor();
    mv.visitVarInsn(ALOAD, ptrLocalIndex);
    mv.visitInsn(SWAP);
    mv.visitMethodInsn(INVOKEVIRTUAL, vectorClass, "getElementAsInt", "(I)I");
  }
}
View Full Code Here


  @Override
  public void pushDouble(ComputeMethod method) {
    operandAccessor.pushDouble(method);
    MethodVisitor mv = method.getVisitor();
    mv.visitMethodInsn(INVOKESTATIC,
            Type.getInternalName(applyMethod.getDeclaringClass()),
            applyMethod.getName(),
            Type.getMethodDescriptor(applyMethod));

}
View Full Code Here

    MethodVisitor mv = method.getVisitor();
    mv.visitVarInsn(ALOAD, method.getOperandsLocalIndex());
    pushOperandIndex(mv, operandIndex);
    mv.visitInsn(AALOAD);
    mv.visitTypeInsn(CHECKCAST, "org/renjin/sexp/DoubleArrayVector");
    mv.visitMethodInsn(INVOKEVIRTUAL, "org/renjin/sexp/DoubleArrayVector", "toDoubleArrayUnsafe", "()[D");
    mv.visitVarInsn(ASTORE, arrayLocalIndex);
  }

  @Override
  public void pushLength(ComputeMethod method) {
View Full Code Here

    MethodVisitor mv = method.getVisitor();
    mv.visitVarInsn(ALOAD, method.getOperandsLocalIndex());
    pushOperandIndex(mv, operandIndex);
    mv.visitInsn(AALOAD);
    mv.visitTypeInsn(CHECKCAST, "org/renjin/sexp/IntArrayVector");
    mv.visitMethodInsn(INVOKEVIRTUAL, "org/renjin/sexp/IntArrayVector", "toIntArrayUnsafe", "()[I");
    mv.visitVarInsn(ASTORE, arrayLocalIndex);
  }

  @Override
  public void pushLength(ComputeMethod method) {
View Full Code Here

    Label l0 = new Label();
    mv.visitLabel(l0);
    mv.visitLineNumber(8, l0);
    mv.visitVarInsn(ALOAD, 0);
    mv.visitInsn(DUP);
    mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
   
    // initialize sexp pool
 
    generationContext.getSexpPool().writeConstructorBody(mv);
   
View Full Code Here

    mv.visitCode();
    Label l0 = new Label();
    mv.visitLabel(l0);
    mv.visitLineNumber(10, l0);
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
    mv.visitInsn(RETURN);
    Label l1 = new Label();
    mv.visitLabel(l1);
    mv.visitLocalVariable("this", "Lr/benchmarks/MeanOnline;", null, l0, l1, 0);
    mv.visitMaxs(1, 1);
View Full Code Here

 

  private void writeMainMethod(ClassWriter cw) {
    MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
    mv.visitCode();
    mv.visitMethodInsn(INVOKESTATIC, "org/renjin/eval/Context", "newTopLevelContext", "()Lorg/renjin/Context;");
    mv.visitVarInsn(ASTORE, 1);

   
   
    mv.visitEnd();
View Full Code Here

  private static void writeInit(ClassWriter cw) {
    MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, THIS);
    mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
    mv.visitInsn(RETURN);
    mv.visitMaxs(1, 1);
    mv.visitEnd();   
  }
View Full Code Here

    MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "<init>", "(Lorg/renjin/sexp/Environment;)V", null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitVarInsn(ALOAD, 1);
    mv.visitMethodInsn(INVOKESTATIC, generationContext.getClassName(), "createFormals", "()Lorg/renjin/sexp/PairList;");
    mv.visitMethodInsn(INVOKESTATIC, generationContext.getClassName(), "createBody", "()Lorg/renjin/sexp/SEXP;");
    mv.visitMethodInsn(INVOKESPECIAL, "org/renjin/sexp/Closure", "<init>", "(Lorg/renjin/sexp/Environment;Lorg/renjin/sexp/PairList;Lorg/renjin/sexp/SEXP;)V");
     
    generationContext.getSexpPool().writeConstructorBody(mv);
   
View Full Code Here

    MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "<init>", "(Lorg/renjin/sexp/Environment;)V", null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitVarInsn(ALOAD, 1);
    mv.visitMethodInsn(INVOKESTATIC, generationContext.getClassName(), "createFormals", "()Lorg/renjin/sexp/PairList;");
    mv.visitMethodInsn(INVOKESTATIC, generationContext.getClassName(), "createBody", "()Lorg/renjin/sexp/SEXP;");
    mv.visitMethodInsn(INVOKESPECIAL, "org/renjin/sexp/Closure", "<init>", "(Lorg/renjin/sexp/Environment;Lorg/renjin/sexp/PairList;Lorg/renjin/sexp/SEXP;)V");
     
    generationContext.getSexpPool().writeConstructorBody(mv);
   
    mv.visitInsn(RETURN);
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.