Reviewers: Hannes Payer,
Message:
Committed patchset #1 manually as 23304 (tree was closed).
Description:
Revert "Add finalize sweeping event to GCIdleTimeHandler."
This reverts r23302.
[email protected]
Committed: https://code.google.com/p/v8/source/detail?r=23304
Please review this at https://codereview.chromium.org/500483002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+17, -33 lines):
M src/heap/gc-idle-time-handler.h
M src/heap/gc-idle-time-handler.cc
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
e5ed823ce3ced1b1e724a938c71018be326d7c45..90f916e2f45a025b056eee843de8d6de4556d7c2
100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -10,6 +10,7 @@ namespace v8 {
namespace internal {
const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
+const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000000;
size_t GCIdleTimeHandler::EstimateMarkingStepSize(
@@ -29,7 +30,8 @@ size_t GCIdleTimeHandler::EstimateMarkingStepSize(
if (marking_step_size > kMaximumMarkingStepSize)
return kMaximumMarkingStepSize;
- return static_cast<size_t>(marking_step_size * kConservativeTimeRatio);
+ return static_cast<size_t>(marking_step_size *
+ GCIdleTimeHandler::kConservativeTimeRatio);
}
@@ -43,7 +45,7 @@ size_t GCIdleTimeHandler::EstimateMarkCompactTime(
}
-GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
+GCIdleTimeAction GCIdleTimeHandler::Compute(int idle_time_in_ms,
HeapState heap_state,
GCTracer* gc_tracer) {
if (IsIdleRoundFinished()) {
@@ -56,8 +58,8 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t
idle_time_in_ms,
if (heap_state.incremental_marking_stopped) {
size_t speed =
static_cast<size_t>(gc_tracer->MarkCompactSpeedInBytesPerMillisecond());
- if (idle_time_in_ms >=
- EstimateMarkCompactTime(heap_state.size_of_objects, speed)) {
+ if (idle_time_in_ms >= static_cast<int>(EstimateMarkCompactTime(
+ heap_state.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.
@@ -74,12 +76,6 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t
idle_time_in_ms,
return GCIdleTimeAction::Nothing();
}
}
- // TODO(hpayer): Estimate finalize sweeping time.
- if (heap_state.sweeping_in_progress &&
- idle_time_in_ms >= kMinTimeForFinalizeSweeping) {
- return GCIdleTimeAction::FinalizeSweeping();
- }
-
intptr_t speed =
gc_tracer->IncrementalMarkingSpeedInBytesPerMillisecond();
size_t step_size =
static_cast<size_t>(EstimateMarkingStepSize(idle_time_in_ms, speed));
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
bc196ce93a181e15dce8817a651ec00a9bae42f3..5a842a85971f42823edc93cba4ca754c408f656a
100644
--- a/src/heap/gc-idle-time-handler.h
+++ b/src/heap/gc-idle-time-handler.h
@@ -14,8 +14,7 @@ enum GCIdleTimeActionType {
DO_NOTHING,
DO_INCREMENTAL_MARKING,
DO_SCAVENGE,
- DO_FULL_GC,
- DO_FINALIZE_SWEEPING
+ DO_FULL_GC
};
@@ -27,21 +26,18 @@ class GCIdleTimeAction {
result.parameter = 0;
return result;
}
-
static GCIdleTimeAction IncrementalMarking(intptr_t step_size) {
GCIdleTimeAction result;
result.type = DO_INCREMENTAL_MARKING;
result.parameter = step_size;
return result;
}
-
static GCIdleTimeAction Scavenge() {
GCIdleTimeAction result;
result.type = DO_SCAVENGE;
result.parameter = 0;
return result;
}
-
static GCIdleTimeAction FullGC() {
GCIdleTimeAction result;
result.type = DO_FULL_GC;
@@ -49,13 +45,6 @@ class GCIdleTimeAction {
return result;
}
- static GCIdleTimeAction FinalizeSweeping() {
- GCIdleTimeAction result;
- result.type = DO_FINALIZE_SWEEPING;
- result.parameter = 0;
- return result;
- }
-
GCIdleTimeActionType type;
intptr_t parameter;
};
@@ -83,25 +72,20 @@ class GCIdleTimeHandler {
static const size_t kInitialConservativeMarkCompactSpeed = 2 * MB;
// Maximum mark-compact time returned by EstimateMarkCompactTime.
- static const size_t kMaxMarkCompactTimeInMs = 1000000;
-
- // Minimum time to finalize sweeping phase. The main thread may wait for
- // sweeper threads.
- static const size_t kMinTimeForFinalizeSweeping = 100;
+ static const size_t kMaxMarkCompactTimeInMs;
struct HeapState {
int contexts_disposed;
size_t size_of_objects;
bool incremental_marking_stopped;
bool can_start_incremental_marking;
- bool sweeping_in_progress;
};
GCIdleTimeHandler()
: mark_compacts_since_idle_round_started_(0),
scavenges_since_last_idle_round_(0) {}
- GCIdleTimeAction Compute(size_t idle_time_in_ms, HeapState heap_state,
+ GCIdleTimeAction Compute(int idle_time_in_ms, HeapState heap_state,
GCTracer* gc_tracer);
void NotifyIdleMarkCompact() {
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index
a29b767c41a5b7ded1f26a78fd62fe49d291e345..f3f539d78153c120a75ac43478f9766f5d6c0ff4
100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4296,8 +4296,6 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
heap_state.incremental_marking_stopped =
incremental_marking()->IsStopped();
// TODO(ulan): Start incremental marking only for large heaps.
heap_state.can_start_incremental_marking = true;
- heap_state.sweeping_in_progress =
- mark_compact_collector()->sweeping_in_progress();
GCIdleTimeAction action =
gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state, tracer());
@@ -4323,12 +4321,18 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
case DO_SCAVENGE:
CollectGarbage(NEW_SPACE, "idle notification: scavenge");
break;
- case DO_FINALIZE_SWEEPING:
- mark_compact_collector()->EnsureSweepingCompleted();
case DO_NOTHING:
result = true;
break;
}
+ // If the IdleNotifcation is called with a large hint we will wait for
+ // the sweepter threads here.
+ // TODO(ulan): move this in GCIdleTimeHandler.
+ const int kMinHintForFullGC = 100;
+ if (idle_time_in_ms >= kMinHintForFullGC &&
+ mark_compact_collector()->sweeping_in_progress()) {
+ mark_compact_collector()->EnsureSweepingCompleted();
+ }
return result;
}
--
--
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.