Java Code Examples for jdk.internal.org.objectweb.asm.Handle

The following examples show how to use jdk.internal.org.objectweb.asm.Handle. These examples are extracted from open source projects. 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 Project: nashorn   Source File: AdviceAdapter.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(
    String name,
    String desc,
    Handle bsm,
    Object... bsmArgs)
{
    mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    if (constructor) {
        Type[] types = Type.getArgumentTypes(desc);
        for (int i = 0; i < types.length; i++) {
            popValue();
            if (types[i].getSize() == 2) {
                popValue();
            }
        }

        Type returnType = Type.getReturnType(desc);
        if (returnType != Type.VOID_TYPE) {
            pushValue(OTHER);
            if (returnType.getSize() == 2) {
                pushValue(OTHER);
            }
        }
    }
}
 
Example 2
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    checkStartCode();
    checkEndCode();
    checkMethodIdentifier(version, name, "name");
    checkMethodDesc(desc);
    if (bsm.getTag() != Opcodes.H_INVOKESTATIC
            && bsm.getTag() != Opcodes.H_NEWINVOKESPECIAL) {
        throw new IllegalArgumentException("invalid handle tag "
                + bsm.getTag());
    }
    for (int i = 0; i < bsmArgs.length; i++) {
        checkLDCConstant(bsmArgs[i]);
    }
    super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    ++insnCount;
}
 
Example 3
Source Project: openjdk-jdk8u   Source File: ASMifier.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    buf.setLength(0);
    buf.append(this.name).append(".visitInvokeDynamicInsn(");
    appendConstant(name);
    buf.append(", ");
    appendConstant(desc);
    buf.append(", ");
    appendConstant(bsm);
    buf.append(", new Object[]{");
    for (int i = 0; i < bsmArgs.length; ++i) {
        appendConstant(bsmArgs[i]);
        if (i != bsmArgs.length - 1) {
            buf.append(", ");
        }
    }
    buf.append("});\n");
    text.add(buf.toString());
}
 
Example 4
void memberInfoArray(final String className, final List<MemberInfo> mis) {
    if (mis.isEmpty()) {
        pushNull();
        return;
    }

    int pos = 0;
    push(mis.size());
    newObjectArray(SPECIALIZATION_TYPE);
    for (final MemberInfo mi : mis) {
        dup();
        push(pos++);
        visitTypeInsn(NEW, SPECIALIZATION_TYPE);
        dup();
        visitLdcInsn(new Handle(H_INVOKESTATIC, className, mi.getJavaName(), mi.getJavaDesc()));
        final Type    linkLogicClass = mi.getLinkLogicClass();
        final boolean linkLogic      = !linkLogicIsEmpty(linkLogicClass);
        final String  ctor           = linkLogic ? SPECIALIZATION_INIT3 : SPECIALIZATION_INIT2;
        if (linkLogic) {
            visitLdcInsn(linkLogicClass);
        }
        visitInsn(mi.isOptimistic() ? ICONST_1 : ICONST_0);
        visitMethodInsn(INVOKESPECIAL, SPECIALIZATION_TYPE, INIT, ctor, false);
        arrayStore(TYPE_SPECIALIZATION);
    }
}
 
Example 5
Source Project: nashorn   Source File: ASMifier.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(
    String name,
    String desc,
    Handle bsm,
    Object... bsmArgs)
{
    buf.setLength(0);
    buf.append(this.name).append(".visitInvokeDynamicInsn(");
    appendConstant(name);
    buf.append(", ");
    appendConstant(desc);
    buf.append(", ");
    appendConstant(bsm);
    buf.append(", new Object[]{");
    for (int i = 0; i < bsmArgs.length; ++i) {
        appendConstant(bsmArgs[i]);
        if (i != bsmArgs.length - 1) {
            buf.append(", ");
        }
    }
    buf.append("});\n");
    text.add(buf.toString());
}
 
Example 6
Source Project: hottub   Source File: ASMifier.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    buf.setLength(0);
    buf.append(this.name).append(".visitInvokeDynamicInsn(");
    appendConstant(name);
    buf.append(", ");
    appendConstant(desc);
    buf.append(", ");
    appendConstant(bsm);
    buf.append(", new Object[]{");
    for (int i = 0; i < bsmArgs.length; ++i) {
        appendConstant(bsmArgs[i]);
        if (i != bsmArgs.length - 1) {
            buf.append(", ");
        }
    }
    buf.append("});\n");
    text.add(buf.toString());
}
 
Example 7
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    if (constructor) {
        Type[] types = Type.getArgumentTypes(desc);
        for (int i = 0; i < types.length; i++) {
            popValue();
            if (types[i].getSize() == 2) {
                popValue();
            }
        }

        Type returnType = Type.getReturnType(desc);
        if (returnType != Type.VOID_TYPE) {
            pushValue(OTHER);
            if (returnType.getSize() == 2) {
                pushValue(OTHER);
            }
        }
    }
}
 
