Bug 881223: Issue warnings on GC bailouts. r=nmatsakis
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Mon, 10 Jun 2013 07:40:00 -0400
changeset 146133 22b38f0b80849de065388ef3f418e43a518ce0fa
parent 146132 8ac5d1f98b21a34b28cd3d7d655d9c360382bfcd
child 146134 0acda90a6f6aac6dc970afaabab158183703d18f
child 146141 554597fd45e950061bd8d2bcd4d468b8c964ef7f
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnmatsakis
bugs881223
milestone24.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 881223: Issue warnings on GC bailouts. r=nmatsakis
js/src/vm/ForkJoin.cpp
js/src/vm/ForkJoin.h
--- a/js/src/vm/ForkJoin.cpp
+++ b/js/src/vm/ForkJoin.cpp
@@ -931,16 +931,20 @@ BailoutExplanation(ParallelBailoutCause 
       case ParallelBailoutOutOfMemory:
         return "out of memory";
       case ParallelBailoutUnsupported:
         return "unsupported";
       case ParallelBailoutUnsupportedStringComparison:
         return "unsupported string comparison";
       case ParallelBailoutUnsupportedSparseArray:
         return "unsupported sparse array";
+      case ParallelBailoutRequestedGC:
+        return "requested GC";
+      case ParallelBailoutRequestedZoneGC:
+        return "requested zone GC";
       default:
         return "no known reason";
     }
 }
 
 void
 js::ParallelDo::determineBailoutCause()
 {
@@ -1440,16 +1444,18 @@ ForkJoinShared::check(ForkJoinSlice &sli
             // requestZoneGC() methods should be invoked.
             JS_ASSERT(!cx_->runtime()->gcIsNeeded);
 
             // If interrupt is requested, bring worker threads to a halt,
             // service the interrupt, then let them start back up again.
             // AutoRendezvous autoRendezvous(slice);
             // if (!js_HandleExecutionInterrupt(cx_))
             //     return setAbortFlag(true);
+            slice.bailoutRecord->setCause(ParallelBailoutInterrupt,
+                                          NULL, NULL, NULL);
             setAbortFlag(false);
             return false;
         }
     } else if (rendezvous_) {
         joinRendezvous(slice);
     }
 
     return true;
@@ -1636,23 +1642,27 @@ ForkJoinSlice::InitializeTLS()
     }
     return true;
 }
 
 void
 ForkJoinSlice::requestGC(JS::gcreason::Reason reason)
 {
     shared->requestGC(reason);
+    bailoutRecord->setCause(ParallelBailoutRequestedGC,
+                            NULL, NULL, NULL);
     shared->setAbortFlag(false);
 }
 
 void
 ForkJoinSlice::requestZoneGC(JS::Zone *zone, JS::gcreason::Reason reason)
 {
     shared->requestZoneGC(zone, reason);
+    bailoutRecord->setCause(ParallelBailoutRequestedZoneGC,
+                            NULL, NULL, NULL);
     shared->setAbortFlag(false);
 }
 
 /////////////////////////////////////////////////////////////////////////////
 
 uint32_t
 js::ForkJoinSlices(JSContext *cx)
 {
--- a/js/src/vm/ForkJoin.h
+++ b/js/src/vm/ForkJoin.h
@@ -253,16 +253,18 @@ enum ParallelBailoutCause {
     ParallelBailoutCalledToUncompiledScript,
     ParallelBailoutIllegalWrite,
     ParallelBailoutAccessToIntrinsic,
     ParallelBailoutOverRecursed,
     ParallelBailoutOutOfMemory,
     ParallelBailoutUnsupported,
     ParallelBailoutUnsupportedStringComparison,
     ParallelBailoutUnsupportedSparseArray,
+    ParallelBailoutRequestedGC,
+    ParallelBailoutRequestedZoneGC,
 };
 
 struct ParallelBailoutTrace {
     JSScript *script;
     jsbytecode *bytecode;
 };
 
 // See "Bailouts" section in comment above.