Bug 647055 - Fix MarkIfGCThingWord. r=igor
authorGregor Wagner <anygregor@gmail.com>
Wed, 06 Apr 2011 13:05:16 -0700
changeset 67926 b7a9e67f2e545d6522664393e22d2efa329ae2fd
parent 67925 a1cd032bdf77c8939ebfe8b3f3a90925cb62bc2c
child 67927 59705c13d959b79fd257db01b558bb3e8d99a9e3
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersigor
bugs647055
milestone2.2a1pre
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 647055 - Fix MarkIfGCThingWord. r=igor
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -213,17 +213,17 @@ template<typename T>
 inline ConservativeGCTest
 Arena<T>::mark(T *thing, JSTracer *trc)
 {
     T *alignedThing = getAlignedThing(thing);
 
     if (alignedThing > &t.things[ThingsPerArena-1] || alignedThing < &t.things[0])
         return CGCT_NOTARENA;
 
-    if (!aheader.compartment || inFreeList(alignedThing))
+    if (inFreeList(alignedThing))
         return CGCT_NOTLIVE;
 
     JS_ASSERT(sizeof(T) == aheader.thingSize);
     JS_SET_TRACING_NAME(trc, "machine stack");
     js::gc::Mark(trc, alignedThing);
 
 #ifdef JS_DUMP_CONSERVATIVE_GC_ROOTS
     if (alignedThing != thing)
@@ -639,16 +639,19 @@ MarkIfGCThingWord(JSTracer *trc, jsuword
     if (!rt->gcChunkSet.has(chunk))
         return CGCT_NOTCHUNK;
 
     if (!chunk->withinArenasRange(cell))
         return CGCT_NOTARENA;
 
     ArenaHeader *aheader = cell->arena()->header();
 
+    if (!aheader->compartment)
+        return CGCT_NOTLIVE;
+
     ConservativeGCTest test;
     thingKind = aheader->thingKind;
 
     switch (thingKind) {
       case FINALIZE_OBJECT0:
         test = MarkCell<JSObject>(cell, trc);
         break;
       case FINALIZE_OBJECT2: