Bug 913558 - Improve GGC store buffer threadsafe assertions, r=terrence.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 10 Sep 2013 08:41:14 -0700
changeset 146431 0979fdfd27176db326a7dd1afd9e41bc7ef1bc88
parent 146430 2b76eb674066a5182e9be5e47365e41e70277636
child 146432 f937dc17e5ac87d6df73ff66b64293acccf839d8
push id25260
push userryanvm@gmail.com
push dateWed, 11 Sep 2013 00:29:30 +0000
treeherdermozilla-central@f73bed2856a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs913558
milestone26.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 913558 - Improve GGC store buffer threadsafe assertions, r=terrence.
js/src/gc/StoreBuffer.h
--- a/js/src/gc/StoreBuffer.h
+++ b/js/src/gc/StoreBuffer.h
@@ -115,17 +115,17 @@ class StoreBuffer
          * Attempts to reduce the usage of the buffer by removing unnecessary
          * entries.
          */
         virtual void compact();
 
         /* Add one item to the buffer. */
         void put(const T &t) {
             mozilla::ReentrancyGuard g(*this);
-            JS_ASSERT(!owner->inParallelSection());
+            JS_ASSERT(CurrentThreadCanAccessRuntime(owner->runtime));
 
             if (!enabled_)
                 return;
 
             T *tp = storage_.new_<T>(t);
             if (!tp)
                 MOZ_CRASH();
 
@@ -154,17 +154,17 @@ class StoreBuffer
         {}
 
         /* Override compaction to filter out removed items. */
         void compactMoved();
         virtual void compact();
 
         /* Record a removal from the buffer. */
         void unput(const T &v) {
-            JS_ASSERT(!this->owner->inParallelSection());
+            JS_ASSERT(CurrentThreadCanAccessRuntime(this->owner->runtime));
             MonoTypeBuffer<T>::put(v.tagged());
         }
     };
 
     class GenericBuffer
     {
         friend class StoreBuffer;
         friend class mozilla::ReentrancyGuard;
@@ -189,17 +189,17 @@ class StoreBuffer
         }
 
         /* Mark all generic edges. */
         void mark(JSTracer *trc);
 
         template <typename T>
         void put(const T &t) {
             mozilla::ReentrancyGuard g(*this);
-            JS_ASSERT(!owner->inParallelSection());
+            JS_ASSERT(CurrentThreadCanAccessRuntime(owner->runtime));
 
             /* Ensure T is derived from BufferableRef. */
             (void)static_cast<const BufferableRef*>(&t);
 
             if (!enabled_)
                 return;
 
             unsigned size = sizeof(T);