5 #ifndef V8_COMPILER_ZONE_STATS_H_ 6 #define V8_COMPILER_ZONE_STATS_H_ 12 #include "src/globals.h" 13 #include "src/zone/zone.h" 24 : zone_name_(zone_name), zone_stats_(zone_stats), zone_(
nullptr) {}
25 ~
Scope() { Destroy(); }
28 if (zone_ ==
nullptr) zone_ = zone_stats_->NewEmptyZone(zone_name_);
32 if (zone_ !=
nullptr) zone_stats_->ReturnZone(zone_);
37 const char* zone_name_;
40 DISALLOW_COPY_AND_ASSIGN(
Scope);
48 size_t GetMaxAllocatedBytes();
49 size_t GetCurrentAllocatedBytes();
50 size_t GetTotalAllocatedBytes();
54 void ZoneReturned(
Zone* zone);
56 typedef std::map<Zone*, size_t> InitialValues;
59 InitialValues initial_values_;
60 size_t total_allocated_bytes_at_start_;
61 size_t max_allocated_bytes_;
69 size_t GetMaxAllocatedBytes()
const;
70 size_t GetTotalAllocatedBytes()
const;
71 size_t GetCurrentAllocatedBytes()
const;
74 Zone* NewEmptyZone(
const char* zone_name);
75 void ReturnZone(
Zone* zone);
77 static const size_t kMaxUnusedSize = 3;
78 typedef std::vector<Zone*> Zones;
79 typedef std::vector<StatsScope*> Stats;
83 size_t max_allocated_bytes_;
84 size_t total_deleted_bytes_;
94 #endif // V8_COMPILER_ZONE_STATS_H_