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

Unified Diff: src/heap/heap.cc

Issue 1154873003: Add old generation allocation throughput computation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix CE 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') | test/cctest/test-heap.cc » ('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 09f4cc71278e39c57be57099f4c08aedcef34cbd..91741882049c69cdce4a56956ded9e905506773e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -142,6 +142,8 @@ Heap::Heap()
full_codegen_bytes_generated_(0),
crankshaft_codegen_bytes_generated_(0),
new_space_allocation_counter_(0),
+ old_generation_allocation_counter_(0),
+ old_generation_size_at_last_gc_(0),
gcs_since_last_deopt_(0),
allocation_sites_scratchpad_length_(0),
promotion_queue_(this),
@@ -467,6 +469,7 @@ void Heap::GarbageCollectionPrologue() {
}
CheckNewSpaceExpansionCriteria();
UpdateNewSpaceAllocationCounter();
+ UpdateOldGenerationAllocationCounter();
}
@@ -735,7 +738,7 @@ void Heap::GarbageCollectionEpilogue() {
last_gc_time_ = MonotonicallyIncreasingTimeInMs();
ReduceNewSpaceSize(
- tracer()->CurrentNewSpaceAllocationThroughputInBytesPerMillisecond());
+ tracer()->CurrentAllocationThroughputInBytesPerMillisecond());
}
@@ -1223,6 +1226,10 @@ bool Heap::PerformGarbageCollection(
Scavenge();
}
+ // This should be updated before PostGarbageCollectionProcessing, which can
+ // cause another GC.
+ old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects();
+
UpdateSurvivalStatistics(start_new_space_size);
ConfigureInitialOldGenerationSize();
@@ -4626,11 +4633,11 @@ GCIdleTimeHandler::HeapState Heap::ComputeHeapState() {
heap_state.new_space_capacity = new_space_.Capacity();
heap_state.new_space_allocation_throughput_in_bytes_per_ms =
tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond();
- heap_state.current_new_space_allocation_throughput_in_bytes_per_ms =
- tracer()->CurrentNewSpaceAllocationThroughputInBytesPerMillisecond();
+ heap_state.current_allocation_throughput_in_bytes_per_ms =
+ tracer()->CurrentAllocationThroughputInBytesPerMillisecond();
intptr_t limit = old_generation_allocation_limit_;
if (HasLowAllocationRate(
- heap_state.current_new_space_allocation_throughput_in_bytes_per_ms)) {
+ heap_state.current_allocation_throughput_in_bytes_per_ms)) {
limit = idle_old_generation_allocation_limit_;
}
heap_state.can_start_incremental_marking =
@@ -4784,7 +4791,8 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
GCIdleTimeHandler::kMaxFrameRenderingIdleTime;
if (is_long_idle_notification) {
- tracer()->SampleNewSpaceAllocation(start_ms, NewSpaceAllocationCounter());
+ tracer()->SampleAllocation(start_ms, NewSpaceAllocationCounter(),
+ OldGenerationAllocationCounter());
}
GCIdleTimeHandler::HeapState heap_state = ComputeHeapState();
« no previous file with comments | « src/heap/heap.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698