Commit 5fa0b1a7 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[oilpan] Move CompleteSweep() to ScheduleGCIfNeeded() during allocation to play safe.

CompleteSweep() needs to be called before we call ReportMemoryToV8(). This change
makes this dependency more explicit.

Change-Id: I044af54bcfdc8a7457edbb492fba6bfe4ff210aa
Reviewed-on: https://chromium-review.googlesource.com/1069271Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560987}
parent 8d9c0f04
......@@ -564,8 +564,6 @@ void ThreadState::ScheduleGCIfNeeded() {
if (IsGCForbidden() || SweepForbidden())
return;
ReportMemoryToV8();
if (ShouldForceMemoryPressureGC()) {
CompleteSweep();
if (ShouldForceMemoryPressureGC()) {
......@@ -998,6 +996,8 @@ void ThreadState::PostSweep() {
DCHECK(CheckThread());
ThreadHeap::ReportMemoryUsageForTracing();
ReportMemoryToV8();
if (IsMainThread()) {
ThreadHeapStats& stats = heap_->HeapStats();
double collection_rate = 1.0 - stats.LiveObjectRateSinceLastGC();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment