Use v8::kGCCallbackFlagCollectAllAvailableGarbage in Heap::CollectAllAvailableGarbage

Now that the embedder side supports v8::kGCCallbackFlagCollectAllAvailableGarbage,
this CL removes the old v8::kGCCallbackFlagForced from Heap::CollectAllAvailableGarbage.

BUG=591463
LOG=Y

Review URL: https://codereview.chromium.org/1769893002

Cr-Commit-Position: refs/heads/master@{#34539}
This commit is contained in:
haraken 2016-03-07 05:05:35 -08:00 committed by Commit bot
parent c6dbb071a3
commit 9ff9592cb2
2 changed files with 4 additions and 3 deletions

View File

@ -984,7 +984,7 @@ int GlobalHandles::PostGarbageCollectionProcessing(
int freed_nodes = 0;
bool synchronous_second_pass =
(gc_callback_flags &
(kGCCallbackFlagForced |
(kGCCallbackFlagForced | kGCCallbackFlagCollectAllAvailableGarbage |
kGCCallbackFlagSynchronousPhantomCallbackProcessing)) != 0;
freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass);
if (initial_post_gc_processing_count != post_gc_processing_count_) {

View File

@ -895,7 +895,7 @@ void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
const int kMinNumberOfAttempts = 2;
for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL,
v8::kGCCallbackFlagForced) &&
v8::kGCCallbackFlagCollectAllAvailableGarbage) &&
attempt + 1 >= kMinNumberOfAttempts) {
break;
}
@ -1044,7 +1044,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
}
if (collector == MARK_COMPACTOR &&
(gc_callback_flags & kGCCallbackFlagForced) != 0) {
(gc_callback_flags & (kGCCallbackFlagForced |
kGCCallbackFlagCollectAllAvailableGarbage)) != 0) {
isolate()->CountUsage(v8::Isolate::kForcedGC);
}