private int readConstantPool(long[] offset) { long start = offset[0]; int size = dumpBuffer.getShort(start); offset[0] += 2; for (int i = 0; i < size; i++) { offset[0] += 2; readValue(offset); } return (int) (offset[0] - start); }
private List<Field> computeFields() { HprofByteBuffer buffer = getHprofBuffer(); long offset = fileOffset + getInstanceFieldOffset(); int i; int fields = buffer.getShort(offset); List<Field> filedsList = new ArrayList<Field>(fields); for (i = 0; i < fields; i++) { filedsList.add(new HprofField(this, offset + 2 + (i * classDumpSegment.fieldSize))); } return filedsList; }
private int readStaticFields(long[] offset) { long start = offset[0]; int fields = dumpBuffer.getShort(start); offset[0] += 2; int idSize = dumpBuffer.getIDSize(); for (int i = 0; i < fields; i++) { if (DEBUG) { long nameId = dumpBuffer.getID(offset[0]); System.out.print("Static field name ID " + nameId + " "); // NOI18N } offset[0] += idSize; @SuppressWarnings("unused") byte type = readValue(offset); } return (int) (offset[0] - start); }
private int readInstanceFields(long[] offset) { long position = offset[0]; int fields = dumpBuffer.getShort(offset[0]); offset[0] += 2; if (DEBUG) { for (int i = 0; i < fields; i++) { long nameId = dumpBuffer.getID(offset[0]); offset[0] += dumpBuffer.getIDSize(); byte type = dumpBuffer.get(offset[0]++); System.out.println("Instance field name ID " + nameId + " Type " + type); // NOI18N } } else { offset[0] += (fields * (dumpBuffer.getIDSize() + 1)); } return (int) (offset[0] - position); }
case HprofHeap.SHORT: short sh = dumpBuffer.getShort(position);
int getConstantPoolSize() { long cpOffset = fileOffset + classDumpSegment.constantPoolSizeOffset; HprofByteBuffer buffer = getHprofBuffer(); int cpRecords = buffer.getShort(cpOffset); HprofHeap heap = getHprof(); cpOffset += 2; for (int i = 0; i < cpRecords; i++) { byte type = buffer.get(cpOffset + 2); int size = heap.getValueSize(type); cpOffset += (2 + 1 + size); } return (int) (cpOffset - (fileOffset + classDumpSegment.constantPoolSizeOffset)); }
int getStaticFiledSize(int staticFieldOffset) { int i; HprofByteBuffer buffer = getHprofBuffer(); int idSize = buffer.getIDSize(); long fieldOffset = fileOffset + staticFieldOffset; int fields = buffer.getShort(fieldOffset); HprofHeap heap = getHprof(); fieldOffset += 2; for (i = 0; i < fields; i++) { byte type = buffer.get(fieldOffset + idSize); int size = heap.getValueSize(type); fieldOffset += (idSize + 1 + size); } return (int) (fieldOffset - staticFieldOffset - fileOffset); }
List<FieldValue> getStaticFieldValues(boolean addClassLoader) { HprofByteBuffer buffer = getHprofBuffer(); long offset = fileOffset + getStaticFieldOffset(); int i; int fields; List<FieldValue> filedsList; HprofHeap heap = getHprof(); fields = buffer.getShort(offset); offset += 2; filedsList = new ArrayList<FieldValue>(fields+(addClassLoader?0:1)); for (i = 0; i < fields; i++) { byte type = buffer.get(offset + classDumpSegment.fieldTypeOffset); int fieldSize = classDumpSegment.fieldSize + heap.getValueSize(type); HprofFieldValue value; if (type == HprofHeap.OBJECT) { value = new HprofFieldObjectValue(this, offset); } else { value = new HprofFieldValue(this, offset); } filedsList.add(value); offset += fieldSize; } if (addClassLoader) { long classLoaderOffset = fileOffset + classDumpSegment.classLoaderIDOffset; filedsList.add(new ClassLoaderFieldValue(this, classLoaderOffset)); } return filedsList; }
void findStaticReferencesFor(long instanceId, List<Value> refs) { int i; HprofByteBuffer buffer = getHprofBuffer(); int idSize = buffer.getIDSize(); long fieldOffset = fileOffset + getStaticFieldOffset(); int fields = buffer.getShort(fieldOffset); List<FieldValue> staticFileds = null; HprofHeap heap = getHprof(); fieldOffset += 2; for (i = 0; i < fields; i++) { byte type = buffer.get(fieldOffset + idSize); int size = heap.getValueSize(type); if ((type == HprofHeap.OBJECT) && (instanceId == buffer.getID(fieldOffset + idSize + 1))) { if (staticFileds == null) { staticFileds = getStaticFieldValues(); } refs.add(staticFileds.get(i)); } fieldOffset += (idSize + 1 + size); } if (instanceId == getClassLoaderId()) { if (staticFileds == null) { staticFileds = getStaticFieldValues(); } refs.add(staticFileds.get(fields)); } }
private int readConstantPool(long[] offset) { long start = offset[0]; int size = dumpBuffer.getShort(start); offset[0] += 2; for (int i = 0; i < size; i++) { offset[0] += 2; readValue(offset); } return (int) (offset[0] - start); }
private int readConstantPool(long[] offset) { long start = offset[0]; int size = dumpBuffer.getShort(start); offset[0] += 2; for (int i = 0; i < size; i++) { offset[0] += 2; readValue(offset); } return (int) (offset[0] - start); }
private List /*<Field>*/ computeFields() { HprofByteBuffer buffer = getHprofBuffer(); long offset = fileOffset + getInstanceFieldOffset(); int i; int fields = buffer.getShort(offset); List filedsList = new ArrayList(fields); for (i = 0; i < fields; i++) { filedsList.add(new HprofField(this, offset + 2 + (i * classDumpSegment.fieldSize))); } return filedsList; }
private List<Field> computeFields() { HprofByteBuffer buffer = getHprofBuffer(); long offset = fileOffset + getInstanceFieldOffset(); int i; int fields = buffer.getShort(offset); List<Field> filedsList = new ArrayList<Field>(fields); for (i = 0; i < fields; i++) { filedsList.add(new HprofField(this, offset + 2 + (i * classDumpSegment.fieldSize))); } return filedsList; }
private int readStaticFields(long[] offset) { long start = offset[0]; int fields = dumpBuffer.getShort(start); offset[0] += 2; int idSize = dumpBuffer.getIDSize(); for (int i = 0; i < fields; i++) { if (DEBUG) { long nameId = dumpBuffer.getID(offset[0]); System.out.print("Static field name ID " + nameId + " "); // NOI18N } offset[0] += idSize; byte type = readValue(offset); } return (int) (offset[0] - start); }
private int readInstanceFields(long[] offset) { long position = offset[0]; int fields = dumpBuffer.getShort(offset[0]); offset[0] += 2; if (DEBUG) { for (int i = 0; i < fields; i++) { long nameId = dumpBuffer.getID(offset[0]); offset[0] += dumpBuffer.getIDSize(); byte type = dumpBuffer.get(offset[0]++); System.out.println("Instance field name ID " + nameId + " Type " + type); // NOI18N } } else { offset[0] += (fields * (dumpBuffer.getIDSize() + 1)); } return (int) (offset[0] - position); }
private int readStaticFields(long[] offset) { long start = offset[0]; int fields = dumpBuffer.getShort(start); offset[0] += 2; int idSize = dumpBuffer.getIDSize(); for (int i = 0; i < fields; i++) { if (DEBUG) { long nameId = dumpBuffer.getID(offset[0]); System.out.print("Static field name ID " + nameId + " "); // NOI18N } offset[0] += idSize; @SuppressWarnings("unused") byte type = readValue(offset); } return (int) (offset[0] - start); }
int getConstantPoolSize() { long cpOffset = fileOffset + classDumpSegment.constantPoolSizeOffset; HprofByteBuffer buffer = getHprofBuffer(); int cpRecords = buffer.getShort(cpOffset); HprofHeap heap = getHprof(); cpOffset += 2; for (int i = 0; i < cpRecords; i++) { byte type = buffer.get(cpOffset + 2); int size = heap.getValueSize(type); cpOffset += (2 + 1 + size); } return (int) (cpOffset - (fileOffset + classDumpSegment.constantPoolSizeOffset)); }
int getConstantPoolSize() { long cpOffset = fileOffset + classDumpSegment.constantPoolSizeOffset; HprofByteBuffer buffer = getHprofBuffer(); int cpRecords = buffer.getShort(cpOffset); HprofHeap heap = getHprof(); cpOffset += 2; for (int i = 0; i < cpRecords; i++) { byte type = buffer.get(cpOffset + 2); int size = heap.getValueSize(type); cpOffset += (2 + 1 + size); } return (int) (cpOffset - (fileOffset + classDumpSegment.constantPoolSizeOffset)); }
int getStaticFiledSize(int staticFieldOffset) { int i; HprofByteBuffer buffer = getHprofBuffer(); int idSize = buffer.getIDSize(); long fieldOffset = fileOffset + staticFieldOffset; int fields = buffer.getShort(fieldOffset); HprofHeap heap = getHprof(); fieldOffset += 2; for (i = 0; i < fields; i++) { byte type = buffer.get(fieldOffset + idSize); int size = heap.getValueSize(type); fieldOffset += (idSize + 1 + size); } return (int) (fieldOffset - staticFieldOffset - fileOffset); }
int getStaticFiledSize(int staticFieldOffset) { int i; HprofByteBuffer buffer = getHprofBuffer(); int idSize = buffer.getIDSize(); long fieldOffset = fileOffset + staticFieldOffset; int fields = buffer.getShort(fieldOffset); HprofHeap heap = getHprof(); fieldOffset += 2; for (i = 0; i < fields; i++) { byte type = buffer.get(fieldOffset + idSize); int size = heap.getValueSize(type); fieldOffset += (idSize + 1 + size); } return (int) (fieldOffset - staticFieldOffset - fileOffset); }