Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Unified Diff: src/incremental-marking.cc

Issue 14634007: Perform incremental marking step after free-list allocation and clean-up incremental marking start … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/incremental-marking.h ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index 7aadd279dc6d4f739f2642515acbdb2e9673eb14..bacbb93ad2e8cb6a335c577e8ccf69ade8c82d63 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 safe 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;
}
@@ -561,7 +567,7 @@ void IncrementalMarking::UncommitMarkingDeque() {
}
-void IncrementalMarking::Start() {
+void IncrementalMarking::Start(CompactionFlag flag) {
if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Start\n");
}
@@ -575,7 +581,7 @@ void IncrementalMarking::Start() {
ResetStepCounters();
if (heap_->IsSweepingComplete()) {
- StartMarking(ALLOW_COMPACTION);
+ StartMarking(flag);
} else {
if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Start sweeping.\n");
@@ -866,17 +872,9 @@ 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();
+ // TODO(hpayer): Let's play safe for now, but compaction should be
+ // in principle possible.
+ Start(PREVENT_COMPACTION);
} else {
Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD);
}
« no previous file with comments | « src/incremental-marking.h ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698