Commit 87b2f018 authored by ulan@chromium.org's avatar ulan@chromium.org

Revert "Make more GCs in idle notification handler." because of performance

regression.

R=jkummerow@chromium.org
BUG=246141

Review URL: https://chromiumcodereview.appspot.com/15864010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14974 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c6519a14
...@@ -151,6 +151,7 @@ Heap::Heap() ...@@ -151,6 +151,7 @@ Heap::Heap()
last_idle_notification_gc_count_(0), last_idle_notification_gc_count_(0),
last_idle_notification_gc_count_init_(false), last_idle_notification_gc_count_init_(false),
mark_sweeps_since_idle_round_started_(0), mark_sweeps_since_idle_round_started_(0),
ms_count_at_last_idle_notification_(0),
gc_count_at_last_idle_gc_(0), gc_count_at_last_idle_gc_(0),
scavenges_since_last_idle_round_(kIdleScavengeThreshold), scavenges_since_last_idle_round_(kIdleScavengeThreshold),
gcs_since_last_deopt_(0), gcs_since_last_deopt_(0),
...@@ -5707,7 +5708,6 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { ...@@ -5707,7 +5708,6 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
uncommit = true; uncommit = true;
} }
CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental"); CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
mark_sweeps_since_idle_round_started_++;
gc_count_at_last_idle_gc_ = gc_count_; gc_count_at_last_idle_gc_ = gc_count_;
if (uncommit) { if (uncommit) {
new_space_.Shrink(); new_space_.Shrink();
...@@ -5783,9 +5783,18 @@ bool Heap::IdleNotification(int hint) { ...@@ -5783,9 +5783,18 @@ bool Heap::IdleNotification(int hint) {
} }
} }
int new_mark_sweeps = ms_count_ - ms_count_at_last_idle_notification_;
mark_sweeps_since_idle_round_started_ += new_mark_sweeps;
ms_count_at_last_idle_notification_ = ms_count_;
int remaining_mark_sweeps = kMaxMarkSweepsInIdleRound - int remaining_mark_sweeps = kMaxMarkSweepsInIdleRound -
mark_sweeps_since_idle_round_started_; mark_sweeps_since_idle_round_started_;
if (remaining_mark_sweeps <= 0) {
FinishIdleRound();
return true;
}
if (incremental_marking()->IsStopped()) { if (incremental_marking()->IsStopped()) {
// If there are no more than two GCs left in this idle round and we are // If there are no more than two GCs left in this idle round and we are
// allowed to do a full GC, then make those GCs full in order to compact // allowed to do a full GC, then make those GCs full in order to compact
...@@ -5795,7 +5804,6 @@ bool Heap::IdleNotification(int hint) { ...@@ -5795,7 +5804,6 @@ bool Heap::IdleNotification(int hint) {
if (remaining_mark_sweeps <= 2 && hint >= kMinHintForFullGC) { if (remaining_mark_sweeps <= 2 && hint >= kMinHintForFullGC) {
CollectAllGarbage(kReduceMemoryFootprintMask, CollectAllGarbage(kReduceMemoryFootprintMask,
"idle notification: finalize idle round"); "idle notification: finalize idle round");
mark_sweeps_since_idle_round_started_++;
} else { } else {
incremental_marking()->Start(); incremental_marking()->Start();
} }
...@@ -5803,12 +5811,6 @@ bool Heap::IdleNotification(int hint) { ...@@ -5803,12 +5811,6 @@ bool Heap::IdleNotification(int hint) {
if (!incremental_marking()->IsStopped()) { if (!incremental_marking()->IsStopped()) {
AdvanceIdleIncrementalMarking(step_size); AdvanceIdleIncrementalMarking(step_size);
} }
if (mark_sweeps_since_idle_round_started_ >= kMaxMarkSweepsInIdleRound) {
FinishIdleRound();
return true;
}
return false; return false;
} }
......
...@@ -2261,6 +2261,7 @@ class Heap { ...@@ -2261,6 +2261,7 @@ class Heap {
void StartIdleRound() { void StartIdleRound() {
mark_sweeps_since_idle_round_started_ = 0; mark_sweeps_since_idle_round_started_ = 0;
ms_count_at_last_idle_notification_ = ms_count_;
} }
void FinishIdleRound() { void FinishIdleRound() {
...@@ -2337,6 +2338,7 @@ class Heap { ...@@ -2337,6 +2338,7 @@ class Heap {
bool last_idle_notification_gc_count_init_; bool last_idle_notification_gc_count_init_;
int mark_sweeps_since_idle_round_started_; int mark_sweeps_since_idle_round_started_;
int ms_count_at_last_idle_notification_;
unsigned int gc_count_at_last_idle_gc_; unsigned int gc_count_at_last_idle_gc_;
int scavenges_since_last_idle_round_; int scavenges_since_last_idle_round_;
......
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