Bug 1050440 - Remove repeated js::RunScript frames in ThreadStackHelper; r=snorp
authorJim Chen <nchen@mozilla.com>
Thu, 14 Aug 2014 17:17:55 -0400
changeset 222543 0a2d3711dd58f043e7071f3171fde41f853faa1a
parent 222542 53bafa32a1475be2694e023fdaaae753c5b4eab7
child 222544 1d41a9159e5809e937c8abd7490dd845832652c4
push id583
push userbhearsum@mozilla.com
push dateMon, 24 Nov 2014 19:04:58 +0000
treeherdermozilla-release@c107e74250f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1050440
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1050440 - Remove repeated js::RunScript frames in ThreadStackHelper; r=snorp
xpcom/threads/ThreadStackHelper.cpp
--- a/xpcom/threads/ThreadStackHelper.cpp
+++ b/xpcom/threads/ThreadStackHelper.cpp
@@ -600,17 +600,20 @@ ThreadStackHelper::FillStackBuffer()
       continue;
     }
 #ifdef MOZ_THREADSTACKHELPER_NATIVE
     if (mContextToFill) {
       mContextToFill->mStackEnd = entry->stackAddress();
     }
 #endif
     const char* const label = entry->label();
-    if (mStackToFill->IsSameAsEntry(prevLabel, label)) {
+    if (mStackToFill->IsSameAsEntry(prevLabel, label) ||
+        !strcmp(label, "js::RunScript")) {
+      // Avoid duplicate labels to save space in the stack.
+      // Avoid js::RunScript labels because we save actual JS frames above.
       continue;
     }
     mStackToFill->infallibleAppend(label);
     prevLabel = label;
   }
 
   // end != entry if we exited early due to not enough reserved frames.
   // Expand the number of reserved frames for next time.