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

Side by Side Diff: src/hydrogen.cc

Issue 185563004: Fix a few nits found by PVS Studio (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/deoptimizer.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 12625 matching lines...) Expand 10 before | Expand all | Expand 10 after
12636 "----------------------------------------\n"); 12636 "----------------------------------------\n");
12637 PrintF("%33s %8.3f ms %9u bytes\n", "Total", 12637 PrintF("%33s %8.3f ms %9u bytes\n", "Total",
12638 total.InMillisecondsF(), total_size_); 12638 total.InMillisecondsF(), total_size_);
12639 PrintF("%33s (%.1f times slower than full code gen)\n", "", 12639 PrintF("%33s (%.1f times slower than full code gen)\n", "",
12640 total.TimesOf(full_code_gen_)); 12640 total.TimesOf(full_code_gen_));
12641 12641
12642 double source_size_in_kb = static_cast<double>(source_size_) / 1024; 12642 double source_size_in_kb = static_cast<double>(source_size_) / 1024;
12643 double normalized_time = source_size_in_kb > 0 12643 double normalized_time = source_size_in_kb > 0
12644 ? total.InMillisecondsF() / source_size_in_kb 12644 ? total.InMillisecondsF() / source_size_in_kb
12645 : 0; 12645 : 0;
12646 double normalized_size_in_kb = source_size_in_kb > 0 12646 double normalized_size_in_kb =
12647 ? total_size_ / 1024 / source_size_in_kb 12647 source_size_in_kb > 0
12648 : 0; 12648 ? static_cast<double>(total_size_) / 1024 / source_size_in_kb
12649 : 0;
12649 PrintF("%33s %8.3f ms %7.3f kB allocated\n", 12650 PrintF("%33s %8.3f ms %7.3f kB allocated\n",
12650 "Average per kB source", normalized_time, normalized_size_in_kb); 12651 "Average per kB source", normalized_time, normalized_size_in_kb);
12651 } 12652 }
12652 12653
12653 12654
12654 void HStatistics::SaveTiming(const char* name, base::TimeDelta time, 12655 void HStatistics::SaveTiming(const char* name, base::TimeDelta time,
12655 unsigned size) { 12656 unsigned size) {
12656 total_size_ += size; 12657 total_size_ += size;
12657 for (int i = 0; i < names_.length(); ++i) { 12658 for (int i = 0; i < names_.length(); ++i) {
12658 if (strcmp(names_[i], name) == 0) { 12659 if (strcmp(names_[i], name) == 0) {
(...skipping 12 matching lines...) Expand all
12671 if (ShouldProduceTraceOutput()) { 12672 if (ShouldProduceTraceOutput()) {
12672 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12673 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12673 } 12674 }
12674 12675
12675 #ifdef DEBUG 12676 #ifdef DEBUG
12676 graph_->Verify(false); // No full verify. 12677 graph_->Verify(false); // No full verify.
12677 #endif 12678 #endif
12678 } 12679 }
12679 12680
12680 } } // namespace v8::internal 12681 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698