Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 586fd8613a5a4b9dcaa5b47bfa4d56e65d804c7b..53921f5bed20386235ada0403d8230e47e2e6282 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); |
+ using IM = i::IncrementalMarking; |
+ using Heap = i::Heap; |
jochen (gone - plz use gerrit)
2015/08/05 12:22:27
please don't use using.
Michael Lippautz
2015/08/05 12:55:58
Done.
|
+ double kIncrementalMarkingIntervalInMs = 3; |
Michael Lippautz
2015/08/05 12:08:26
keep local?
jochen (gone - plz use gerrit)
2015/08/05 12:22:27
maybe make it a flag?
Hannes Payer (out of office)
2015/08/05 12:39:36
I would prefer 1 instead of 3. The smaller the bet
Michael Lippautz
2015/08/05 12:55:58
1ms it is. Works on N9.
Agree that it would be b
Michael Lippautz
2015/08/05 12:55:58
Done.
|
+ |
+ Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); |
+ if (heap->incremental_marking()->IsStopped()) { |
+ heap->StartIncrementalMarking(Heap::kNoGCFlags, kGCCallbackFlagForced, |
+ gc_reason); |
+ } |
+ double deadline = |
+ heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingIntervalInMs; |
+ heap->AdvanceIncrementalMarking( |
+ 0, deadline, IM::StepActions(IM::GC_VIA_STACK_GUARD, IM::FORCE_MARKING, |
+ IM::FORCE_COMPLETION)); |
} |