Bug 941821 - Fix an exact rooting hazard false positive across ForkJoin invocation; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Thu, 21 Nov 2013 14:27:15 -0800
changeset 157363 2ab7cff78c5012591b5e3089781956a54cb6af08
parent 157362 ad3f19e7c0fc3f355d3127eb56ae09d191676479
child 157364 3b9e118ded0fcf433cb78179cd2527ec09d33485
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssfink
bugs941821
milestone28.0a1
Bug 941821 - Fix an exact rooting hazard false positive across ForkJoin invocation; r=sfink
js/src/vm/ForkJoin.cpp
--- a/js/src/vm/ForkJoin.cpp
+++ b/js/src/vm/ForkJoin.cpp
@@ -1468,16 +1468,21 @@ ForkJoinShared::executeFromMainThread()
 
 void
 ForkJoinShared::executePortion(PerThreadData *perThread,
                                uint32_t threadId)
 {
     // WARNING: This code runs ON THE PARALLEL WORKER THREAD.
     // Therefore, it should NOT access `cx_` in any way!
 
+    // ForkJoinSlice already contains an AutoAssertNoGC; however, the analysis
+    // does not propagate this type information. We duplicate the assertion
+    // here for maximum clarity.
+    JS::AutoAssertNoGC nogc(runtime());
+
     Allocator *allocator = allocators_[threadId];
     ForkJoinSlice slice(perThread, threadId, numSlices_, allocator,
                         this, &records_[threadId]);
     AutoSetForkJoinSlice autoContext(&slice);
 
     Spew(SpewOps, "Up");
 
     // Make a new IonContext for the slice, which is needed if we need to