Example 8
Source Project: openjdk-jdk9   Source File: Method.java    License: GNU General Public License v2.0 6 votes vote down vote up
private Handle generateBootstrapMethod(Handle h) {
    String bootstrapName = "bootstrapMethod";
    MethodType bootstrapType = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class);

    MethodVisitor bmv = cv.visitMethod(ACC_PUBLIC | ACC_STATIC, bootstrapName, bootstrapType.toMethodDescriptorString(), null, null);
    bmv.visitCode();

    String constCallSite = "java/lang/invoke/ConstantCallSite";
    bmv.visitTypeInsn(NEW, constCallSite);
    bmv.visitInsn(DUP);

    bmv.visitLdcInsn(h);

    bmv.visitMethodInsn(INVOKESPECIAL, constCallSite, "<init>", "(Ljava/lang/invoke/MethodHandle;)V", false);
    bmv.visitInsn(ARETURN);

    bmv.visitMaxs(0,0);
    bmv.visitEnd();

    return new Handle(H_INVOKESTATIC, ownerClassName, bootstrapName, bootstrapType.toMethodDescriptorString());
}
 
Example 9
Source Project: openjdk-8   Source File: MethodGenerator.java    License: GNU General Public License v2.0 6 votes vote down vote up
void memberInfoArray(final String className, final List<MemberInfo> mis) {
    if (mis.isEmpty()) {
        pushNull();
        return;
    }

    int pos = 0;
    push(mis.size());
    newObjectArray(METHODHANDLE_TYPE);
    for (final MemberInfo mi : mis) {
        dup();
        push(pos++);
        visitLdcInsn(new Handle(H_INVOKESTATIC, className, mi.getJavaName(), mi.getJavaDesc()));
        arrayStore(TYPE_METHODHANDLE);
    }
}
 
Example 10
Source Project: jdk8u-jdk   Source File: ASMifier.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    buf.setLength(0);
    buf.append(this.name).append(".visitInvokeDynamicInsn(");
    appendConstant(name);
    buf.append(", ");
    appendConstant(desc);
    buf.append(", ");
    appendConstant(bsm);
    buf.append(", new Object[]{");
    for (int i = 0; i < bsmArgs.length; ++i) {
        appendConstant(bsmArgs[i]);
        if (i != bsmArgs.length - 1) {
            buf.append(", ");
        }
    }
    buf.append("});\n");
    text.add(buf.toString());
}
 
Example 11
Source Project: dragonwell8_jdk   Source File: Remapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 12
Source Project: Bytecoder   Source File: AnalyzerAdapter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(
        final String name,
        final String descriptor,
        final Handle bootstrapMethodHandle,
        final Object... bootstrapMethodArguments) {
    super.visitInvokeDynamicInsn(name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments);
    if (this.locals == null) {
        labels = null;
        return;
    }
    pop(descriptor);
    pushDescriptor(descriptor);
    labels = null;
}
 
Example 13
private void generateFinalizerOverride(final String finalizerDelegateName) {
    final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_PUBLIC, "finalize",
            VOID_NOARG_METHOD_DESCRIPTOR, null, null));
    // Overridden finalizer will take a MethodHandle to the finalizer delegating method, ...
    mv.aconst(new Handle(Opcodes.H_INVOKESTATIC, generatedClassName, finalizerDelegateName,
            Type.getMethodDescriptor(Type.VOID_TYPE, OBJECT_TYPE)));
    mv.visitVarInsn(ALOAD, 0);
    // ...and invoke it through JavaAdapterServices.invokeNoPermissions
    mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "invokeNoPermissions",
            Type.getMethodDescriptor(METHOD_HANDLE_TYPE, OBJECT_TYPE), false);
    mv.visitInsn(RETURN);
    endMethod(mv);
}
 
Example 14
Source Project: hottub   Source File: CodeSizeEvaluator.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    minSize += 5;
    maxSize += 5;
    if (mv != null) {
        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
}
 
