jdk.internal.org.objectweb.asm.Type Java Examples

The following examples show how to use jdk.internal.org.objectweb.asm.Type. 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: InstructionAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitTypeInsn(final int opcode, final String type) {
    Type t = Type.getObjectType(type);
    switch (opcode) {
    case Opcodes.NEW:
        anew(t);
        break;
    case Opcodes.ANEWARRAY:
        newarray(t);
        break;
    case Opcodes.CHECKCAST:
        checkcast(t);
        break;
    case Opcodes.INSTANCEOF:
        instanceOf(t);
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
Example #2
Source File: GeneratorAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates the instructions to box the top stack value. This value is
 * replaced by its boxed equivalent on top of the stack.
 *
 * @param type
 *            the type of the top stack value.
 */
public void box(final Type type) {
    if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
        return;
    }
    if (type == Type.VOID_TYPE) {
        push((String) null);
    } else {
        Type boxed = getBoxedType(type);
        newInstance(boxed);
        if (type.getSize() == 2) {
            // Pp -> Ppo -> oPpo -> ooPpo -> ooPp -> o
            dupX2();
            dupX2();
            pop();
        } else {
            // p -> po -> opo -> oop -> o
            dupX1();
            swap();
        }
        invokeConstructor(boxed, new Method("<init>", Type.VOID_TYPE,
                new Type[] { type }));
    }
}
 
Example #3
Source File: AdviceAdapter.java    From jdk8u-jdk with 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 #4
Source File: Remapper.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public String mapMethodDesc(String desc) {
    if ("()V".equals(desc)) {
        return desc;
    }

    Type[] args = Type.getArgumentTypes(desc);
    StringBuilder sb = new StringBuilder("(");
    for (int i = 0; i < args.length; i++) {
        sb.append(mapDesc(args[i].getDescriptor()));
    }
    Type returnType = Type.getReturnType(desc);
    if (returnType == Type.VOID_TYPE) {
        sb.append(")V");
        return sb.toString();
    }
    sb.append(')').append(mapDesc(returnType.getDescriptor()));
    return sb.toString();
}
 
Example #5
Source File: CheckAnnotationAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visit(final String name, final Object value) {
    checkEnd();
    checkName(name);
    if (!(value instanceof Byte || value instanceof Boolean
            || value instanceof Character || value instanceof Short
            || value instanceof Integer || value instanceof Long
            || value instanceof Float || value instanceof Double
            || value instanceof String || value instanceof Type
            || value instanceof byte[] || value instanceof boolean[]
            || value instanceof char[] || value instanceof short[]
            || value instanceof int[] || value instanceof long[]
            || value instanceof float[] || value instanceof double[])) {
        throw new IllegalArgumentException("Invalid annotation value");
    }
    if (value instanceof Type) {
        int sort = ((Type) value).getSort();
        if (sort == Type.METHOD) {
            throw new IllegalArgumentException("Invalid annotation value");
        }
    }
    if (av != null) {
        av.visit(name, value);
    }
}
 
Example #6
Source File: AdviceAdapter.java    From openjdk-jdk8u with 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 #7
Source File: AdviceAdapter.java    From jdk8u60 with 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 #8
Source File: GeneratorAdapter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates the instructions to box the top stack value. This value is
 * replaced by its boxed equivalent on top of the stack.
 *
 * @param type
 *            the type of the top stack value.
 */
public void box(final Type type) {
    if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
        return;
    }
    if (type == Type.VOID_TYPE) {
        push((String) null);
    } else {
        Type boxed = getBoxedType(type);
        newInstance(boxed);
        if (type.getSize() == 2) {
            // Pp -> Ppo -> oPpo -> ooPpo -> ooPp -> o
            dupX2();
            dupX2();
            pop();
        } else {
            // p -> po -> opo -> oop -> o
            dupX1();
            swap();
        }
        invokeConstructor(boxed, new Method("<init>", Type.VOID_TYPE,
                new Type[] { type }));
    }
}
 
Example #9
Source File: GeneratorAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instructions to box the top stack value using Java 5's
 * valueOf() method. This value is replaced by its boxed equivalent on top
 * of the stack.
 *
 * @param type
 *            the type of the top stack value.
 */
