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

Unified Diff: src/heap.cc

Issue 9841001: Abort incremental marking on idle notification after context disposal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index d2986682782a71303c9d1060315ef2e57afb2150..8dcf4887a2079386d73d9f822cb06e80ab05af4b 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4838,7 +4838,8 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
bool Heap::IdleNotification(int hint) {
- intptr_t size_factor = Min(Max(hint, 30), 1000) / 10;
+ const int kMaxHint = 1000;
+ intptr_t size_factor = Min(Max(hint, 30), kMaxHint) / 10;
// The size factor is in range [3..100].
intptr_t step_size = size_factor * IncrementalMarking::kAllocatedThreshold;
@@ -4846,8 +4847,16 @@ bool Heap::IdleNotification(int hint) {
int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000);
if (hint >= mark_sweep_time && !FLAG_expose_gc) {
HistogramTimerScope scope(isolate_->counters()->gc_context());
- CollectAllGarbage(kReduceMemoryFootprintMask,
- "idle notification: contexts disposed");
+ if (hint >= kMaxHint) {
+ // The embedder can tolerate long pauses, do precise GC.
+ CollectAllGarbage(kReduceMemoryFootprintMask |
+ kAbortIncrementalMarkingMask,
+ "idle notification: contexts disposed"
+ " (abort incremental marking)");
+ } else {
+ CollectAllGarbage(kReduceMemoryFootprintMask,
+ "idle notification: contexts disposed");
+ }
} else {
AdvanceIdleIncrementalMarking(step_size);
contexts_disposed_ = 0;
@@ -4859,7 +4868,7 @@ bool Heap::IdleNotification(int hint) {
return false;
}
- if (hint >= 1000 || !FLAG_incremental_marking ||
+ if (hint >= kMaxHint || !FLAG_incremental_marking ||
FLAG_expose_gc || Serializer::enabled()) {
return IdleGlobalGC();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698