Search in sources :

Example 6 with J9ROMConstantPoolItemPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9ROMConstantPoolItemPointer in project openj9 by eclipse.

the class J9BCUtil method dumpStackMapSlots.

static U8Pointer dumpStackMapSlots(PrintStream out, J9ROMClassPointer classfile, U8Pointer slotData, long slotCount) throws CorruptDataException {
    int slotType;
    String[] slotTypes = { "top", "int", "float", "double", "long", "null", "uninitialized_this" };
    String[] primitiveArrayTypes = { "I", "F", "D", "J", "S", "B", "C", "Z" };
    out.print("(");
    for (int i = 0; i < slotCount; i++) {
        slotType = slotData.at(0).intValue();
        slotData = slotData.add(1);
        if (slotType <= 0x06) /*FR_STACKMAP_TYPE_INIT_OBJECT*/
        {
            out.print(slotTypes[slotType]);
        } else if (slotType == 0x07) /* CFR_STACKMAP_TYPE_OBJECT */
        {
            long index = new U16(slotData.at(0)).leftShift(8).add(slotData.at(1)).longValue();
            J9ROMConstantPoolItemPointer constantPool = ConstantPoolHelpers.J9_ROM_CP_FROM_ROM_CLASS(classfile);
            J9ROMStringRefPointer item = J9ROMStringRefPointer.cast(constantPool.add(index));
            J9UTF8Pointer data = item.utf8Data();
            String s = J9UTF8Helper.stringValue(data);
            if (s.charAt(0) != '[') {
                out.print("L");
            }
            out.print(s);
            slotData = slotData.add(2);
        } else if (slotType == 0x08) /* CFR_STACKMAP_TYPE_NEW_OBJECT */
        {
            long index = new U16(slotData.at(0)).leftShift(8).add(slotData.at(1)).longValue();
            out.print("this pc:" + index);
            slotData = slotData.add(2);
        } else {
            /* J9-ism: primitive array types start at slotType 9 and arity is really NEXT_U16()+1*/
            StringBuffer primitiveType = new StringBuffer("[");
            long index = new U16(slotData.at(0)).leftShift(8).add(slotData.at(1)).longValue();
            while (index-- > 0) {
                primitiveType.append("[");
            }
            primitiveType.append(primitiveArrayTypes[slotType - 9]);
            out.print(primitiveType.toString());
            slotData = slotData.add(2);
        }
        if (i != (slotCount - 1)) {
            out.print(", ");
        }
    }
    out.print(")");
    return slotData;
}
Also used : J9ROMConstantPoolItemPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMConstantPoolItemPointer) J9ROMStringRefPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMStringRefPointer) U16(com.ibm.j9ddr.vm29.types.U16) J9UTF8Pointer(com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)

Aggregations

J9ROMConstantPoolItemPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMConstantPoolItemPointer)6 J9ROMNameAndSignaturePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer)4 J9ROMStringRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMStringRefPointer)4 SelfRelativePointer (com.ibm.j9ddr.vm29.pointer.SelfRelativePointer)3 J9ROMClassRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassRefPointer)3 J9ROMFieldRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldRefPointer)3 J9ROMMethodRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodRefPointer)3 U16Pointer (com.ibm.j9ddr.vm29.pointer.U16Pointer)2 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)2 J9ROMMethodHandleRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodHandleRefPointer)2 J9ROMMethodTypeRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodTypeRefPointer)2 J9ROMSingleSlotConstantRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMSingleSlotConstantRefPointer)2 J9UTF8Pointer (com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)2 FloatPointer (com.ibm.j9ddr.vm29.pointer.FloatPointer)1 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)1 J9EnclosingObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9EnclosingObjectPointer)1 J9ExceptionHandlerPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ExceptionHandlerPointer)1 J9ExceptionInfoPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ExceptionInfoPointer)1 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)1 I16 (com.ibm.j9ddr.vm29.types.I16)1