Bug 1300515: TraceLogger - Ignore debug checks when stack is empty, r=bbouvier
authorHannes Verschore <hv1989@gmail.com>
Thu, 08 Sep 2016 17:00:18 +0200
changeset 354607 8e68d6ac1801e51f965d47b73d64981c92671ccf
parent 354606 f4bc619ed49945592dbc941e5c5ecb45f049d9ac
child 354608 979e180c5045a08ff7a7236c3c464ed8194a938a
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1300515
milestone51.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 1300515: TraceLogger - Ignore debug checks when stack is empty, r=bbouvier
js/src/jit-test/tests/tracelogger/bug1300515.js
js/src/vm/TraceLogging.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/tracelogger/bug1300515.js
@@ -0,0 +1,15 @@
+
+
+function test1() {
+    test();
+}
+
+function test() {
+    var du = new Debugger();
+    du.setupTraceLoggerScriptCalls();
+    du.startTraceLogger();
+}
+
+var du = new Debugger();
+if (typeof du.setupTraceLoggerScriptCalls == "function")
+    test1();
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -528,17 +528,17 @@ void
 TraceLoggerThread::stopEvent(uint32_t id)
 {
     MOZ_ASSERT(TLTextIdIsTreeEvent(id) || id == TraceLogger_Error);
     MOZ_ASSERT(traceLoggerState);
     if (!traceLoggerState->isTextIdEnabled(id))
         return;
 
 #ifdef DEBUG
-    if (enabled_ > 0) {
+    if (enabled_ > 0 && !graphStack.empty()) {
         uint32_t prev = graphStack.popCopy();
         if (id == TraceLogger_Engine) {
             MOZ_ASSERT(prev == TraceLogger_IonMonkey || prev == TraceLogger_Baseline ||
                        prev == TraceLogger_Interpreter);
         } else if (id == TraceLogger_Scripts) {
             MOZ_ASSERT(prev >= TraceLogger_Last);
         } else if (id >= TraceLogger_Last) {
             MOZ_ASSERT(prev >= TraceLogger_Last);