OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILATION_STATISTICS_H_ | 5 #ifndef V8_COMPILATION_STATISTICS_H_ |
6 #define V8_COMPILATION_STATISTICS_H_ | 6 #define V8_COMPILATION_STATISTICS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "src/allocation.h" | 11 #include "src/allocation.h" |
12 #include "src/base/platform/time.h" | 12 #include "src/base/platform/time.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 class CompilationInfo; | 17 class CompilationInfo; |
18 | 18 |
19 class CompilationStatistics FINAL : public Malloced { | 19 class CompilationStatistics FINAL : public Malloced { |
20 public: | 20 public: |
21 CompilationStatistics() {} | 21 CompilationStatistics() {} |
22 | 22 |
23 class BasicStats { | 23 class BasicStats { |
24 public: | 24 public: |
25 BasicStats() : total_allocated_bytes_(0), max_allocated_bytes_(0) {} | 25 BasicStats() |
| 26 : total_allocated_bytes_(0), |
| 27 max_allocated_bytes_(0), |
| 28 absolute_max_allocated_bytes_(0) {} |
26 | 29 |
27 void Accumulate(const BasicStats& stats); | 30 void Accumulate(const BasicStats& stats); |
28 | 31 |
29 base::TimeDelta delta_; | 32 base::TimeDelta delta_; |
30 size_t total_allocated_bytes_; | 33 size_t total_allocated_bytes_; |
31 size_t max_allocated_bytes_; | 34 size_t max_allocated_bytes_; |
| 35 size_t absolute_max_allocated_bytes_; |
32 std::string function_name_; | 36 std::string function_name_; |
33 }; | 37 }; |
34 | 38 |
35 void RecordPhaseStats(const char* phase_kind_name, const char* phase_name, | 39 void RecordPhaseStats(const char* phase_kind_name, const char* phase_name, |
36 const BasicStats& stats); | 40 const BasicStats& stats); |
37 | 41 |
38 void RecordPhaseKindStats(const char* phase_kind_name, | 42 void RecordPhaseKindStats(const char* phase_kind_name, |
39 const BasicStats& stats); | 43 const BasicStats& stats); |
40 | 44 |
41 void RecordTotalStats(size_t source_size, const BasicStats& stats); | 45 void RecordTotalStats(size_t source_size, const BasicStats& stats); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 77 |
74 DISALLOW_COPY_AND_ASSIGN(CompilationStatistics); | 78 DISALLOW_COPY_AND_ASSIGN(CompilationStatistics); |
75 }; | 79 }; |
76 | 80 |
77 std::ostream& operator<<(std::ostream& os, const CompilationStatistics& s); | 81 std::ostream& operator<<(std::ostream& os, const CompilationStatistics& s); |
78 | 82 |
79 } // namespace internal | 83 } // namespace internal |
80 } // namespace v8 | 84 } // namespace v8 |
81 | 85 |
82 #endif | 86 #endif |
OLD | NEW |