Example 15
Source Project: hottub   Source File: ClassGenerator.java    License: GNU General Public License v2.0 5 votes vote down vote up
static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo getter, final MemberInfo setter) {
    final String propertyName = getter.getName();
    // stack: Collection
    // dup of Collection instance
    mi.dup();

    // property = AccessorProperty.create(key, flags, getter, setter);
    mi.loadLiteral(propertyName);
    // setup flags
    mi.push(getter.getAttributes());
    // setup getter method handle
    mi.visitLdcInsn(new Handle(H_INVOKESTATIC, className,
            getter.getJavaName(), getter.getJavaDesc()));
    // setup setter method handle
    if (setter == null) {
        mi.pushNull();
    } else {
        mi.visitLdcInsn(new Handle(H_INVOKESTATIC, className,
                setter.getJavaName(), setter.getJavaDesc()));
    }
    mi.invokeStatic(ACCESSORPROPERTY_TYPE, ACCESSORPROPERTY_CREATE, ACCESSORPROPERTY_CREATE_DESC);
    // boolean Collection.add(property)
    mi.invokeInterface(COLLECTION_TYPE, COLLECTION_ADD, COLLECTION_ADD_DESC);
    // pop return value of Collection.add
    mi.pop();
    // stack: Collection
}
 
Example 16
Source Project: openjdk-jdk9   Source File: AnalyzerAdapter.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitLdcInsn(final Object cst) {
    if (mv != null) {
        mv.visitLdcInsn(cst);
    }
    if (this.locals == null) {
        labels = null;
        return;
    }
    if (cst instanceof Integer) {
        push(Opcodes.INTEGER);
    } else if (cst instanceof Long) {
        push(Opcodes.LONG);
        push(Opcodes.TOP);
    } else if (cst instanceof Float) {
        push(Opcodes.FLOAT);
    } else if (cst instanceof Double) {
        push(Opcodes.DOUBLE);
        push(Opcodes.TOP);
    } else if (cst instanceof String) {
        push("java/lang/String");
    } else if (cst instanceof Type) {
        int sort = ((Type) cst).getSort();
        if (sort == Type.OBJECT || sort == Type.ARRAY) {
            push("java/lang/Class");
        } else if (sort == Type.METHOD) {
            push("java/lang/invoke/MethodType");
        } else {
            throw new IllegalArgumentException();
        }
    } else if (cst instanceof Handle) {
        push("java/lang/invoke/MethodHandle");
    } else {
        throw new IllegalArgumentException();
    }
    labels = null;
}
 
Example 17
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    for (int i = 0; i < bsmArgs.length; i++) {
        bsmArgs[i] = remapper.mapValue(bsmArgs[i]);
    }
    super.visitInvokeDynamicInsn(
            remapper.mapInvokeDynamicMethodName(name, desc),
            remapper.mapMethodDesc(desc), (Handle) remapper.mapValue(bsm),
            bsmArgs);
}
 
Example 18
Source Project: openjdk-jdk9   Source File: ClassGenerator.java    License: GNU General Public License v2.0 5 votes vote down vote up
static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo getter, final MemberInfo setter) {
    final String propertyName = getter.getName();
    // stack: Collection
    // dup of Collection instance
    mi.dup();

    // Load property name, converting to Symbol if it begins with "@@"
    loadPropertyKey(mi, propertyName);
    // setup flags
    mi.push(getter.getAttributes());
    // setup getter method handle
    mi.visitLdcInsn(new Handle(H_INVOKESTATIC, className,
            getter.getJavaName(), getter.getJavaDesc(), false));
    // setup setter method handle
    if (setter == null) {
        mi.pushNull();
    } else {
        mi.visitLdcInsn(new Handle(H_INVOKESTATIC, className,
                setter.getJavaName(), setter.getJavaDesc(), false));
    }
    // property = AccessorProperty.create(key, flags, getter, setter);
    mi.invokeStatic(ACCESSORPROPERTY_TYPE, ACCESSORPROPERTY_CREATE, ACCESSORPROPERTY_CREATE_DESC);
    // boolean Collection.add(property)
    mi.invokeInterface(COLLECTION_TYPE, COLLECTION_ADD, COLLECTION_ADD_DESC);
    // pop return value of Collection.add
    mi.pop();
    // stack: Collection
}
 
Example 19
Source Project: openjdk-8   Source File: AnalyzerAdapter.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    if (mv != null) {
        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
    if (this.locals == null) {
        labels = null;
        return;
    }
    pop(desc);
    pushDesc(desc);
    labels = null;
}
 
Example 20
Source Project: jdk8u_jdk   Source File: AnalyzerAdapter.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitLdcInsn(final Object cst) {
    if (mv != null) {
        mv.visitLdcInsn(cst);
    }
    if (this.locals == null) {
        labels = null;
        return;
    }
    if (cst instanceof Integer) {
        push(Opcodes.INTEGER);
    } else if (cst instanceof Long) {
        push(Opcodes.LONG);
        push(Opcodes.TOP);
    } else if (cst instanceof Float) {
        push(Opcodes.FLOAT);
    } else if (cst instanceof Double) {
        push(Opcodes.DOUBLE);
        push(Opcodes.TOP);
    } else if (cst instanceof String) {
        push("java/lang/String");
    } else if (cst instanceof Type) {
        int sort = ((Type) cst).getSort();
        if (sort == Type.OBJECT || sort == Type.ARRAY) {
            push("java/lang/Class");
        } else if (sort == Type.METHOD) {
            push("java/lang/invoke/MethodType");
        } else {
            throw new IllegalArgumentException();
        }
    } else if (cst instanceof Handle) {
        push("java/lang/invoke/MethodHandle");
    } else {
        throw new IllegalArgumentException();
    }
    labels = null;
}
 
