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

Unified Diff: src/heap/heap.h

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/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 4535bbb2cb08b4139e10b6a83cf97c92b2c57332..8b41fb7b2647295544c9eb1cf766b36972bbe979 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1312,6 +1312,19 @@ class Heap {
}
}
+ void UpdateNewSpaceAllocationCounter() {
+ new_space_allocation_counter_ = NewSpaceAllocationCounter();
+ }
+
+ size_t NewSpaceAllocationCounter() {
+ return new_space_allocation_counter_ + new_space()->AllocatedSinceLastGC();
+ }
+
+ // This should be used only for testing.
+ void set_new_space_allocation_counter(size_t new_value) {
+ new_space_allocation_counter_ = new_value;
+ }
+
// Update GC statistics that are tracked on the Heap.
void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator,
double marking_time);
@@ -2182,6 +2195,11 @@ class Heap {
size_t full_codegen_bytes_generated_;
size_t crankshaft_codegen_bytes_generated_;
+ // This counter is increased before each GC and never reset.
+ // To account for the bytes allocated since the last GC, use the
+ // NewSpaceAllocationCounter() function.
+ size_t new_space_allocation_counter_;
+
// 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