Examples of visitInvokeDynamicInsn()


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

      int argIndex = 1;
      for (int i = 0; i < parameterTypes.length; i++) {
        argIndex = loadArgument(methodVisitor, parameterTypes[i], argIndex);
        indyTypes[i + 1] = Type.getType(parameterTypes[i]);
      }
      methodVisitor.visitInvokeDynamicInsn(method.getName(), Type.getMethodDescriptor(Type.getReturnType(method), indyTypes), ADAPTER_HANDLE);
      makeReturn(methodVisitor, method.getReturnType());
      methodVisitor.visitMaxs(0, 0);
      methodVisitor.visitEnd();
    }
  }
View Full Code Here

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

      mv.visitVarInsn(parameterType.getOpcode(ILOAD), slot);
      slot += parameterType.getSize();
    }

    // 1st 2 args are name and descriptor of this indy callsite
    mv.visitInvokeDynamicInsn(nameOfIndyCallsite, descriptor,
        new Handle(H_INVOKESTATIC, bsmClass.getName().replace('.', '/'),
            bsmName, bsmType.toMethodDescriptorString()), bsmArgs);

    Type returnType = Type.getReturnType(descriptor);
    mv.visitInsn(returnType.getOpcode(IRETURN));
View Full Code Here

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

    for(Type parameterType: Type.getArgumentTypes(descriptor)) {
      mv.visitVarInsn(parameterType.getOpcode(ILOAD), slot);
      slot += parameterType.getSize();
    }

    mv.visitInvokeDynamicInsn(name, descriptor,
        new org.objectweb.asm.MethodHandle(MH_INVOKESTATIC,
            bsmClass.getName().replace('.', '/'),
            bsmName,
            bsmType.toMethodDescriptorString()),
            bsmArgs);
View Full Code Here

Examples of org.ow2.asm.MethodVisitor.visitInvokeDynamicInsn()

        mv.visitCode();
        Handle h = new Handle(H_INVOKESTATIC,
                "C",
                "bsm",
                "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/CallSite;");
        mv.visitInvokeDynamicInsn("bar", "()V", h, Type.getType("()V"), h);
        mv.visitInsn(RETURN);
        mv.visitEnd();

        cw.visitEnd();
        return cw.toByteArray();
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.