Bug 923179 - Check main thread access later in generational barriers r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 11 Oct 2013 09:52:56 +0100
changeset 150442 b49e069aeddd057e53289d045bb5ca57808dcda0
parent 150441 266532efd5cb59da40ea3755ecc16fb2507991b1
child 150443 3f25e5821ed0ed7e8c35db2128af0850ca3c0294
push id25442
push userryanvm@gmail.com
push dateFri, 11 Oct 2013 19:39:21 +0000
treeherdermozilla-central@342e9d40235a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs923179
milestone27.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 923179 - Check main thread access later in generational barriers r=terrence
js/src/gc/Barrier.h
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -415,41 +415,41 @@ class RelocatablePtr : public Encapsulat
     }
     RelocatablePtr(const RelocatablePtr<T> &v) : EncapsulatedPtr<T>(v) {
         if (this->value)
             post();
     }
 
     ~RelocatablePtr() {
         if (this->value)
-            relocate(this->value->runtimeFromMainThread());
+            relocate(this->value->runtimeFromAnyThread());
     }
 
     RelocatablePtr<T> &operator=(T *v) {
         this->pre();
         JS_ASSERT(!IsPoisonedPtr<T>(v));
         if (v) {
             this->value = v;
             post();
         } else if (this->value) {
-            JSRuntime *rt = this->value->runtimeFromMainThread();
+            JSRuntime *rt = this->value->runtimeFromAnyThread();
             this->value = v;
             relocate(rt);
         }
         return *this;
     }
 
     RelocatablePtr<T> &operator=(const RelocatablePtr<T> &v) {
         this->pre();
         JS_ASSERT(!IsPoisonedPtr<T>(v.value));
         if (v.value) {
             this->value = v.value;
             post();
         } else if (this->value) {
-            JSRuntime *rt = this->value->runtimeFromMainThread();
+            JSRuntime *rt = this->value->runtimeFromAnyThread();
             this->value = v;
             relocate(rt);
         }
         return *this;
     }
 
   protected:
     void post() {
@@ -707,17 +707,17 @@ class HeapValue : public EncapsulatedVal
         JS_ASSERT(!IsPoisonedValue(v));
         value = v;
         post(shadowZone->runtimeFromAnyThread());
     }
 
     static void writeBarrierPost(const Value &value, Value *addr) {
 #ifdef JSGC_GENERATIONAL
         if (value.isMarkable())
-            shadowRuntimeFromMainThread(value)->gcStoreBufferPtr()->putValue(addr);
+            shadowRuntimeFromAnyThread(value)->gcStoreBufferPtr()->putValue(addr);
 #endif
     }
 
     static void writeBarrierPost(JSRuntime *rt, const Value &value, Value *addr) {
 #ifdef JSGC_GENERATIONAL
         if (value.isMarkable()) {
             JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
             shadowRuntime->gcStoreBufferPtr()->putValue(addr);
@@ -756,56 +756,56 @@ class RelocatableValue : public Encapsul
         JS_ASSERT(!IsPoisonedValue(v.value));
         if (v.value.isMarkable())
             post();
     }
 
     ~RelocatableValue()
     {
         if (value.isMarkable())
-            relocate(runtimeFromMainThread(value));
+            relocate(runtimeFromAnyThread(value));
     }
 
     RelocatableValue &operator=(const Value &v) {
         pre();
         JS_ASSERT(!IsPoisonedValue(v));
         if (v.isMarkable()) {
             value = v;
             post();
         } else if (value.isMarkable()) {
-            JSRuntime *rt = runtimeFromMainThread(value);
+            JSRuntime *rt = runtimeFromAnyThread(value);
             relocate(rt);
             value = v;
         } else {
             value = v;
         }
         return *this;
     }
 
     RelocatableValue &operator=(const RelocatableValue &v) {
         pre();
         JS_ASSERT(!IsPoisonedValue(v.value));
         if (v.value.isMarkable()) {
             value = v.value;
             post();
         } else if (value.isMarkable()) {
-            JSRuntime *rt = runtimeFromMainThread(value);
+            JSRuntime *rt = runtimeFromAnyThread(value);
             relocate(rt);
             value = v.value;
         } else {
             value = v.value;
         }
         return *this;
     }
 
   private:
     void post() {
 #ifdef JSGC_GENERATIONAL
         JS_ASSERT(value.isMarkable());
-        shadowRuntimeFromMainThread(value)->gcStoreBufferPtr()->putRelocatableValue(&value);
+        shadowRuntimeFromAnyThread(value)->gcStoreBufferPtr()->putRelocatableValue(&value);
 #endif
     }
 
     void relocate(JSRuntime *rt) {
 #ifdef JSGC_GENERATIONAL
         JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
         shadowRuntime->gcStoreBufferPtr()->removeRelocatableValue(&value);
 #endif