Revision: 24892
Author: [email protected]
Date: Mon Oct 27 08:58:55 2014 UTC
Log: [turbofan] add absolute peak to stats
[email protected]
BUG=
Review URL: https://codereview.chromium.org/676693002
https://code.google.com/p/v8/source/detail?r=24892
Modified:
/branches/bleeding_edge/src/compilation-statistics.cc
/branches/bleeding_edge/src/compilation-statistics.h
/branches/bleeding_edge/src/compiler/pipeline-statistics.cc
/branches/bleeding_edge/src/compiler/pipeline-statistics.h
/branches/bleeding_edge/src/compiler/pipeline.cc
=======================================
--- /branches/bleeding_edge/src/compilation-statistics.cc Thu Oct 23
11:19:44 2014 UTC
+++ /branches/bleeding_edge/src/compilation-statistics.cc Mon Oct 27
08:58:55 2014 UTC
@@ -47,7 +47,8 @@
void CompilationStatistics::BasicStats::Accumulate(const BasicStats&
stats) {
delta_ += stats.delta_;
total_allocated_bytes_ += stats.total_allocated_bytes_;
- if (stats.max_allocated_bytes_ > max_allocated_bytes_) {
+ if (stats.absolute_max_allocated_bytes_ > absolute_max_allocated_bytes_)
{
+ absolute_max_allocated_bytes_ = stats.absolute_max_allocated_bytes_;
max_allocated_bytes_ = stats.max_allocated_bytes_;
function_name_ = stats.function_name_;
}
@@ -66,9 +67,12 @@
static_cast<double>(stats.total_allocated_bytes_ * 100) /
static_cast<double>(total_stats.total_allocated_bytes_);
base::OS::SNPrintF(buffer, kBufferSize,
- "%28s %10.3f ms / %5.1f %% %10u total / %5.1f %% %10u
max",
+ "%28s %10.3f ms / %5.1f %%"
+ "%10u total / %5.1f %% "
+ "%10u max %10u abs_max",
name, ms, percent, stats.total_allocated_bytes_,
- size_percent, stats.max_allocated_bytes_);
+ size_percent, stats.max_allocated_bytes_,
+ stats.absolute_max_allocated_bytes_);
os << buffer;
if (stats.function_name_.size() > 0) {
@@ -79,8 +83,8 @@
static void WriteFullLine(std::ostream& os) {
- os << "-----------------------------------------------"
- "-----------------------------------------------\n";
+ os << "--------------------------------------------------------"
+ "--------------------------------------------------------\n";
}
@@ -92,8 +96,8 @@
static void WritePhaseKindBreak(std::ostream& os) {
- os << " ------------------"
- "-----------------------------------------------\n";
+ os << " ---------------------------"
+ "--------------------------------------------------------\n";
}
=======================================
--- /branches/bleeding_edge/src/compilation-statistics.h Thu Oct 23
09:14:35 2014 UTC
+++ /branches/bleeding_edge/src/compilation-statistics.h Mon Oct 27
08:58:55 2014 UTC
@@ -22,13 +22,17 @@
class BasicStats {
public:
- BasicStats() : total_allocated_bytes_(0), max_allocated_bytes_(0) {}
+ BasicStats()
+ : total_allocated_bytes_(0),
+ max_allocated_bytes_(0),
+ absolute_max_allocated_bytes_(0) {}
void Accumulate(const BasicStats& stats);
base::TimeDelta delta_;
size_t total_allocated_bytes_;
size_t max_allocated_bytes_;
+ size_t absolute_max_allocated_bytes_;
std::string function_name_;
};
=======================================
--- /branches/bleeding_edge/src/compiler/pipeline-statistics.cc Thu Oct 23
09:14:35 2014 UTC
+++ /branches/bleeding_edge/src/compiler/pipeline-statistics.cc Mon Oct 27
08:58:55 2014 UTC
@@ -16,6 +16,10 @@
scope_.Reset(new ZonePool::StatsScope(pipeline_stats->zone_pool_));
timer_.Start();
outer_zone_initial_size_ = pipeline_stats->OuterZoneSize();
+ allocated_bytes_at_start_ =
+ outer_zone_initial_size_ -
+ pipeline_stats->total_stats_.outer_zone_initial_size_ +
+ pipeline_stats->zone_pool_->GetCurrentAllocatedBytes();
}
@@ -28,6 +32,8 @@
size_t outer_zone_diff =
pipeline_stats->OuterZoneSize() - outer_zone_initial_size_;
diff->max_allocated_bytes_ = outer_zone_diff +
scope_->GetMaxAllocatedBytes();
+ diff->absolute_max_allocated_bytes_ =
+ diff->max_allocated_bytes_ + allocated_bytes_at_start_;
diff->total_allocated_bytes_ =
outer_zone_diff + scope_->GetTotalAllocatedBytes();
scope_.Reset(NULL);
=======================================
--- /branches/bleeding_edge/src/compiler/pipeline-statistics.h Thu Oct 23
09:14:35 2014 UTC
+++ /branches/bleeding_edge/src/compiler/pipeline-statistics.h Mon Oct 27
08:58:55 2014 UTC
@@ -39,6 +39,7 @@
SmartPointer<ZonePool::StatsScope> scope_;
base::ElapsedTimer timer_;
size_t outer_zone_initial_size_;
+ size_t allocated_bytes_at_start_;
};
bool InPhaseKind() { return !phase_kind_stats_.scope_.is_empty(); }
=======================================
--- /branches/bleeding_edge/src/compiler/pipeline.cc Fri Oct 24 13:06:48
2014 UTC
+++ /branches/bleeding_edge/src/compiler/pipeline.cc Mon Oct 27 08:58:55
2014 UTC
@@ -157,7 +157,7 @@
SmartPointer<PipelineStatistics> pipeline_statistics;
if (FLAG_turbo_stats) {
pipeline_statistics.Reset(new PipelineStatistics(info(), &zone_pool));
- pipeline_statistics->BeginPhaseKind("create graph");
+ pipeline_statistics->BeginPhaseKind("graph creation");
}
if (FLAG_trace_turbo) {
@@ -326,7 +326,7 @@
}
if (!pipeline_statistics.is_empty()) {
- pipeline_statistics->BeginPhaseKind("code generation");
+ pipeline_statistics->BeginPhaseKind("block building");
}
source_positions.RemoveDecorator();
@@ -429,6 +429,10 @@
TurboCfgFile tcf(isolate());
tcf << AsC1V("CodeGen", schedule, source_positions, &sequence);
}
+
+ if (pipeline_statistics != NULL) {
+ pipeline_statistics->BeginPhaseKind("register allocation");
+ }
// Allocate registers.
Frame frame;
@@ -456,6 +460,10 @@
os << "----- Instruction sequence after register allocation -----\n"
<< sequence;
}
+
+ if (pipeline_statistics != NULL) {
+ pipeline_statistics->BeginPhaseKind("code generation");
+ }
// Generate native sequence.
Handle<Code> code;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.