Reviewers: ulan,

Description:
Enable code flushing even when objects were marked incrementally,
since the incremental visitor is setting the gc_age fields correctly.
This means the ResetSharedFunctionInfoCountersDuringIncrementalMarking
test passes even if it hits a marking stack overflow.

Please review this at https://chromiumcodereview.appspot.com/10258001/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/mark-compact.cc
  M     test/cctest/test-heap.cc


Index: src/mark-compact.cc
===================================================================
--- src/mark-compact.cc (revision 11455)
+++ src/mark-compact.cc (working copy)
@@ -1665,12 +1665,6 @@
 void MarkCompactCollector::PrepareForCodeFlushing() {
   ASSERT(heap() == Isolate::Current()->heap());

- // TODO(1609) Currently incremental marker does not support code flushing.
-  if (!FLAG_flush_code || was_marked_incrementally_) {
-    EnableCodeFlushing(false);
-    return;
-  }
-
 #ifdef ENABLE_DEBUGGER_SUPPORT
   if (heap()->isolate()->debug()->IsLoaded() ||
       heap()->isolate()->debug()->has_break_points()) {
@@ -1975,6 +1969,7 @@


static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque, Page* p) {
+  ASSERT(!marking_deque->IsFull());
   ASSERT(strcmp(Marking::kWhiteBitPattern, "00") == 0);
   ASSERT(strcmp(Marking::kBlackBitPattern, "10") == 0);
   ASSERT(strcmp(Marking::kGreyBitPattern, "11") == 0);
Index: test/cctest/test-heap.cc
===================================================================
--- test/cctest/test-heap.cc    (revision 11456)
+++ test/cctest/test-heap.cc    (working copy)
@@ -1649,6 +1649,15 @@
   while (!marking->IsStopped() && !marking->IsComplete()) {
     marking->Step(1 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
   }
+  if (!marking->IsStopped() || marking->should_hurry()) {
+    // We don't normally finish a GC via Step(), we normally finish by
+    // setting the stack guard and then do the final steps in the stack
+    // guard interrupt.  But here we didn't ask for that, and there is no
+    // JS code running to trigger the interrupt, so we explicitly finalize
+    // here.
+    HEAP->CollectAllGarbage(Heap::kNoGCFlags,
+                            "Test finalizing incremental mark-sweep");
+  }

   CHECK_EQ(HEAP->global_ic_age(), f->shared()->ic_age());
   CHECK_EQ(0, f->shared()->opt_count());


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to