public void valueOf(final Type type) {
    if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
        return;
    }
    if (type == Type.VOID_TYPE) {
        push((String) null);
    } else {
        Type boxed = getBoxedType(type);
        invokeStatic(boxed, new Method("valueOf", boxed,
                new Type[] { type }));
    }
}
 
Example #10
Source File: JavaAdapterBytecodeGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a list of class objects, return an array with their binary names. Used to generate the array of interface
 * names to implement.
 * @param classes the classes
 * @return an array of names
 */
private static String[] getInternalTypeNames(final List<Class<?>> classes) {
    final int interfaceCount = classes.size();
    final String[] interfaceNames = new String[interfaceCount];
    for(int i = 0; i < interfaceCount; ++i) {
        interfaceNames[i] = Type.getInternalName(classes.get(i));
    }
    return interfaceNames;
}
 
Example #11
Source File: GeneratorAdapter.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instructions to load the given method arguments on the
 * stack.
 *
 * @param arg the index of the first method argument to be loaded.
 * @param count the number of method arguments to be loaded.
 */
public void loadArgs(final int arg, final int count) {
    int index = getArgIndex(arg);
    for (int i = 0; i < count; ++i) {
        Type t = argumentTypes[arg + i];
        loadInsn(t, index);
        index += t.getSize();
    }
}
 
Example #12
Source File: BasicInterpreter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BasicValue newValue(final Type type) {
    if (type == null) {
        return BasicValue.UNINITIALIZED_VALUE;
    }
    switch (type.getSort()) {
    case Type.VOID:
        return null;
    case Type.BOOLEAN:
    case Type.CHAR:
    case Type.BYTE:
    case Type.SHORT:
    case Type.INT:
        return BasicValue.INT_VALUE;
    case Type.FLOAT:
        return BasicValue.FLOAT_VALUE;
    case Type.LONG:
        return BasicValue.LONG_VALUE;
    case Type.DOUBLE:
        return BasicValue.DOUBLE_VALUE;
    case Type.ARRAY:
    case Type.OBJECT:
        return BasicValue.REFERENCE_VALUE;
    default:
        throw new Error("Internal error");
    }
}
 
Example #13
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 #14
Source File: SimpleVerifier.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
protected boolean isAssignableFrom(final Type t, final Type u) {
    if (t.equals(u)) {
        return true;
    }
    if (currentClass != null && t.equals(currentClass)) {
        if (getSuperClass(u) == null) {
            return false;
        } else {
            if (isInterface) {
                return u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY;
            }
            return isAssignableFrom(t, getSuperClass(u));
        }
    }
    if (currentClass != null && u.equals(currentClass)) {
        if (isAssignableFrom(t, currentSuperClass)) {
            return true;
        }
        if (currentClassInterfaces != null) {
            for (int i = 0; i < currentClassInterfaces.size(); ++i) {
                Type v = currentClassInterfaces.get(i);
                if (isAssignableFrom(t, v)) {
                    return true;
                }
            }
        }
        return false;
    }
    Class<?> tc = getClass(t);
    if (tc.isInterface()) {
        tc = Object.class;
    }
    return tc.isAssignableFrom(getClass(u));
}
 
Example #15
Source File: LocalVariablesSorter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
        TypePath typePath, Label[] start, Label[] end, int[] index,
        String desc, boolean visible) {
    Type t = Type.getType(desc);
    int[] newIndex = new int[index.length];
    for (int i = 0; i < newIndex.length; ++i) {
        newIndex[i] = remap(index[i], t);
    }
    return mv.visitLocalVariableAnnotation(typeRef, typePath, start, end,
            newIndex, desc, visible);
}
 
