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;
}
Aggregations