Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: src/compiler/zonestats.h

Issue 2348303002: Replaced different means of zone pooling/reusing by one zone segment pool (Closed)
Patch Set: Merge branch 'zonesegpool' into onezonepool Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/zonestats.h
diff --git a/src/compiler/zone-pool.h b/src/compiler/zonestats.h
similarity index 71%
rename from src/compiler/zone-pool.h
rename to src/compiler/zonestats.h
index 7a3fe75468046285d9647bf2ba538bcbaa5a0dc4..0287f09abad390b41ca4ebcb23bb5fb13678a31e 100644
--- a/src/compiler/zone-pool.h
+++ b/src/compiler/zonestats.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_COMPILER_ZONE_POOL_H_
-#define V8_COMPILER_ZONE_POOL_H_
+#ifndef V8_COMPILER_zone_stats_H_
Michael Starzinger 2016/09/20 10:35:39 nit: All uppercase. Also, lets rename the file to
+#define V8_COMPILER_zone_stats_H_
#include <map>
#include <set>
@@ -15,32 +15,32 @@ namespace v8 {
namespace internal {
namespace compiler {
-class ZonePool final {
+class ZoneStats final {
public:
class Scope final {
public:
- explicit Scope(ZonePool* zone_pool)
- : zone_pool_(zone_pool), zone_(nullptr) {}
+ explicit Scope(ZoneStats* zone_stats)
+ : zone_stats_(zone_stats), zone_(nullptr) {}
~Scope() { Destroy(); }
Zone* zone() {
- if (zone_ == nullptr) zone_ = zone_pool_->NewEmptyZone();
+ if (zone_ == nullptr) zone_ = zone_stats_->NewEmptyZone();
return zone_;
}
void Destroy() {
- if (zone_ != nullptr) zone_pool_->ReturnZone(zone_);
+ if (zone_ != nullptr) zone_stats_->ReturnZone(zone_);
zone_ = nullptr;
}
private:
- ZonePool* const zone_pool_;
+ ZoneStats* const zone_stats_;
Zone* zone_;
DISALLOW_COPY_AND_ASSIGN(Scope);
};
class StatsScope final {
public:
- explicit StatsScope(ZonePool* zone_pool);
+ explicit StatsScope(ZoneStats* zone_stats);
~StatsScope();
size_t GetMaxAllocatedBytes();
@@ -48,12 +48,12 @@ class ZonePool final {
size_t GetTotalAllocatedBytes();
private:
- friend class ZonePool;
+ friend class ZoneStats;
void ZoneReturned(Zone* zone);
typedef std::map<Zone*, size_t> InitialValues;
- ZonePool* const zone_pool_;
+ ZoneStats* const zone_stats_;
InitialValues initial_values_;
size_t total_allocated_bytes_at_start_;
size_t max_allocated_bytes_;
@@ -61,8 +61,8 @@ class ZonePool final {
DISALLOW_COPY_AND_ASSIGN(StatsScope);
};
- explicit ZonePool(AccountingAllocator* allocator);
- ~ZonePool();
+ explicit ZoneStats(AccountingAllocator* allocator);
+ ~ZoneStats();
size_t GetMaxAllocatedBytes();
size_t GetTotalAllocatedBytes();
@@ -73,18 +73,16 @@ class ZonePool final {
void ReturnZone(Zone* zone);
static const size_t kMaxUnusedSize = 3;
- typedef std::vector<Zone*> Unused;
typedef std::vector<Zone*> Used;
typedef std::vector<StatsScope*> Stats;
- Unused unused_;
Used used_;
Stats stats_;
size_t max_allocated_bytes_;
size_t total_deleted_bytes_;
AccountingAllocator* allocator_;
- DISALLOW_COPY_AND_ASSIGN(ZonePool);
+ DISALLOW_COPY_AND_ASSIGN(ZoneStats);
};
} // namespace compiler
« no previous file with comments | « src/compiler/zone-pool.cc ('k') | src/compiler/zonestats.cc » ('j') | src/compiler/zonestats.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698