Index: src/compiler/zone-stats.h |
diff --git a/src/compiler/zone-stats.h b/src/compiler/zone-stats.h |
deleted file mode 100644 |
index 611c96ee668e83d4b484ea9c5d37a4ca6fbc3a39..0000000000000000000000000000000000000000 |
--- a/src/compiler/zone-stats.h |
+++ /dev/null |
@@ -1,92 +0,0 @@ |
-// Copyright 2014 the V8 project authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-#ifndef V8_COMPILER_ZONE_STATS_H_ |
-#define V8_COMPILER_ZONE_STATS_H_ |
- |
-#include <map> |
-#include <set> |
-#include <vector> |
- |
-#include "src/zone/zone.h" |
- |
-namespace v8 { |
-namespace internal { |
-namespace compiler { |
- |
-class ZoneStats final { |
- public: |
- class Scope final { |
- public: |
- explicit Scope(ZoneStats* zone_stats) |
- : zone_stats_(zone_stats), zone_(nullptr) {} |
- ~Scope() { Destroy(); } |
- |
- Zone* zone() { |
- if (zone_ == nullptr) zone_ = zone_stats_->NewEmptyZone(); |
- return zone_; |
- } |
- void Destroy() { |
- if (zone_ != nullptr) zone_stats_->ReturnZone(zone_); |
- zone_ = nullptr; |
- } |
- |
- private: |
- ZoneStats* const zone_stats_; |
- Zone* zone_; |
- DISALLOW_COPY_AND_ASSIGN(Scope); |
- }; |
- |
- class StatsScope final { |
- public: |
- explicit StatsScope(ZoneStats* zone_stats); |
- ~StatsScope(); |
- |
- size_t GetMaxAllocatedBytes(); |
- size_t GetCurrentAllocatedBytes(); |
- size_t GetTotalAllocatedBytes(); |
- |
- private: |
- friend class ZoneStats; |
- void ZoneReturned(Zone* zone); |
- |
- typedef std::map<Zone*, size_t> InitialValues; |
- |
- ZoneStats* const zone_stats_; |
- InitialValues initial_values_; |
- size_t total_allocated_bytes_at_start_; |
- size_t max_allocated_bytes_; |
- |
- DISALLOW_COPY_AND_ASSIGN(StatsScope); |
- }; |
- |
- explicit ZoneStats(AccountingAllocator* allocator); |
- ~ZoneStats(); |
- |
- size_t GetMaxAllocatedBytes(); |
- size_t GetTotalAllocatedBytes(); |
- size_t GetCurrentAllocatedBytes(); |
- |
- private: |
- Zone* NewEmptyZone(); |
- void ReturnZone(Zone* zone); |
- |
- static const size_t kMaxUnusedSize = 3; |
- typedef std::vector<Zone*> Zones; |
- typedef std::vector<StatsScope*> Stats; |
- |
- Zones zones_; |
- Stats stats_; |
- size_t max_allocated_bytes_; |
- size_t total_deleted_bytes_; |
- AccountingAllocator* allocator_; |
- |
- DISALLOW_COPY_AND_ASSIGN(ZoneStats); |
-}; |
- |
-} // namespace compiler |
-} // namespace internal |
-} // namespace v8 |
- |
-#endif // V8_COMPILER_ZONE_STATS_H_ |