Package org.objectweb.asm

Examples of org.objectweb.asm.Handle


                                       Handle bsm, Object... bsmArgs) {
      for (int i = 0; i < bsmArgs.length; ++i) {
        if (!(bsmArgs[i] instanceof Handle)) {
          continue;
        }
        Handle h = (Handle)bsmArgs[i];
        if (!h.getName().startsWith("lambda$")) {
          continue;
        }
        String newName = JavaUtils.SYNTHETIC_MEMBER_PREFIX + h.getName();
        bsmArgs[i] = new Handle(h.getTag(), h.getOwner(),
                                newName, h.getDesc());
      }
      mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
View Full Code Here


        }

        @Override
        public final void end(final String element) {
            ArrayList<?> bsmArgs = (ArrayList<?>)pop();
            Handle bsm = (Handle)pop();
            String desc = (String)pop();
            String name = (String)pop();
            getCodeVisitor().visitInvokeDynamicInsn(name, desc, bsm, bsmArgs.toArray());
        }
View Full Code Here

                return newMethodType(t.getDescriptor());
            } else {
                throw new IllegalArgumentException("value " + cst);
            }
        } else if (cst instanceof Handle) {
            Handle h = (Handle) cst;
            return newHandle(h.getTag(), h.getOwner(), h.getName(), h.getDesc());
        } else {
            throw new IllegalArgumentException("value " + cst);
        }
    }
View Full Code Here

                    case 'y':
                        d = c1.strVal1.compareTo(c2.strVal1);
                        if (d == 0) {
                            d = c1.strVal2.compareTo(c2.strVal2);
                            if (d == 0) {
                                Handle bsm1 = (Handle)c1.objVal3;
                                Handle bsm2 = (Handle)c2.objVal3;
                                d = compareHandle(bsm1, bsm2);
                                if (d == 0) {
                                    d = compareObjects(c1.objVals, c2.objVals);
                                }
                            }
View Full Code Here

                int tag = Integer.parseInt(val.substring(tagIndex + 1, val.length() - 1));
                String owner = val.substring(0, dotIndex);
                String name = val.substring(dotIndex + 1, descIndex);
                String desc = val.substring(descIndex, tagIndex - 1);
                return new Handle(tag, owner, name, desc);

            } catch(RuntimeException e) {
                throw new SAXException("Malformed handle "+val, e);
            }
        }
View Full Code Here

            buf.append("Type.getType(\"");
            buf.append(((Type) cst).getDescriptor());
            buf.append("\")");
        } else if (cst instanceof Handle) {
            buf.append("new Handle(");
            Handle h = (Handle) cst;
            buf.append("Opcodes.").append(HANDLE_TAG[h.getTag()]).append(", \"");
            buf.append(h.getOwner()).append("\", \"");
            buf.append(h.getName()).append("\", \"");
            buf.append(h.getDesc()).append("\")");
        } else if (cst instanceof Byte) {
            buf.append("new Byte((byte)").append(cst).append(')');
        } else if (cst instanceof Boolean) {
            buf.append(((Boolean) cst).booleanValue() ? "Boolean.TRUE" : "Boolean.FALSE");
        } else if (cst instanceof Short) {
View Full Code Here

    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

    public final static String BOOTSTRAP_STRING_INT_SIG = sig(CallSite.class, Lookup.class, String.class, MethodType.class, String.class, int.class);
    public final static String BOOTSTRAP_STRING_LONG_SIG = sig(CallSite.class, Lookup.class, String.class, MethodType.class, String.class, long.class);
    public final static String BOOTSTRAP_STRING_DOUBLE_SIG = sig(CallSite.class, Lookup.class, String.class, MethodType.class, String.class, double.class);
   
    public static Handle getBootstrapHandle(String name, Class type, String sig) {
        return new Handle(Opcodes.H_INVOKESTATIC, p(type), name, sig);
    }
View Full Code Here

        return site;
    }

    public static Handle string() {
        return new Handle(Opcodes.H_INVOKESTATIC, p(Bootstrap.class), "string", sig(CallSite.class, Lookup.class, String.class, MethodType.class, String.class, int.class));
    }
View Full Code Here

    public static Handle string() {
        return new Handle(Opcodes.H_INVOKESTATIC, p(Bootstrap.class), "string", sig(CallSite.class, Lookup.class, String.class, MethodType.class, String.class, int.class));
    }

    public static Handle array() {
        return new Handle(Opcodes.H_INVOKESTATIC, p(Bootstrap.class), "array", sig(CallSite.class, Lookup.class, String.class, MethodType.class));
    }
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.