Bug 1338623 - Use IsNotGray in all gray marking assertions r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 03 Mar 2017 10:45:47 +0000
changeset 493414 237caed7236d209f45b39dc1e5ab12692087ea51
parent 493413 1402d02dd61e0f69c00da5a765d6083a627d35eb
child 493415 ed21480d66e66fb04b09cd0eeba991e179fc7928
push id47755
push userbmo:dkeeler@mozilla.com
push dateFri, 03 Mar 2017 22:32:10 +0000
reviewerssfink
bugs1338623
milestone54.0a1
Bug 1338623 - Use IsNotGray in all gray marking assertions r=sfink
js/src/jscntxtinlines.h
--- a/js/src/jscntxtinlines.h
+++ b/js/src/jscntxtinlines.h
@@ -63,17 +63,17 @@ class CompartmentChecker
     }
 
     void checkZone(JS::Zone* z) {
         if (compartment && z != compartment->zone())
             fail(compartment->zone(), z);
     }
 
     void check(JSObject* obj) {
-        MOZ_ASSERT_IF(obj, IsInsideNursery(obj) || !obj->asTenured().isMarked(gc::GRAY));
+        MOZ_ASSERT(JS::ObjectIsNotGray(obj));
         if (obj)
             check(obj->compartment());
     }
 
     template<typename T>
     void check(const Rooted<T>& rooted) {
         check(rooted.get());
     }
@@ -95,17 +95,17 @@ class CompartmentChecker
         if (compartment) {
             JSRuntime* rt = compartment->runtimeFromAnyThread();
             MOZ_ASSERT(rt->gc.atomMarking.atomIsMarked(compartment->zone(), cell));
         }
 #endif
     }
 
     void check(JSString* str) {
-        MOZ_ASSERT(!str->isMarked(gc::GRAY));
+        MOZ_ASSERT(JS::CellIsNotGray(str));
         if (str->isAtom()) {
             checkAtom(str);
         } else {
             checkZone(str->zone());
         }
     }
 
     void check(JS::Symbol* symbol) {
@@ -156,17 +156,17 @@ class CompartmentChecker
     }
 
     void check(jsid id) {
         if (JSID_IS_GCTHING(id))
             checkAtom(JSID_TO_GCTHING(id).asCell());
     }
 
     void check(JSScript* script) {
-        MOZ_ASSERT_IF(script, !script->isMarked(gc::GRAY));
+        MOZ_ASSERT(JS::CellIsNotGray(script));
         if (script)
             check(script->compartment());
     }
 
     void check(InterpreterFrame* fp);
     void check(AbstractFramePtr frame);
     void check(SavedStacks* stacks);