Example 21
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    minSize += 5;
    maxSize += 5;
    if (mv != null) {
        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
}
 
Example 22
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    if (mv != null) {
        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
    if (this.locals == null) {
        labels = null;
        return;
    }
    pop(desc);
    pushDesc(desc);
    labels = null;
}
 
Example 23
Source Project: jdk8u-jdk   Source File: AnalyzerAdapter.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    if (mv != null) {
        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
    if (this.locals == null) {
        labels = null;
        return;
    }
    pop(desc);
    pushDesc(desc);
    labels = null;
}
 
Example 24
Source Project: jdk8u-jdk   Source File: CheckMethodAdapter.java    License: 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 25
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 26
Source Project: openjdk-jdk9   Source File: AnalyzerAdapter.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
        Object... bsmArgs) {
    if (mv != null) {
        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    }
    if (this.locals == null) {
        labels = null;
        return;
    }
    pop(desc);
    pushDesc(desc);
    labels = null;
}
 
Example 27
Source Project: jdk8u-dev-jdk   Source File: Remapper.java    License: GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 28
static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo memInfo) {
    final String propertyName = memInfo.getName();
    // stack: Collection
    // dup of Collection instance
    mi.dup();

    // property = AccessorProperty.create(key, flags, getter, setter);
    mi.loadLiteral(propertyName);
    // setup flags
    mi.push(memInfo.getAttributes());
    // setup getter method handle
    String javaName = GETTER_PREFIX + memInfo.getJavaName();
    mi.visitLdcInsn(new Handle(H_INVOKEVIRTUAL, className, javaName, getterDesc(memInfo)));
    // setup setter method handle
    if (memInfo.isFinal()) {
        mi.pushNull();
    } else {
        javaName = SETTER_PREFIX + memInfo.getJavaName();
        mi.visitLdcInsn(new Handle(H_INVOKEVIRTUAL, className, javaName, setterDesc(memInfo)));
    }
    mi.invokeStatic(ACCESSORPROPERTY_TYPE, ACCESSORPROPERTY_CREATE, ACCESSORPROPERTY_CREATE_DESC);
    // boolean Collection.add(property)
    mi.invokeInterface(COLLECTION_TYPE, COLLECTION_ADD, COLLECTION_ADD_DESC);
    // pop return value of Collection.add
    mi.pop();
    // stack: Collection
}
 
Example 29
private void generateFinalizerOverride(final String finalizerDelegateName) {
    final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_PUBLIC, "finalize",
            VOID_NOARG_METHOD_DESCRIPTOR, null, null));
    // Overridden finalizer will take a MethodHandle to the finalizer delegating method, ...
    mv.aconst(new Handle(Opcodes.H_INVOKESTATIC, generatedClassName, finalizerDelegateName,
            Type.getMethodDescriptor(Type.VOID_TYPE, OBJECT_TYPE)));
    mv.visitVarInsn(ALOAD, 0);
    // ...and invoke it through JavaAdapterServices.invokeNoPermissions
    mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "invokeNoPermissions",
            Type.getMethodDescriptor(METHOD_HANDLE_TYPE, OBJECT_TYPE), false);
    mv.visitInsn(RETURN);
    endMethod(mv);
}
 
Example 30
private static void appendHandle(final StringBuilder sb, final Handle h) {
    switch (h.getTag()) {
    case Opcodes.H_GETFIELD:
        sb.append("getfield");
        break;
    case Opcodes.H_GETSTATIC:
        sb.append("getstatic");
        break;
    case Opcodes.H_PUTFIELD:
        sb.append("putfield");
        break;
    case Opcodes.H_PUTSTATIC:
        sb.append("putstatic");
        break;
    case Opcodes.H_INVOKEINTERFACE:
        sb.append("interface");
        break;
    case Opcodes.H_INVOKESPECIAL:
        sb.append("special");
        break;
    case Opcodes.H_INVOKESTATIC:
        sb.append("static");
        break;
    case Opcodes.H_INVOKEVIRTUAL:
        sb.append("virtual");
        break;
    case Opcodes.H_NEWINVOKESPECIAL:
        sb.append("new_special");
        break;
    default:
        assert false;
        break;
    }
    sb.append(" '");
    sb.append(h.getName());
    sb.append("'");
}