Example #16
Source File: CheckMethodAdapter.java    From hottub 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 #17
Source File: Textifier.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(
    String name,
    String desc,
    Handle bsm,
    Object... bsmArgs)
{
    buf.setLength(0);
    buf.append(tab2).append("INVOKEDYNAMIC").append(' ');
    buf.append(name);
    appendDescriptor(METHOD_DESCRIPTOR, desc);
    buf.append(" [");
    appendHandle(bsm);
    buf.append(tab3).append("// arguments:");
    if(bsmArgs.length == 0) {
        buf.append(" none");
    } else {
        buf.append('\n').append(tab3);
        for(int i = 0; i < bsmArgs.length; i++) {
            Object cst = bsmArgs[i];
            if (cst instanceof String) {
                Printer.appendString(buf, (String) cst);
            } else if (cst instanceof Type) {
                buf.append(((Type) cst).getDescriptor()).append(".class");
            } else if (cst instanceof Handle) {
                appendHandle((Handle) cst);
            } else {
                buf.append(cst);
            }
            buf.append(", ");
        }
        buf.setLength(buf.length() - 2);
    }
    buf.append('\n');
    buf.append(tab2).append("]\n");
    text.add(buf.toString());
}
 
Example #18
Source File: AnalyzerAdapter.java    From openjdk-jdk8u-backup with 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 #19
Source File: Remapper.java    From hottub with 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 #20
Source File: ClassGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("fallthrough")
private static Type memInfoType(final MemberInfo memInfo) {
    switch (memInfo.getJavaDesc().charAt(0)) {
        case 'I': return Type.INT_TYPE;
        case 'J': return Type.LONG_TYPE;
        case 'D': return Type.DOUBLE_TYPE;
        default:  assert false : memInfo.getJavaDesc();
        case 'L': return TYPE_OBJECT;
    }
}
 
Example #21
Source File: LocalVariablesSorter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new local variable of the given type.
 *
 * @param type
 *            the type of the local variable to be created.
 * @return the identifier of the newly created local variable.
 */
public int newLocal(final Type type) {
    Object t;
    switch (type.getSort()) {
    case Type.BOOLEAN:
    case Type.CHAR:
    case Type.BYTE:
    case Type.SHORT:
    case Type.INT:
        t = Opcodes.INTEGER;
        break;
    case Type.FLOAT:
        t = Opcodes.FLOAT;
        break;
    case Type.LONG:
        t = Opcodes.LONG;
        break;
    case Type.DOUBLE:
        t = Opcodes.DOUBLE;
        break;
    case Type.ARRAY:
        t = type.getDescriptor();
        break;
    // case Type.OBJECT:
    default:
        t = type.getInternalName();
        break;
    }
    int local = newLocalMapping(type);
    setLocalType(local, type);
    setFrameLocal(local, t);
    changed = true;
    return local;
}
 
Example #22
Source File: MethodGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
MethodGenerator(final MethodVisitor mv, final int access, final String name, final String descriptor) {
    super(ASM4, mv);
    this.access        = access;
    this.name          = name;
    this.descriptor    = descriptor;
    this.returnType    = Type.getReturnType(descriptor);
    this.argumentTypes = Type.getArgumentTypes(descriptor);
}
 
Example #23
Source File: JavaAdapterBytecodeGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void boxStackTop(final InstructionAdapter mv, final Type t) {
    switch(t.getSort()) {
    case Type.BOOLEAN:
        invokeValueOf(mv, "Boolean", 'Z');
        break;
    case Type.BYTE:
    case Type.SHORT:
    case Type.INT:
        // bytes and shorts get boxed as integers
        invokeValueOf(mv, "Integer", 'I');
        break;
    case Type.CHAR:
        invokeValueOf(mv, "Character", 'C');
        break;
    case Type.FLOAT:
        // floats get boxed as doubles
        mv.visitInsn(Opcodes.F2D);
        invokeValueOf(mv, "Double", 'D');
        break;
    case Type.LONG:
        invokeValueOf(mv, "Long", 'J');
        break;
    case Type.DOUBLE:
        invokeValueOf(mv, "Double", 'D');
        break;
    case Type.ARRAY:
    case Type.METHOD:
        // Already boxed
        break;
    case Type.OBJECT:
        if(t.equals(OBJECT_TYPE)) {
            mv.invokestatic(SCRIPTUTILS_TYPE_NAME, "unwrap", UNWRAP_METHOD_DESCRIPTOR, false);
        }
        break;
    default:
        // Not expecting anything else (e.g. VOID)
        assert false;
        break;
    }
}
 
