Bug 1152177 - Make jsid and Value pre barriers symetrical. r=jonco, a=1.4+
authorTerrence Cole <terrence@mozilla.com>
Fri, 10 Apr 2015 08:58:26 -0700
changeset 188832 eeda70f179d1
parent 188831 74cebaf34767
child 188833 ab82faa8d7bd
push id871
push userryanvm@gmail.com
push dateTue, 28 Apr 2015 01:05:05 +0000
treeherdermozilla-b2g30_v1_4@eeda70f179d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, 1
bugs1152177
milestone30.0
Bug 1152177 - Make jsid and Value pre barriers symetrical. r=jonco, a=1.4+
js/src/gc/Barrier.h
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -1057,16 +1057,18 @@ class BarrieredId
         if (JSID_IS_OBJECT(value)) {
             JSObject* obj = JSID_TO_OBJECT(value);
             JS::shadow::Zone* shadowZone = ShadowZoneOfObjectFromAnyThread(obj);
             if (shadowZone->needsBarrier()) {
                 js::gc::MarkObjectUnbarriered(shadowZone->barrierTracer(), &obj, "write barrier");
                 JS_ASSERT(obj == JSID_TO_OBJECT(value));
             }
         } else if (JSID_IS_STRING(value)) {
+            if (StringIsPermanentAtom(JSID_TO_STRING(value)))
+                return;
             JSString* str = JSID_TO_STRING(value);
             JS::shadow::Zone* shadowZone = ShadowZoneOfStringFromAnyThread(str);
             if (shadowZone->needsBarrier()) {
                 js::gc::MarkStringUnbarriered(shadowZone->barrierTracer(), &str, "write barrier");
                 JS_ASSERT(str == JSID_TO_STRING(value));
             }
         }
 #endif