Reviewers: Michael Starzinger, danno,

Description:
Perform incremental marking step after free-list allocation and clean-up
incremental marking start condition.


BUG=


Please review this at https://codereview.chromium.org/14634007/

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

Affected files:
  M src/incremental-marking.cc
  M src/spaces.cc


Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index 7aadd279dc6d4f739f2642515acbdb2e9673eb14..dca3d88cb5c7e3025d771e6fe33f9247126ba07a 100644
--- a/src/incremental-marking.cc
+++ b/src/incremental-marking.cc
@@ -490,10 +490,16 @@ bool IncrementalMarking::WorthActivating() {
   // debug tests run with incremental marking and some without.
   static const intptr_t kActivationThreshold = 0;
 #endif
-
+  // Only start incremental marking in a save state: 1) when expose GC is
+  // deactivated, 2) when incremental marking is turned on, 3) when we are
+  // currently not in a GC, and 4) when we are currently not serializing
+  // or deserializing the heap.
   return !FLAG_expose_gc &&
       FLAG_incremental_marking &&
+      FLAG_incremental_marking_steps &&
+      heap_->gc_state() == Heap::NOT_IN_GC &&
       !Serializer::enabled() &&
+      heap_->isolate()->IsInitialized() &&
       heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold;
 }

@@ -866,16 +872,6 @@ void IncrementalMarking::MarkingComplete(CompletionAction action) {

 void IncrementalMarking::OldSpaceStep(intptr_t allocated) {
if (IsStopped() && WorthActivating() && heap_->NextGCIsLikelyToBeFull()) { - // Only start incremental marking in a save state: 1) when we are not in
-    // a GC, 2) when we turned-on incremental marking, 3) when we are
-    // currently not serializing or deserializing the heap.
-    if (heap_->gc_state() != Heap::NOT_IN_GC ||
-        !FLAG_incremental_marking ||
-        !FLAG_incremental_marking_steps ||
-        Serializer::enabled() ||
-        !heap_->isolate()->IsInitialized()) {
-      return;
-    }
     Start();
   } else {
Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD);
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index df1c3ef126031728d13241c97f4a475df36f87ca..d6e8a23ca9efde14142847ccbeaff36e19054acd 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -2308,7 +2308,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
   FreeListNode* new_node = FindNodeFor(size_in_bytes, &new_node_size);
   if (new_node == NULL) return NULL;

-
   int bytes_left = new_node_size - size_in_bytes;
   ASSERT(bytes_left >= 0);

@@ -2318,9 +2317,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
   // if it is big enough.
   owner_->Free(owner_->top(), old_linear_size);

-  owner_->heap()->incremental_marking()->OldSpaceStep(
-      size_in_bytes - old_linear_size);
-
 #ifdef DEBUG
   for (int i = 0; i < size_in_bytes / kPointerSize; i++) {
     reinterpret_cast<Object**>(new_node->address())[i] =
@@ -2361,6 +2357,9 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
     owner_->SetTop(NULL, NULL);
   }

+  owner_->heap()->incremental_marking()->OldSpaceStep(
+      size_in_bytes - old_linear_size);
+
   return new_node;
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to