private void fillTagBounds(long tagStart) { long[] offset = new long[] { tagStart }; while (offset[0] < dumpBuffer.capacity()) { long start = offset[0]; int tag = readTag(offset); TagBounds bounds = tagBounds[tag]; long end = offset[0]; if (bounds == null) { TagBounds newBounds; if (tag == LOAD_CLASS) { newBounds = new LoadClassSegment(this, start, end); } else if (tag == STRING) { newBounds = new StringSegment(this, start, end); } else if (tag == STACK_TRACE) { newBounds = new StackTraceSegment(this, start, end); } else if (tag == STACK_FRAME) { newBounds = new StackFrameSegment(this, start, end); } else { newBounds = new TagBounds(tag, start, end); } tagBounds[tag] = newBounds; } else { bounds.endOffset = end; } } }
private long readStackFrameTag(long[] offset) { long start = offset[0]; if (hprofHeap.readTag(offset) != HprofHeap.STACK_FRAME) { return 0; } return getDumpBuffer().getID(start + stackFrameIDOffset); } }
StackFrame[] getStackFrames() { HprofByteBuffer buf = getHprofBuffer(); int frames = buf.getInt(fileOffset + stackTraceSegment.numberOfFramesOffset); StackFrame[] fr = new StackFrame[frames]; long idOffset = fileOffset + stackTraceSegment.framesListOffset; StackFrameSegment stackFrameSegment = stackTraceSegment.hprofHeap.getStackFrameSegment(); for (int i=0;i<frames;i++,idOffset+=buf.getIDSize()) { long frameID = buf.getID(idOffset); fr[i] = stackFrameSegment.getStackFrameByID(frameID); } return fr; }
StackFrame getStackFrameByID(long stackFrameID) { long[] offset = new long[] { startOffset }; while (offset[0] < endOffset) { long start = offset[0]; long frameID = readStackFrameTag(offset); if (frameID == stackFrameID) { return new StackFrame(this, start); } } return null; }
StackFrame getStackFrameByID(long stackFrameID) { long[] offset = new long[] { startOffset }; while (offset[0] < endOffset) { long start = offset[0]; long frameID = readStackFrameTag(offset); if (frameID == stackFrameID) { return new StackFrame(this, start); } } return null; }
StackFrame[] getStackFrames() { HprofByteBuffer buf = getHprofBuffer(); int frames = buf.getInt(fileOffset + stackTraceSegment.numberOfFramesOffset); StackFrame[] fr = new StackFrame[frames]; long idOffset = fileOffset + stackTraceSegment.framesListOffset; StackFrameSegment stackFrameSegment = stackTraceSegment.hprofHeap.getStackFrameSegment(); for (int i=0;i<frames;i++,idOffset+=buf.getIDSize()) { long frameID = buf.getID(idOffset); fr[i] = stackFrameSegment.getStackFrameByID(frameID); } return fr; }
StackFrame getStackFrameByID(long stackFrameID) { long[] offset = new long[] { startOffset }; while (offset[0] < endOffset) { long start = offset[0]; long frameID = readStackFrameTag(offset); if (frameID == stackFrameID) { return new StackFrame(this, start); } } return null; }
private long readStackFrameTag(long[] offset) { long start = offset[0]; if (hprofHeap.readTag(offset) != HprofHeap.STACK_FRAME) { return 0; } return getDumpBuffer().getID(start + stackFrameIDOffset); } }
private void fillTagBounds(long tagStart) { long[] offset = new long[] { tagStart }; while (offset[0] < dumpBuffer.capacity()) { long start = offset[0]; int tag = readTag(offset); TagBounds bounds = tagBounds[tag]; long end = offset[0]; if (bounds == null) { TagBounds newBounds; if (tag == LOAD_CLASS) { newBounds = new LoadClassSegment(this, start, end); } else if (tag == STRING) { newBounds = new StringSegment(this, start, end); } else if (tag == STACK_TRACE) { newBounds = new StackTraceSegment(this, start, end); } else if (tag == STACK_FRAME) { newBounds = new StackFrameSegment(this, start, end); } else { newBounds = new TagBounds(tag, start, end); } tagBounds[tag] = newBounds; } else { bounds.endOffset = end; } } }
StackFrame[] getStackFrames() { HprofByteBuffer buf = getHprofBuffer(); int frames = buf.getInt(fileOffset + stackTraceSegment.numberOfFramesOffset); StackFrame[] fr = new StackFrame[frames]; long idOffset = fileOffset + stackTraceSegment.framesListOffset; StackFrameSegment stackFrameSegment = stackTraceSegment.hprofHeap.getStackFrameSegment(); for (int i=0;i<frames;i++,idOffset+=buf.getIDSize()) { long frameID = buf.getID(idOffset); fr[i] = stackFrameSegment.getStackFrameByID(frameID); } return fr; }
private long readStackFrameTag(long[] offset) { long start = offset[0]; if (hprofHeap.readTag(offset) != HprofHeap.STACK_FRAME) { return 0; } return getDumpBuffer().getID(start + stackFrameIDOffset); } }
private void fillTagBounds(long tagStart) { long[] offset = new long[] { tagStart }; while (offset[0] < dumpBuffer.capacity()) { long start = offset[0]; int tag = readTag(offset); TagBounds bounds = tagBounds[tag]; long end = offset[0]; if (bounds == null) { TagBounds newBounds; if (tag == LOAD_CLASS) { newBounds = new LoadClassSegment(this, start, end); } else if (tag == STRING) { newBounds = new StringSegment(this, start, end); } else if (tag == STACK_TRACE) { newBounds = new StackTraceSegment(this, start, end); } else if (tag == STACK_FRAME) { newBounds = new StackFrameSegment(this, start, end); } else { newBounds = new TagBounds(tag, start, end); } tagBounds[tag] = newBounds; } else { bounds.endOffset = end; } } }