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

Unified Diff: src/hydrogen.cc

Issue 6646015: Normalize statistics about compilation time and allocation size.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « src/hydrogen.h ('k') | src/v8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 7127)
+++ src/hydrogen.cc (working copy)
@@ -2134,6 +2134,8 @@
HGraph* HGraphBuilder::CreateGraph() {
graph_ = new HGraph(info());
+ if (FLAG_hydrogen_stats) HStatistics::Instance()->Initialize(info());
+
{
HPhase phase("Block building");
current_block_ = graph()->entry_block();
@@ -5810,6 +5812,11 @@
}
+void HStatistics::Initialize(CompilationInfo* info) {
+ source_size_ += info->shared_info()->SourceSize();
+}
+
+
void HStatistics::Print() {
PrintF("Timing results:\n");
int64_t sum = 0;
@@ -5827,9 +5834,10 @@
double size_percent = static_cast<double>(size) * 100 / total_size_;
PrintF(" %8u bytes / %4.1f %%\n", size, size_percent);
}
- PrintF("%30s - %7.3f ms %8u bytes\n", "Sum",
- static_cast<double>(sum) / 1000,
- total_size_);
+ double source_size_in_kb = static_cast<double>(source_size_) / 1024;
+ PrintF("%30s - %7.3f ms %7.3f bytes\n", "Sum",
+ (static_cast<double>(sum) / 1000) / source_size_in_kb,
+ total_size_ / source_size_in_kb);
PrintF("---------------------------------------------------------------\n");
PrintF("%30s - %7.3f ms (%.1f times slower than full code gen)\n",
"Total",
@@ -5874,13 +5882,13 @@
if (allocator != NULL && chunk_ == NULL) {
chunk_ = allocator->chunk();
}
- if (FLAG_time_hydrogen) start_ = OS::Ticks();
+ if (FLAG_hydrogen_stats) start_ = OS::Ticks();
start_allocation_size_ = Zone::allocation_size_;
}
void HPhase::End() const {
- if (FLAG_time_hydrogen) {
+ if (FLAG_hydrogen_stats) {
int64_t end = OS::Ticks();
unsigned size = Zone::allocation_size_ - start_allocation_size_;
HStatistics::Instance()->SaveTiming(name_, end - start_, size);
« no previous file with comments | « src/hydrogen.h ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698