OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 11435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11446 | 11446 |
11447 | 11447 |
11448 void HStatistics::Print() { | 11448 void HStatistics::Print() { |
11449 PrintF("Timing results:\n"); | 11449 PrintF("Timing results:\n"); |
11450 int64_t sum = 0; | 11450 int64_t sum = 0; |
11451 for (int i = 0; i < timing_.length(); ++i) { | 11451 for (int i = 0; i < timing_.length(); ++i) { |
11452 sum += timing_[i]; | 11452 sum += timing_[i]; |
11453 } | 11453 } |
11454 | 11454 |
11455 for (int i = 0; i < names_.length(); ++i) { | 11455 for (int i = 0; i < names_.length(); ++i) { |
11456 PrintF("%30s", names_[i]); | 11456 PrintF("%32s", names_[i]); |
11457 double ms = static_cast<double>(timing_[i]) / 1000; | 11457 double ms = static_cast<double>(timing_[i]) / 1000; |
11458 double percent = static_cast<double>(timing_[i]) * 100 / sum; | 11458 double percent = static_cast<double>(timing_[i]) * 100 / sum; |
11459 PrintF(" - %8.3f ms / %4.1f %% ", ms, percent); | 11459 PrintF(" %8.3f ms / %4.1f %% ", ms, percent); |
11460 | 11460 |
11461 unsigned size = sizes_[i]; | 11461 unsigned size = sizes_[i]; |
11462 double size_percent = static_cast<double>(size) * 100 / total_size_; | 11462 double size_percent = static_cast<double>(size) * 100 / total_size_; |
11463 PrintF(" %9u bytes / %4.1f %%\n", size, size_percent); | 11463 PrintF(" %9u bytes / %4.1f %%\n", size, size_percent); |
11464 } | 11464 } |
11465 | 11465 |
11466 PrintF("----------------------------------------" | 11466 PrintF("----------------------------------------" |
11467 "---------------------------------------\n"); | 11467 "---------------------------------------\n"); |
11468 int64_t total = create_graph_ + optimize_graph_ + generate_code_; | 11468 int64_t total = create_graph_ + optimize_graph_ + generate_code_; |
11469 PrintF("%30s - %8.3f ms / %4.1f %% \n", | 11469 PrintF("%32s %8.3f ms / %4.1f %% \n", |
11470 "Create graph", | 11470 "Create graph", |
11471 static_cast<double>(create_graph_) / 1000, | 11471 static_cast<double>(create_graph_) / 1000, |
11472 static_cast<double>(create_graph_) * 100 / total); | 11472 static_cast<double>(create_graph_) * 100 / total); |
11473 PrintF("%30s - %8.3f ms / %4.1f %% \n", | 11473 PrintF("%32s %8.3f ms / %4.1f %% \n", |
11474 "Optimize graph", | 11474 "Optimize graph", |
11475 static_cast<double>(optimize_graph_) / 1000, | 11475 static_cast<double>(optimize_graph_) / 1000, |
11476 static_cast<double>(optimize_graph_) * 100 / total); | 11476 static_cast<double>(optimize_graph_) * 100 / total); |
11477 PrintF("%30s - %8.3f ms / %4.1f %% \n", | 11477 PrintF("%32s %8.3f ms / %4.1f %% \n", |
11478 "Generate and install code", | 11478 "Generate and install code", |
11479 static_cast<double>(generate_code_) / 1000, | 11479 static_cast<double>(generate_code_) / 1000, |
11480 static_cast<double>(generate_code_) * 100 / total); | 11480 static_cast<double>(generate_code_) * 100 / total); |
11481 PrintF("----------------------------------------" | 11481 PrintF("----------------------------------------" |
11482 "---------------------------------------\n"); | 11482 "---------------------------------------\n"); |
11483 PrintF("%30s - %8.3f ms (%.1f times slower than full code gen)\n", | 11483 PrintF("%32s %8.3f ms (%.1f times slower than full code gen)\n", |
11484 "Total", | 11484 "Total", |
11485 static_cast<double>(total) / 1000, | 11485 static_cast<double>(total) / 1000, |
11486 static_cast<double>(total) / full_code_gen_); | 11486 static_cast<double>(total) / full_code_gen_); |
11487 | 11487 |
11488 double source_size_in_kb = static_cast<double>(source_size_) / 1024; | 11488 double source_size_in_kb = static_cast<double>(source_size_) / 1024; |
11489 double normalized_time = source_size_in_kb > 0 | 11489 double normalized_time = source_size_in_kb > 0 |
11490 ? (static_cast<double>(total) / 1000) / source_size_in_kb | 11490 ? (static_cast<double>(total) / 1000) / source_size_in_kb |
11491 : 0; | 11491 : 0; |
11492 double normalized_size_in_kb = source_size_in_kb > 0 | 11492 double normalized_size_in_kb = source_size_in_kb > 0 |
11493 ? total_size_ / 1024 / source_size_in_kb | 11493 ? total_size_ / 1024 / source_size_in_kb |
11494 : 0; | 11494 : 0; |
11495 PrintF("%30s - %8.3f ms %7.3f kB allocated\n", | 11495 PrintF("%32s %8.3f ms %7.3f kB allocated\n", |
11496 "Average per kB source", | 11496 "Average per kB source", |
11497 normalized_time, normalized_size_in_kb); | 11497 normalized_time, normalized_size_in_kb); |
11498 } | 11498 } |
11499 | 11499 |
11500 | 11500 |
11501 void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) { | 11501 void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) { |
11502 if (name == HPhase::kFullCodeGen) { | 11502 if (name == HPhase::kFullCodeGen) { |
11503 full_code_gen_ += ticks; | 11503 full_code_gen_ += ticks; |
11504 } else { | 11504 } else { |
11505 total_size_ += size; | 11505 total_size_ += size; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11584 } | 11584 } |
11585 } | 11585 } |
11586 | 11586 |
11587 #ifdef DEBUG | 11587 #ifdef DEBUG |
11588 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11588 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
11589 if (allocator_ != NULL) allocator_->Verify(); | 11589 if (allocator_ != NULL) allocator_->Verify(); |
11590 #endif | 11590 #endif |
11591 } | 11591 } |
11592 | 11592 |
11593 } } // namespace v8::internal | 11593 } } // namespace v8::internal |
OLD | NEW |