Fix 564800 - GCPolicyManager::signal assert firing (r=fklockii)
authorLars T Hansen <lhansen@adobe.com>
Thu, 20 May 2010 09:02:54 +0200
changeset 4707 29670bf4f87e
parent 4706 73f892a524b5
child 4708 185b111c48a0
push id2463
push userlhansen@adobe.com
push date2010-05-20 07:03 +0000
reviewersfklockii
bugs564800
Fix 564800 - GCPolicyManager::signal assert firing (r=fklockii)
MMgc/GC.cpp
--- a/MMgc/GC.cpp
+++ b/MMgc/GC.cpp
@@ -1236,22 +1236,27 @@ namespace MMgc
 
     void GC::CollectionWork()
     {
         if (nogc)
             return;
 
         if (incremental) {
             if (!collecting) {
-                if (!marking)
-                    StartIncrementalMark();
-                else if (policy.queryEndOfCollectionCycle())
+                if (!marking) {
+                    if (!Reaping()) {
+                        StartIncrementalMark();
+                    }
+                }
+                else if (policy.queryEndOfCollectionCycle()) {
                     FinishIncrementalMark(true);
-                else
+                }
+                else {
                     IncrementalMark();
+                }
             }
         }
         else {
             // non-incremental collection
             Collect();
         }
     }
 
@@ -1325,18 +1330,21 @@ namespace MMgc
             GCAssertMsg(false, "A MMGC_GCENTER macro must exist on the stack");
             GCHeap::SignalInconsistentHeapState("MMGC_GCENTER missing");
             /*NOTREACHED*/
             return NULL;
         }
 
         // always be marking in pedantic mode
         if(incrementalValidationPedantic) {
-            if(!marking)
-                StartIncrementalMark();
+            if(!marking) {
+                if (!Reaping()) {
+                    StartIncrementalMark();
+                }
+            }
         }
 #endif
 #ifdef AVMPLUS_SAMPLER
         avmplus::AvmCore *core = (avmplus::AvmCore*)GetGCContextVariable(GCV_AVMCORE);
         if(core)
             core->sampleCheck();
 #endif
 
@@ -2525,16 +2533,17 @@ namespace MMgc
 
 
     void GC::StartIncrementalMark()
     {
         policy.signal(GCPolicyManager::START_StartIncrementalMark);     // garbage collection starts
 
         GCAssert(!marking);
         GCAssert(!collecting);
+        GCAssert(!Reaping());       // bugzilla 564800
 
         lastStartMarkIncrementCount = markIncrements();
 
         // set the stack cleaning trigger
         stackCleaned = false;
 
         marking = true;