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_;
}
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) {
static void WriteFullLine(std::ostream& os) {
- os << "-----------------------------------------------"
- "-----------------------------------------------\n";
+ os << "--------------------------------------------------------"
+ "--------------------------------------------------------\n";
}
static void WritePhaseKindBreak(std::ostream& os) {
- os << " ------------------"
- "-----------------------------------------------\n";
+ os << " ---------------------------"
+ "--------------------------------------------------------\n";
}
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_;
};
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();
}
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);
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(); }
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) {
}
if (!pipeline_statistics.is_empty()) {
- pipeline_statistics->BeginPhaseKind("code generation");
+ pipeline_statistics->BeginPhaseKind("block building");
}
source_positions.RemoveDecorator();
tcf << AsC1V("CodeGen", schedule, source_positions, &sequence);
}
+ if (pipeline_statistics != NULL) {
+ pipeline_statistics->BeginPhaseKind("register allocation");
+ }
+
// Allocate registers.
Frame frame;
{
<< sequence;
}
+ if (pipeline_statistics != NULL) {
+ pipeline_statistics->BeginPhaseKind("code generation");
+ }
+
// Generate native sequence.
Handle<Code> code;
{