Reviewers: ulan, Hannes Payer, Yang,
Message:
FYI
Description:
Revert "Start incremental marking in idle time handler only if it is
worthwhile."
This reverts commit r23285 for breaking cctest/test-api/Regress2107.
[email protected], [email protected], [email protected]
Please review this at https://codereview.chromium.org/494203002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+16, -38 lines):
M src/heap/gc-idle-time-handler.h
M src/heap/gc-idle-time-handler.cc
M src/heap/heap.h
M src/heap/heap.cc
Index: src/heap/gc-idle-time-handler.cc
diff --git a/src/heap/gc-idle-time-handler.cc
b/src/heap/gc-idle-time-handler.cc
index
90f916e2f45a025b056eee843de8d6de4556d7c2..a2e08b28c514e1c08c0c394a9100c8da6150897d
100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -46,20 +46,22 @@ size_t GCIdleTimeHandler::EstimateMarkCompactTime(
GCIdleTimeAction GCIdleTimeHandler::Compute(int idle_time_in_ms,
- HeapState heap_state,
+ int contexts_disposed,
+ size_t size_of_objects,
+ bool
incremental_marking_stopped,
GCTracer* gc_tracer) {
if (IsIdleRoundFinished()) {
- if (EnoughGarbageSinceLastIdleRound() || heap_state.contexts_disposed
0) {
+ if (EnoughGarbageSinceLastIdleRound() || contexts_disposed > 0) {
StartIdleRound();
} else {
return GCIdleTimeAction::Nothing();
}
}
- if (heap_state.incremental_marking_stopped) {
+ if (incremental_marking_stopped) {
size_t speed =
static_cast<size_t>(gc_tracer->MarkCompactSpeedInBytesPerMillisecond());
- if (idle_time_in_ms >= static_cast<int>(EstimateMarkCompactTime(
- heap_state.size_of_objects, speed))) {
+ if (idle_time_in_ms >=
+ static_cast<int>(EstimateMarkCompactTime(size_of_objects, speed)))
{
// 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
// the code space.
@@ -67,14 +69,10 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(int
idle_time_in_ms,
// can get rid of this special case and always start incremental
marking.
int remaining_mark_sweeps =
kMaxMarkCompactsInIdleRound -
mark_compacts_since_idle_round_started_;
- if (heap_state.contexts_disposed > 0 || remaining_mark_sweeps <= 2 ||
- !heap_state.can_start_incremental_marking) {
+ if (contexts_disposed > 0 || remaining_mark_sweeps <= 2) {
return GCIdleTimeAction::FullGC();
}
}
- if (!heap_state.can_start_incremental_marking) {
- return GCIdleTimeAction::Nothing();
- }
}
intptr_t speed =
gc_tracer->IncrementalMarkingSpeedInBytesPerMillisecond();
size_t step_size =
Index: src/heap/gc-idle-time-handler.h
diff --git a/src/heap/gc-idle-time-handler.h
b/src/heap/gc-idle-time-handler.h
index
5a842a85971f42823edc93cba4ca754c408f656a..76cdb9f21cd59d97fde49cc82382e73ffbd35427
100644
--- a/src/heap/gc-idle-time-handler.h
+++ b/src/heap/gc-idle-time-handler.h
@@ -49,7 +49,6 @@ class GCIdleTimeAction {
intptr_t parameter;
};
-
class GCTracer;
// The idle time handler makes decisions about which garbage collection
@@ -74,18 +73,13 @@ class GCIdleTimeHandler {
// Maximum mark-compact time returned by EstimateMarkCompactTime.
static const size_t kMaxMarkCompactTimeInMs;
- struct HeapState {
- int contexts_disposed;
- size_t size_of_objects;
- bool incremental_marking_stopped;
- bool can_start_incremental_marking;
- };
-
GCIdleTimeHandler()
: mark_compacts_since_idle_round_started_(0),
scavenges_since_last_idle_round_(0) {}
- GCIdleTimeAction Compute(int idle_time_in_ms, HeapState heap_state,
+ GCIdleTimeAction Compute(int idle_time_in_ms, int contexts_disposed,
+ size_t size_of_objects,
+ bool incremental_marking_stopped,
GCTracer* gc_tracer);
void NotifyIdleMarkCompact() {
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index
ae730374c605a1440fb88a32c4ccbab6cd51feac..c7e1de398e0eba1c7b238e19cdb06039fa7a6526
100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -845,7 +845,8 @@ bool Heap::CollectGarbage(GarbageCollector collector,
const char* gc_reason,
// Start incremental marking for the next cycle. The heap snapshot
// generator needs incremental marking to stay off after it aborted.
if (!mark_compact_collector()->abort_incremental_marking() &&
- WorthActivatingIncrementalMarking()) {
+ incremental_marking()->IsStopped() &&
+ incremental_marking()->WorthActivating() &&
NextGCIsLikelyToBeFull()) {
incremental_marking()->Start();
}
@@ -4276,12 +4277,6 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t
step_size) {
}
-bool Heap::WorthActivatingIncrementalMarking() {
- return incremental_marking()->IsStopped() &&
- incremental_marking()->WorthActivating() &&
NextGCIsLikelyToBeFull();
-}
-
-
bool Heap::IdleNotification(int idle_time_in_ms) {
// If incremental marking is off, we do not perform idle notification.
if (!FLAG_incremental_marking) return true;
@@ -4290,16 +4285,9 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
HistogramTimerScope idle_notification_scope(
isolate_->counters()->gc_idle_notification());
- GCIdleTimeHandler::HeapState heap_state;
- heap_state.contexts_disposed = contexts_disposed_;
- heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects());
- heap_state.incremental_marking_stopped =
incremental_marking()->IsStopped();
- heap_state.can_start_incremental_marking =
- WorthActivatingIncrementalMarking();
-
- GCIdleTimeAction action =
- gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state, tracer());
-
+ GCIdleTimeAction action = gc_idle_time_handler_.Compute(
+ idle_time_in_ms, contexts_disposed_,
static_cast<size_t>(SizeOfObjects()),
+ incremental_marking()->IsStopped(), tracer());
contexts_disposed_ = 0;
bool result = false;
switch (action.type) {
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index
1b56f257d49911fd46826ddc5e782fa9d68734c2..dacf916edcddcfab8603d70c63f0481163207df5
100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1929,8 +1929,6 @@ class Heap {
void AdvanceIdleIncrementalMarking(intptr_t step_size);
- bool WorthActivatingIncrementalMarking();
-
void ClearObjectStats(bool clear_last_time_stats = false);
void set_weak_object_to_code_table(Object* value) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.