Java Code Examples for jdk.internal.org.objectweb.asm.Opcodes#H_INVOKEINTERFACE

The following examples show how to use jdk.internal.org.objectweb.asm.Opcodes#H_INVOKEINTERFACE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CheckMethodAdapter.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException("ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException("ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException("ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag "
                    + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 2
Source File: CheckMethodAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 3
Source File: CheckMethodAdapter.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 4
Source File: CheckMethodAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 5
Source File: CheckMethodAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 6
Source File: CheckMethodAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 7
Source File: CheckMethodAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 8
Source File: CheckMethodAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 9
Source File: CheckMethodAdapter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 10
Source File: CheckMethodAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
void checkLDCConstant(final Object cst) {
    if (cst instanceof Type) {
        int s = ((Type) cst).getSort();
        if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException(
                    "ldc of a constant class requires at least version 1.5");
        }
        if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a method type requires at least version 1.7");
        }
    } else if (cst instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException(
                    "ldc of a handle requires at least version 1.7");
        }
        int tag = ((Handle) cst).getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
    } else {
        checkConstant(cst);
    }
}
 
Example 11
Source File: Textifier.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}
 
Example 12
Source File: Textifier.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}
 
Example 13
Source File: Textifier.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h a handle, non null.
 */
protected void appendHandle(final Handle h) {
    buf.append('\n').append(tab3);
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag)).append(" : ");
    switch (tag) {
        case Opcodes.H_GETFIELD:
            buf.append("GETFIELD");
            break;
        case Opcodes.H_GETSTATIC:
            buf.append("GETSTATIC");
            break;
        case Opcodes.H_PUTFIELD:
            buf.append("PUTFIELD");
            break;
        case Opcodes.H_PUTSTATIC:
            buf.append("PUTSTATIC");
            break;
        case Opcodes.H_INVOKEINTERFACE:
            buf.append("INVOKEINTERFACE");
            break;
        case Opcodes.H_INVOKESPECIAL:
            buf.append("INVOKESPECIAL");
            break;
        case Opcodes.H_INVOKESTATIC:
            buf.append("INVOKESTATIC");
            break;
        case Opcodes.H_INVOKEVIRTUAL:
            buf.append("INVOKEVIRTUAL");
            break;
        case Opcodes.H_NEWINVOKESPECIAL:
            buf.append("NEWINVOKESPECIAL");
            break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    buf.append('(');
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    buf.append(')').append('\n');
}
 
Example 14
Source File: CheckMethodAdapter.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
  * Checks that the given value is a valid operand for the LDC instruction.
  *
  * @param value the value to be checked.
  */
private void checkLdcConstant(final Object value) {
    if (value instanceof Type) {
        int sort = ((Type) value).getSort();
        if (sort != Type.OBJECT && sort != Type.ARRAY && sort != Type.METHOD) {
            throw new IllegalArgumentException("Illegal LDC constant value");
        }
        if (sort != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
            throw new IllegalArgumentException("ldc of a constant class requires at least version 1.5");
        }
        if (sort == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException("ldc of a method type requires at least version 1.7");
        }
    } else if (value instanceof Handle) {
        if ((version & 0xFFFF) < Opcodes.V1_7) {
            throw new IllegalArgumentException("ldc of a Handle requires at least version 1.7");
        }
        Handle handle = (Handle) value;
        int tag = handle.getTag();
        if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
            throw new IllegalArgumentException("invalid handle tag " + tag);
        }
        checkInternalName(this.version, handle.getOwner(), "handle owner");
        if (tag <= Opcodes.H_PUTSTATIC) {
            checkDescriptor(this.version, handle.getDesc(), false);
        } else {
            checkMethodDescriptor(this.version, handle.getDesc());
        }
        String handleName = handle.getName();
        if (!("<init>".equals(handleName) && tag == Opcodes.H_NEWINVOKESPECIAL)) {
            checkMethodIdentifier(this.version, handleName, "handle name");
        }
    } else if (value instanceof ConstantDynamic) {
        if ((version & 0xFFFF) < Opcodes.V11) {
            throw new IllegalArgumentException("ldc of a ConstantDynamic requires at least version 11");
        }
        ConstantDynamic constantDynamic = (ConstantDynamic) value;
        checkMethodIdentifier(this.version, constantDynamic.getName(), "constant dynamic name");
        checkDescriptor(this.version, constantDynamic.getDescriptor(), false);
        checkLdcConstant(constantDynamic.getBootstrapMethod());
        int bootstrapMethodArgumentCount = constantDynamic.getBootstrapMethodArgumentCount();
        for (int i = 0; i < bootstrapMethodArgumentCount; ++i) {
            checkLdcConstant(constantDynamic.getBootstrapMethodArgument(i));
        }
    } else {
        checkConstant(value);
    }
}
 
Example 15
Source File: Textifier.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}
 
Example 16
Source File: Textifier.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}
 
Example 17
Source File: Textifier.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}
 
Example 18
Source File: Textifier.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}
 
Example 19
Source File: Textifier.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    buf.append('\n').append(tab3);
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    buf.append('(');
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    buf.append(')').append('\n');
}
 
Example 20
Source File: Textifier.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Appends the information about the given handle to {@link #buf buf}.
 *
 * @param h
 *            a handle, non null.
 */
protected void appendHandle(final Handle h) {
    int tag = h.getTag();
    buf.append("// handle kind 0x").append(Integer.toHexString(tag))
            .append(" : ");
    boolean isMethodHandle = false;
    switch (tag) {
    case Opcodes.H_GETFIELD:
        buf.append("GETFIELD");
        break;
    case Opcodes.H_GETSTATIC:
        buf.append("GETSTATIC");
        break;
    case Opcodes.H_PUTFIELD:
        buf.append("PUTFIELD");
        break;
    case Opcodes.H_PUTSTATIC:
        buf.append("PUTSTATIC");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        buf.append("INVOKEINTERFACE");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESPECIAL:
        buf.append("INVOKESPECIAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKESTATIC:
        buf.append("INVOKESTATIC");
        isMethodHandle = true;
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        buf.append("INVOKEVIRTUAL");
        isMethodHandle = true;
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        buf.append("NEWINVOKESPECIAL");
        isMethodHandle = true;
        break;
    }
    buf.append('\n');
    buf.append(tab3);
    appendDescriptor(INTERNAL_NAME, h.getOwner());
    buf.append('.');
    buf.append(h.getName());
    if(!isMethodHandle){
        buf.append('(');
    }
    appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
    if(!isMethodHandle){
        buf.append(')');
    }
}