Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: src/heap/heap.cc

Issue 1125193005: Make new space allocation throughput estimation more accurate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 62c3821ed7cf55af13546032cf2ba46db862c722..e801ff94cfb3ab9f4593712a68c62960a6748f3f 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -141,6 +141,7 @@ Heap::Heap()
gc_count_at_last_idle_gc_(0),
full_codegen_bytes_generated_(0),
crankshaft_codegen_bytes_generated_(0),
+ new_space_allocation_counter_(0),
gcs_since_last_deopt_(0),
allocation_sites_scratchpad_length_(0),
promotion_queue_(this),
@@ -461,6 +462,7 @@ void Heap::GarbageCollectionPrologue() {
maximum_size_scavenges_ = 0;
}
CheckNewSpaceExpansionCriteria();
+ UpdateNewSpaceAllocationCounter();
}
@@ -4620,8 +4622,7 @@ GCIdleTimeHandler::HeapState Heap::ComputeHeapState(bool reduce_memory) {
heap_state.used_new_space_size = new_space_.Size();
heap_state.new_space_capacity = new_space_.Capacity();
heap_state.new_space_allocation_throughput_in_bytes_per_ms =
- static_cast<size_t>(
- tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond());
+ tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond();
return heap_state;
}
@@ -4774,6 +4775,10 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
GCIdleTimeHandler::kMaxFrameRenderingIdleTime;
bool has_low_gc_activity = (start_ms - last_gc_time_) > kLastGCTimeTreshold;
+ if (is_long_idle_notification) {
+ tracer()->SampleNewSpaceAllocation(start_ms, NewSpaceAllocationCounter());
+ }
+
GCIdleTimeHandler::HeapState heap_state =
ComputeHeapState(is_long_idle_notification && has_low_gc_activity);
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698