Package jdk.internal.org.objectweb.asm

Examples of jdk.internal.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


    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

                return newMethodType(t.getDescriptor());
            } else { // s == primitive type or array
                return newClass(t.getDescriptor());
            }
        } 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

                return newMethodType(t.getDescriptor());
            } else { // s == primitive type or array
                return newClass(t.getDescriptor());
            }
        } 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

            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");
View Full Code Here

    @Override
    public void visitInvokeDynamicInsn(String name, String description, Handle bsm, Object... bsmArgs) {
        // recode current instruction
        record(INVOKEDYNAMIC);

        Handle handle = (Handle) bsmArgs[1];
        Type functionalInterfaceType = (Type) bsmArgs[2];
        Type lambdaType = Type.getMethodType(handle.getDesc());
        Type callerType = Type.getMethodType(description);
        int parameterDiff = lambdaType.getArgumentTypes().length - functionalInterfaceType.getArgumentTypes().length;
        boolean useContext = callerType.getArgumentTypes().length - Math.max(parameterDiff, 0) == 1;

        // detect functional interface
        Class interfaceClass = convert(callerType.getReturnType());
        String interfaceClassName = Javascript.computeClass(interfaceClass);

        // detect lambda method
        Class lambdaClass = convert(handle.getOwner());
        String lambdaMethodName = '"' + Javascript.computeMethodName(lambdaClass, handle.getName(), handle.getDesc()) + '"';

        // build parameter from local environment
        StringJoiner parameters = new StringJoiner(",", "[", "]");

        for (int i = parameterDiff - 1; 0 <= i; i--) {
            parameters.add(current.remove(i).toString());
        }

        // detect context
        Object context = useContext ? current.remove(0) : "null";

        // decide lambda context
        Object holder = null;

        switch (handle.getTag()) {
        case H_INVOKESTATIC:
            holder = Javascript.computeClassName(lambdaClass);
            break;

        case H_INVOKESPECIAL:
View Full Code Here

TOP

Related Classes of jdk.internal.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.