5 #ifndef V8_COMPILATION_STATISTICS_H_ 6 #define V8_COMPILATION_STATISTICS_H_ 11 #include "src/allocation.h" 12 #include "src/base/platform/time.h" 17 class OptimizedCompilationInfo;
18 class CompilationStatistics;
22 const bool machine_output;
32 : total_allocated_bytes_(0),
33 max_allocated_bytes_(0),
34 absolute_max_allocated_bytes_(0) {}
39 size_t total_allocated_bytes_;
40 size_t max_allocated_bytes_;
41 size_t absolute_max_allocated_bytes_;
42 std::string function_name_;
45 void RecordPhaseStats(
const char* phase_kind_name,
const char* phase_name,
48 void RecordPhaseKindStats(
const char* phase_kind_name,
51 void RecordTotalStats(
size_t source_size,
const BasicStats& stats);
56 TotalStats() : source_size_(0) {}
57 uint64_t source_size_;
60 class OrderedStats :
public BasicStats {
62 explicit OrderedStats(
size_t insert_order) : insert_order_(insert_order) {}
66 class PhaseStats :
public OrderedStats {
68 PhaseStats(
size_t insert_order,
const char* phase_kind_name)
69 : OrderedStats(insert_order), phase_kind_name_(phase_kind_name) {}
70 std::string phase_kind_name_;
73 friend std::ostream& operator<<(std::ostream& os,
74 const AsPrintableStatistics& s);
76 typedef OrderedStats PhaseKindStats;
77 typedef std::map<std::string, PhaseKindStats> PhaseKindMap;
78 typedef std::map<std::string, PhaseStats> PhaseMap;
80 TotalStats total_stats_;
81 PhaseKindMap phase_kind_map_;
83 base::Mutex record_mutex_;
85 DISALLOW_COPY_AND_ASSIGN(CompilationStatistics);
88 std::ostream& operator<<(std::ostream& os,
const AsPrintableStatistics& s);
93 #endif // V8_COMPILATION_STATISTICS_H_