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

Unified Diff: src/api.cc

Issue 1271253002: [GC] Change behavior when reaching external allocation limit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added TODO Created 5 years, 4 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 | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 586fd8613a5a4b9dcaa5b47bfa4d56e65d804c7b..6a7af4f1c2d1d904bd55cde00b7828c15db9f0ce 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6884,8 +6884,20 @@ Local<Integer> v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) {
void Isolate::CollectAllGarbage(const char* gc_reason) {
- reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
- i::Heap::kNoGCFlags, gc_reason, v8::kGCCallbackFlagForced);
+ i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
+ if (heap->incremental_marking()->IsStopped()) {
+ heap->StartIncrementalMarking(i::Heap::kNoGCFlags, kGCCallbackFlagForced,
+ gc_reason);
+ }
+ // TODO(mlippautz): Compute the time slice for incremental marking based on
+ // memory pressure.
+ double deadline = heap->MonotonicallyIncreasingTimeInMs() +
+ i::FLAG_external_allocation_limit_incremental_time;
+ heap->AdvanceIncrementalMarking(0, deadline,
+ i::IncrementalMarking::StepActions(
+ i::IncrementalMarking::GC_VIA_STACK_GUARD,
+ i::IncrementalMarking::FORCE_MARKING,
+ i::IncrementalMarking::FORCE_COMPLETION));
}
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698