Bug 1368915 (part 5) - Introduce MAX_JS_FRAMES. r=mstange.

--HG--
extra : rebase_source : 478043cf6e347f2eeb368cf0bcd90f7aa0c73c4e
This commit is contained in:
Nicholas Nethercote 2017-06-02 09:41:58 +10:00
Родитель 26d1e36a3d
Коммит 4c0ca14a86
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -796,9 +796,12 @@ AddPseudoEntry(PSLockRef aLock, ProfileBuffer* aBuffer,
aBuffer->addTag(ProfileBufferEntry::Category(uint32_t(entry.category())));
}
// The maximum number of native frames obtained. Setting it too high risks the
// unwinder wasting a lot of time looping on corrupted stacks.
// Setting MAX_NATIVE_FRAMES too high risks the unwinder wasting a lot of time
// looping on corrupted stacks.
//
// The PseudoStack frame size is found in PseudoStack::MaxEntries.
static const size_t MAX_NATIVE_FRAMES = 1024;
static const size_t MAX_JS_FRAMES = 1024;
struct NativeStack
{
@ -850,7 +853,7 @@ MergeStacksIntoProfile(PSLockRef aLock, ProfileBuffer* aBuffer,
? UINT32_MAX
: aBuffer->mGeneration;
uint32_t jsCount = 0;
JS::ProfilingFrameIterator::Frame jsFrames[1000];
JS::ProfilingFrameIterator::Frame jsFrames[MAX_JS_FRAMES];
// Only walk jit stack if profiling frame iterator is turned on.
if (context && JS::IsProfilingEnabledForContext(context)) {