зеркало из https://github.com/mozilla/gecko-dev.git
Bug 978262 - Ignore duplicate frames when getting BHR stack. r=froydnj
This commit is contained in:
Родитель
1599acb8ce
Коммит
f00f89649e
|
@ -183,12 +183,20 @@ ThreadStackHelper::FillStackBuffer() {
|
|||
// Go from front to back
|
||||
const volatile StackEntry* entry = mPseudoStack->mStack;
|
||||
const volatile StackEntry* end = entry + mPseudoStack->stackSize();
|
||||
// Deduplicate identical, consecutive frames
|
||||
const char* prevLabel = nullptr;
|
||||
for (; reservedSize-- && entry != end; entry++) {
|
||||
/* We only accept non-copy labels, because
|
||||
we are unable to actually copy labels here */
|
||||
if (!entry->isCopyLabel()) {
|
||||
mStackBuffer.infallibleAppend(entry->label());
|
||||
if (entry->isCopyLabel()) {
|
||||
continue;
|
||||
}
|
||||
const char* const label = entry->label();
|
||||
if (label == prevLabel) {
|
||||
continue;
|
||||
}
|
||||
mStackBuffer.infallibleAppend(label);
|
||||
prevLabel = label;
|
||||
}
|
||||
// If we exited early due to buffer size, expand the buffer for next time
|
||||
mMaxStackSize += (end - entry);
|
||||
|
|
Загрузка…
Ссылка в новой задаче