Chromium Code Reviews| Index: src/heap/heap.h |
| diff --git a/src/heap/heap.h b/src/heap/heap.h |
| index 58be0a23f3eba311852d616b4fcee8ae4c74f8ad..fa82cb0ff2b5848ab15a8d3bc76648f4c72d01c2 100644 |
| --- a/src/heap/heap.h |
| +++ b/src/heap/heap.h |
| @@ -1298,6 +1298,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); |
| @@ -2154,6 +2167,10 @@ class Heap { |
| // These two counters are monotomically increasing and never reset. |
| size_t full_codegen_bytes_generated_; |
| size_t crankshaft_codegen_bytes_generated_; |
|
Hannes Payer (out of office)
2015/05/12 17:04:17
newline
ulan
2015/05/18 12:45:51
Done.
|
| + // 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 |