| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 0d92b2eebe5be196e17be4614eaeb10873ebf652..610fb6dfb0acdeabf27d63625939662c9d7f841e 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2010 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -5713,31 +5713,40 @@ void HStatistics::Print() {
|
| PrintF("%30s", names_[i]);
|
| double ms = static_cast<double>(timing_[i]) / 1000;
|
| double percent = static_cast<double>(timing_[i]) * 100 / sum;
|
| - PrintF(" - %0.3f ms / %0.3f %% \n", ms, percent);
|
| + PrintF(" - %7.3f ms / %4.1f %% ", ms, percent);
|
| +
|
| + unsigned size = sizes_[i];
|
| + double size_percent = static_cast<double>(size) * 100 / total_size_;
|
| + PrintF(" %8u bytes / %4.1f %%\n", size, size_percent);
|
| }
|
| - PrintF("%30s - %0.3f ms \n", "Sum", static_cast<double>(sum) / 1000);
|
| + PrintF("%30s - %7.3f ms %8u bytes\n", "Sum",
|
| + static_cast<double>(sum) / 1000,
|
| + total_size_);
|
| PrintF("---------------------------------------------------------------\n");
|
| - PrintF("%30s - %0.3f ms (%0.1f times slower than full code gen)\n",
|
| + PrintF("%30s - %7.3f ms (%.1f times slower than full code gen)\n",
|
| "Total",
|
| static_cast<double>(total_) / 1000,
|
| static_cast<double>(total_) / full_code_gen_);
|
| }
|
|
|
|
|
| -void HStatistics::SaveTiming(const char* name, int64_t ticks) {
|
| +void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) {
|
| if (name == HPhase::kFullCodeGen) {
|
| full_code_gen_ += ticks;
|
| } else if (name == HPhase::kTotal) {
|
| total_ += ticks;
|
| } else {
|
| + total_size_ += size;
|
| for (int i = 0; i < names_.length(); ++i) {
|
| if (names_[i] == name) {
|
| timing_[i] += ticks;
|
| + sizes_[i] += size;
|
| return;
|
| }
|
| }
|
| names_.Add(name);
|
| timing_.Add(ticks);
|
| + sizes_.Add(size);
|
| }
|
| }
|
|
|
| @@ -5758,13 +5767,15 @@ void HPhase::Begin(const char* name,
|
| chunk_ = allocator->chunk();
|
| }
|
| if (FLAG_time_hydrogen) start_ = OS::Ticks();
|
| + start_allocation_size_ = Zone::allocation_size_;
|
| }
|
|
|
|
|
| void HPhase::End() const {
|
| if (FLAG_time_hydrogen) {
|
| int64_t end = OS::Ticks();
|
| - HStatistics::Instance()->SaveTiming(name_, end - start_);
|
| + unsigned size = Zone::allocation_size_ - start_allocation_size_;
|
| + HStatistics::Instance()->SaveTiming(name_, end - start_, size);
|
| }
|
|
|
| if (FLAG_trace_hydrogen) {
|
|
|