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

Unified Diff: src/compiler/zone-pool.cc

Issue 669053002: [turbofan] split compilation stats off from HStatistics and track high water marks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/zone-pool.cc
diff --git a/src/compiler/zone-pool.cc b/src/compiler/zone-pool.cc
index 8276023522962e01762e0dd6e85b8ac0469391ab..179988d418f15a469b775a26a2d72065f2a4ad72 100644
--- a/src/compiler/zone-pool.cc
+++ b/src/compiler/zone-pool.cc
@@ -9,7 +9,9 @@ namespace internal {
namespace compiler {
ZonePool::StatsScope::StatsScope(ZonePool* zone_pool)
- : zone_pool_(zone_pool), max_allocated_bytes_(0) {
+ : zone_pool_(zone_pool),
+ total_allocated_bytes_at_start_(zone_pool->GetTotalAllocatedBytes()),
+ max_allocated_bytes_(0) {
zone_pool_->stats_.push_back(this);
for (auto zone : zone_pool_->used_) {
size_t size = static_cast<size_t>(zone->allocation_size());
@@ -46,6 +48,11 @@ size_t ZonePool::StatsScope::GetCurrentAllocatedBytes() {
}
+size_t ZonePool::StatsScope::GetTotalAllocatedBytes() {
+ return zone_pool_->GetTotalAllocatedBytes() - total_allocated_bytes_at_start_;
+}
+
+
void ZonePool::StatsScope::ZoneReturned(Zone* zone) {
size_t current_total = GetCurrentAllocatedBytes();
// Update max.

Powered by Google App Engine
This is Rietveld 408576698