Example #24
Source File: BasicInterpreter.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@Override
public BasicValue newValue(final Type type) {
    if (type == null) {
        return BasicValue.UNINITIALIZED_VALUE;
    }
    switch (type.getSort()) {
        case Type.VOID:
            return null;
        case Type.BOOLEAN:
        case Type.CHAR:
        case Type.BYTE:
        case Type.SHORT:
        case Type.INT:
            return BasicValue.INT_VALUE;
        case Type.FLOAT:
            return BasicValue.FLOAT_VALUE;
        case Type.LONG:
            return BasicValue.LONG_VALUE;
        case Type.DOUBLE:
            return BasicValue.DOUBLE_VALUE;
        case Type.ARRAY:
        case Type.OBJECT:
            return BasicValue.REFERENCE_VALUE;
        default:
            throw new AssertionError();
    }
}
 
Example #25
Source File: BasicInterpreter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BasicValue newValue(final Type type) {
    if (type == null) {
        return BasicValue.UNINITIALIZED_VALUE;
    }
    switch (type.getSort()) {
    case Type.VOID:
        return null;
    case Type.BOOLEAN:
    case Type.CHAR:
    case Type.BYTE:
    case Type.SHORT:
    case Type.INT:
        return BasicValue.INT_VALUE;
    case Type.FLOAT:
        return BasicValue.FLOAT_VALUE;
    case Type.LONG:
        return BasicValue.LONG_VALUE;
    case Type.DOUBLE:
        return BasicValue.DOUBLE_VALUE;
    case Type.ARRAY:
    case Type.OBJECT:
        return BasicValue.REFERENCE_VALUE;
    default:
        throw new Error("Internal error");
    }
}
 
Example #26
Source File: BasicInterpreter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BasicValue newValue(final Type type) {
    if (type == null) {
        return BasicValue.UNINITIALIZED_VALUE;
    }
    switch (type.getSort()) {
    case Type.VOID:
        return null;
    case Type.BOOLEAN:
    case Type.CHAR:
    case Type.BYTE:
    case Type.SHORT:
    case Type.INT:
        return BasicValue.INT_VALUE;
    case Type.FLOAT:
        return BasicValue.FLOAT_VALUE;
    case Type.LONG:
        return BasicValue.LONG_VALUE;
    case Type.DOUBLE:
        return BasicValue.DOUBLE_VALUE;
    case Type.ARRAY:
    case Type.OBJECT:
        return BasicValue.REFERENCE_VALUE;
    default:
        throw new Error("Internal error");
    }
}
 
Example #27
Source File: InstructionAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void sub(final Type type) {
    mv.visitInsn(type.getOpcode(Opcodes.ISUB));
}
 
Example #28
Source File: InstructionAdapter.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void sub(final Type type) {
    mv.visitInsn(type.getOpcode(Opcodes.ISUB));
}
 
Example #29
Source File: InstructionAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void astore(final Type type) {
    mv.visitInsn(type.getOpcode(Opcodes.IASTORE));
}
 
Example #30
Source File: NashornTextifier.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void visitInvokeDynamicInsn(final String name, final String desc, final Handle bsm, final Object... bsmArgs) {
    final StringBuilder sb = new StringBuilder();

    appendOpcode(sb, Opcodes.INVOKEDYNAMIC).append(' ');
    sb.append(name);
    appendDescriptor(sb, METHOD_DESCRIPTOR, desc);
    final int len = sb.length();
    for (int i = 0; i < 80 - len ; i++) {
        sb.append(' ');
    }
    sb.append(" [");
    appendHandle(sb, bsm);
    if (bsmArgs.length == 0) {
        sb.append("none");
    } else {
        for (final Object cst : bsmArgs) {
            if (cst instanceof String) {
                appendStr(sb, (String)cst);
            } else if (cst instanceof Type) {
                sb.append(((Type)cst).getDescriptor()).append(".class");
            } else if (cst instanceof Handle) {
                appendHandle(sb, (Handle)cst);
            } else if (cst instanceof Integer) {
                final int c = (Integer)cst;
                final int pp = c >> CALLSITE_PROGRAM_POINT_SHIFT;
                if (pp != 0) {
                    sb.append(" pp=").append(pp);
                }
                sb.append(NashornCallSiteDescriptor.toString(c & FLAGS_MASK));
            } else {
                sb.append(cst);
            }
            sb.append(", ");
        }
        sb.setLength(sb.length() - 2);
    }

    sb.append("]\n");
    addText(sb);
}