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

Unified Diff: src/heap/heap.cc

Issue 677043002: Flush code faster when doing emergency GCs. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change ReleaseUnoptimizedCode test to a harder test that fails without this CL Created 6 years, 2 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/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 38e4971f4aa55933194c8a4053f3b07a9185d438..9a99f9bcd73edca7d99cc828b4bc139936a4a097 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -96,6 +96,7 @@ Heap::Heap()
#ifdef DEBUG
allocation_timeout_(0),
#endif // DEBUG
+ flush_eagerly_(false),
old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit),
old_gen_exhausted_(false),
inline_allocation_disabled_(false),
@@ -736,7 +737,7 @@ void Heap::CollectAllGarbage(int flags, const char* gc_reason,
}
-void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
+void Heap::CollectAllAvailableGarbage(const char* gc_reason, int max_attempts) {
// Since we are ignoring the return value, the exact choice of space does
// not matter, so long as we do not specify NEW_SPACE, which would not
// cause a full GC.
@@ -756,9 +757,9 @@ void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
mark_compact_collector()->SetFlags(kMakeHeapIterableMask |
kReduceMemoryFootprintMask);
isolate_->compilation_cache()->Clear();
- const int kMaxNumberOfAttempts = 7;
const int kMinNumberOfAttempts = 2;
- for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
+ FlushEagerly flush_eagerly_scope(this);
+ for (int attempt = 0; attempt < max_attempts; attempt++) {
if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL) &&
attempt + 1 >= kMinNumberOfAttempts) {
break;
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698