From 4c0ca14a86ca8db854dd759c476a407f0d42d529 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 2 Jun 2017 09:41:58 +1000 Subject: [PATCH] Bug 1368915 (part 5) - Introduce MAX_JS_FRAMES. r=mstange. --HG-- extra : rebase_source : 478043cf6e347f2eeb368cf0bcd90f7aa0c73c4e --- tools/profiler/core/platform.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index b772e7305b07..f0c28cbf7699 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -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)) {