store_buffer_(this),
marking_(this),
incremental_marking_(this),
- gc_count_at_last_idle_gc_(0),
full_codegen_bytes_generated_(0),
crankshaft_codegen_bytes_generated_(0),
new_space_allocation_counter_(0),
bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
GCIdleTimeHandler::HeapState heap_state,
- double deadline_in_ms,
- bool is_long_idle_notification) {
+ double deadline_in_ms) {
bool result = false;
switch (action.type) {
case DONE:
break;
}
case DO_FULL_GC: {
- if (is_long_idle_notification && gc_count_at_last_idle_gc_ == gc_count_) {
+ if (action.reduce_memory) {
isolate_->compilation_cache()->Clear();
}
if (contexts_disposed_) {
CollectAllGarbage(kReduceMemoryFootprintMask,
"idle notification: finalize idle round");
}
- gc_count_at_last_idle_gc_ = gc_count_;
gc_idle_time_handler_.NotifyIdleMarkCompact();
break;
}
void Heap::IdleNotificationEpilogue(GCIdleTimeAction action,
GCIdleTimeHandler::HeapState heap_state,
- double start_ms, double deadline_in_ms,
- bool is_long_idle_notification) {
+ double start_ms, double deadline_in_ms) {
double idle_time_in_ms = deadline_in_ms - start_ms;
double current_time = MonotonicallyIncreasingTimeInMs();
last_idle_notification_time_ = current_time;
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
static_cast<int>(idle_time_in_ms));
- if (is_long_idle_notification) {
- int committed_memory = static_cast<int>(CommittedMemory() / KB);
- int used_memory = static_cast<int>(heap_state.size_of_objects / KB);
- isolate()->counters()->aggregated_memory_heap_committed()->AddSample(
- start_ms, committed_memory);
- isolate()->counters()->aggregated_memory_heap_used()->AddSample(
- start_ms, used_memory);
- }
-
if (deadline_difference >= 0) {
if (action.type != DONE && action.type != DO_NOTHING) {
isolate()->counters()->gc_idle_time_limit_undershot()->AddSample(
isolate_->counters()->gc_idle_notification());
double start_ms = MonotonicallyIncreasingTimeInMs();
double idle_time_in_ms = deadline_in_ms - start_ms;
- bool is_long_idle_notification =
- static_cast<size_t>(idle_time_in_ms) >
- GCIdleTimeHandler::kMaxFrameRenderingIdleTime;
- if (is_long_idle_notification) {
- tracer()->SampleAllocation(start_ms, NewSpaceAllocationCounter(),
- OldGenerationAllocationCounter());
- }
+ tracer()->SampleAllocation(start_ms, NewSpaceAllocationCounter(),
+ OldGenerationAllocationCounter());
GCIdleTimeHandler::HeapState heap_state = ComputeHeapState();
GCIdleTimeAction action =
gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);
- bool result = PerformIdleTimeAction(action, heap_state, deadline_in_ms,
- is_long_idle_notification);
+ bool result = PerformIdleTimeAction(action, heap_state, deadline_in_ms);
- IdleNotificationEpilogue(action, heap_state, start_ms, deadline_in_ms,
- is_long_idle_notification);
+ IdleNotificationEpilogue(action, heap_state, start_ms, deadline_in_ms);
return result;
}
bool PerformIdleTimeAction(GCIdleTimeAction action,
GCIdleTimeHandler::HeapState heap_state,
- double deadline_in_ms,
- bool is_long_idle_notification);
+ double deadline_in_ms);
void IdleNotificationEpilogue(GCIdleTimeAction action,
GCIdleTimeHandler::HeapState heap_state,
- double start_ms, double deadline_in_ms,
- bool is_long_idle_notification);
+ double start_ms, double deadline_in_ms);
void ClearObjectStats(bool clear_last_time_stats = false);
GCIdleTimeHandler gc_idle_time_handler_;
- unsigned int gc_count_at_last_idle_gc_;
-
// These two counters are monotomically increasing and never reset.
size_t full_codegen_bytes_generated_;
size_t crankshaft_codegen_bytes_generated_;