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

Unified Diff: src/heap/heap.h

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/gc-tracer.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index d398599f1d591faebe488d1adb56f6965c3422e3..94dcdff754bcf935378539d0517c53315028f0e4 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1325,6 +1325,23 @@ class Heap {
new_space_allocation_counter_ = new_value;
}
+ void UpdateOldGenerationAllocationCounter() {
+ old_generation_allocation_counter_ = OldGenerationAllocationCounter();
+ }
+
+ size_t OldGenerationAllocationCounter() {
+ return old_generation_allocation_counter_ + PromotedSinceLastGC();
+ }
+
+ // This should be used only for testing.
+ void set_old_generation_allocation_counter(size_t new_value) {
+ old_generation_allocation_counter_ = new_value;
+ }
+
+ size_t PromotedSinceLastGC() {
+ return PromotedSpaceSizeOfObjects() - old_generation_size_at_last_gc_;
+ }
+
// Update GC statistics that are tracked on the Heap.
void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator,
double marking_time);
@@ -2204,6 +2221,14 @@ class Heap {
// NewSpaceAllocationCounter() function.
size_t new_space_allocation_counter_;
+ // This counter is increased before each GC and never reset. To
+ // account for the bytes allocated since the last GC, use the
+ // OldGenerationAllocationCounter() function.
+ size_t old_generation_allocation_counter_;
+
+ // The size of objects in old generation after the last MarkCompact GC.
+ size_t old_generation_size_at_last_gc_;
+
// If the --deopt_every_n_garbage_collections flag is set to a positive value,
// this variable holds the number of garbage collections since the last
// deoptimization triggered by garbage collection.
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698