OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 5793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5804 PrintF("%30s", names_[i]); | 5804 PrintF("%30s", names_[i]); |
5805 double ms = static_cast<double>(timing_[i]) / 1000; | 5805 double ms = static_cast<double>(timing_[i]) / 1000; |
5806 double percent = static_cast<double>(timing_[i]) * 100 / sum; | 5806 double percent = static_cast<double>(timing_[i]) * 100 / sum; |
5807 PrintF(" - %7.3f ms / %4.1f %% ", ms, percent); | 5807 PrintF(" - %7.3f ms / %4.1f %% ", ms, percent); |
5808 | 5808 |
5809 unsigned size = sizes_[i]; | 5809 unsigned size = sizes_[i]; |
5810 double size_percent = static_cast<double>(size) * 100 / total_size_; | 5810 double size_percent = static_cast<double>(size) * 100 / total_size_; |
5811 PrintF(" %8u bytes / %4.1f %%\n", size, size_percent); | 5811 PrintF(" %8u bytes / %4.1f %%\n", size, size_percent); |
5812 } | 5812 } |
5813 double source_size_in_kb = static_cast<double>(source_size_) / 1024; | 5813 double source_size_in_kb = static_cast<double>(source_size_) / 1024; |
| 5814 double normalized_time = source_size_in_kb > 0 |
| 5815 ? (static_cast<double>(sum) / 1000) / source_size_in_kb |
| 5816 : 0; |
| 5817 double normalized_bytes = source_size_in_kb > 0 |
| 5818 ? total_size_ / source_size_in_kb |
| 5819 : 0; |
5814 PrintF("%30s - %7.3f ms %7.3f bytes\n", "Sum", | 5820 PrintF("%30s - %7.3f ms %7.3f bytes\n", "Sum", |
5815 (static_cast<double>(sum) / 1000) / source_size_in_kb, | 5821 normalized_time, normalized_bytes); |
5816 total_size_ / source_size_in_kb); | |
5817 PrintF("---------------------------------------------------------------\n"); | 5822 PrintF("---------------------------------------------------------------\n"); |
5818 PrintF("%30s - %7.3f ms (%.1f times slower than full code gen)\n", | 5823 PrintF("%30s - %7.3f ms (%.1f times slower than full code gen)\n", |
5819 "Total", | 5824 "Total", |
5820 static_cast<double>(total_) / 1000, | 5825 static_cast<double>(total_) / 1000, |
5821 static_cast<double>(total_) / full_code_gen_); | 5826 static_cast<double>(total_) / full_code_gen_); |
5822 } | 5827 } |
5823 | 5828 |
5824 | 5829 |
5825 void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) { | 5830 void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) { |
5826 if (name == HPhase::kFullCodeGen) { | 5831 if (name == HPhase::kFullCodeGen) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5878 } | 5883 } |
5879 } | 5884 } |
5880 | 5885 |
5881 #ifdef DEBUG | 5886 #ifdef DEBUG |
5882 if (graph_ != NULL) graph_->Verify(); | 5887 if (graph_ != NULL) graph_->Verify(); |
5883 if (allocator_ != NULL) allocator_->Verify(); | 5888 if (allocator_ != NULL) allocator_->Verify(); |
5884 #endif | 5889 #endif |
5885 } | 5890 } |
5886 | 5891 |
5887 } } // namespace v8::internal | 5892 } } // namespace v8::internal |
OLD | NEW |