Package org.objectweb.asm

Examples of org.objectweb.asm.Handle


    public Object mapValue(Object value) {
        if (value instanceof Type) {
            return mapType((Type) value);
        }
        if (value instanceof Handle) {
            Handle h = (Handle) value;
            return new Handle(h.getTag(), mapType(h.getOwner()), mapMethodName(
                    h.getOwner(), h.getName(), h.getDesc()),
                    mapMethodDesc(h.getDesc()));
        }
        return value;
    }
View Full Code Here


        }

        @Override
        public void accept(MethodVisitor visitor)
        {
            Handle bootstrapMethodHandle = new Handle(Opcodes.H_INVOKESTATIC,
                    type(bootstrapMethod.getDeclaringClass()).getClassName(),
                    bootstrapMethod.getName(),
                    methodDescription(
                            bootstrapMethod.getReturnType(),
                            bootstrapMethod.getParameterTypes()));
View Full Code Here

        }

        @Override
        public void accept(MethodVisitor visitor)
        {
            Handle bootstrapMethodHandle = new Handle(Opcodes.H_INVOKESTATIC,
                    type(bootstrapMethod.getDeclaringClass()).getClassName(),
                    bootstrapMethod.getName(),
                    methodDescription(
                            bootstrapMethod.getReturnType(),
                            bootstrapMethod.getParameterTypes()));
View Full Code Here

      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

        final String codeName   = "code_arg_" + currentMessageIndex + "_" + argIndex;
        final String handleName = "handle_arg_" + currentMessageIndex + "_" + argIndex;
        final String methodName = "argument_" + currentMessageIndex + "_" + argIndex;
        ArgumentEntry ae = new ArgumentEntry(codeName, handleName, methodName, argument, keyword);
        mhsAndAsts.add(new Handle(H_INVOKESTATIC,  className, methodName, sig(SephObject.class, LexicalScope.class, SThread.class, LexicalScope.class, boolean.class, boolean.class)));
        mhsAndAsts.add(new Handle(H_GETSTATIC,     className, codeName, c(SephObject.class)));

        arguments.add(ae);
        currentArguments.add(ae);

        cw.visitField(ACC_PRIVATE + ACC_STATIC, codeName,   c(SephObject.class), null, null);
View Full Code Here

   

    private void activationForMethod() {
        MethodAdapter ma = new MethodAdapter(cw.visitMethod(ACC_PUBLIC, "activationFor", sig(MethodHandle.class, int.class, boolean.class), null, null));

        Handle specific = new Handle(H_INVOKEVIRTUAL,  className, encode(abstractionName), sig(SephObject.class, argumentClassesFor(argNames.size(), false)));
        Handle generic = new Handle(H_INVOKEVIRTUAL,  className, encode(abstractionName), sig(SephObject.class, argumentClassesFor(-1, false)));

        ma.loadThis();
        ma.loadLocalInt(1);
        ma.loadLocalInt(2);
        ma.dynamicCall("seph:activationFor:" + encode(abstractionName) + ":" + argNames.size() + ":false", sig(MethodHandle.class, Object.class, int.class, boolean.class), BOOTSTRAP_METHOD, specific, generic);
View Full Code Here

      case INVOKESPECIAL:
      case INVOKEINTERFACE:
        return new MethodInsnNode(opcode, args[1], args[2], args[3], tobool(args[4]));
      case INVOKEDYNAMIC:
        if (args.length < 7) {
          return new InvokeDynamicInsnNode(args[1], args[2], new Handle(toint(args[3]), args[4],
              args[5], args[6]));
        }// else {
         //
         // for (int i = 7; i < args.length; i++) {
         //
View Full Code Here

TOP

Related Classes of org.objectweb.asm.Handle

Copyright © 2018 www.massapicom. 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.