[INFER] Check compartment when tracing TypeObject conservative roots during GC, bug 673792.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 25 Jul 2011 14:48:22 -0700
changeset 77383 681d2903edb79aa46050872ee0962aa6527c178e
parent 77382 4d1506b097db00d81d4b06c594f86220195b3cf9
child 77384 60cb5a22dc10d5e6be28e70770cbcda8b42edbc0
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs673792
milestone8.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
[INFER] Check compartment when tracing TypeObject conservative roots during GC, bug 673792.
js/src/jsgcmark.cpp
--- a/js/src/jsgcmark.cpp
+++ b/js/src/jsgcmark.cpp
@@ -232,25 +232,16 @@ void
 MarkShape(JSTracer *trc, const Shape *shape, const char *name)
 {
     JS_ASSERT(trc);
     JS_ASSERT(shape);
     JS_SET_TRACING_NAME(trc, name);
     Mark(trc, shape);
 }
 
-void
-MarkTypeObject(JSTracer *trc, types::TypeObject *object, const char *name)
-{
-    JS_ASSERT(trc);
-    JS_ASSERT(object);
-    JS_SET_TRACING_NAME(trc, name);
-    object->trace(trc, false);
-}
-
 #if JS_HAS_XML_SUPPORT
 void
 MarkXML(JSTracer *trc, JSXML *xml, const char *name)
 {
     JS_ASSERT(trc);
     JS_ASSERT(xml);
     JS_SET_TRACING_NAME(trc, name);
     Mark(trc, xml);
@@ -522,17 +513,22 @@ void
 MarkRoot(JSTracer *trc, const Shape *thing, const char *name)
 {
     MarkShape(trc, thing, name);
 }
 
 void
 MarkRoot(JSTracer *trc, types::TypeObject *thing, const char *name)
 {
-    MarkTypeObject(trc, thing, name);
+    JS_ASSERT(trc);
+    JS_ASSERT(thing);
+    JS_SET_TRACING_NAME(trc, name);
+    JSRuntime *rt = trc->context->runtime;
+    if (!rt->gcCurrentCompartment || thing->compartment() == rt->gcCurrentCompartment)
+        thing->trace(trc, false);
 }
 
 void
 MarkRoot(JSTracer *trc, JSXML *thing, const char *name)
 {
     MarkXML(trc, thing, name);
 }