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

Side by Side Diff: src/hydrogen.cc

Issue 17590005: Drop (mis)use of HPhase in full code gen. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Fix GCC warning about uninitialized start_ticks variable. Created 7 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11481 matching lines...) Expand 10 before | Expand all | Expand 10 after
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("%30s - %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 total_size_ += size;
11503 full_code_gen_ += ticks; 11503 for (int i = 0; i < names_.length(); ++i) {
11504 } else { 11504 if (strcmp(names_[i], name) == 0) {
11505 total_size_ += size; 11505 timing_[i] += ticks;
11506 for (int i = 0; i < names_.length(); ++i) { 11506 sizes_[i] += size;
11507 if (strcmp(names_[i], name) == 0) { 11507 return;
11508 timing_[i] += ticks;
11509 sizes_[i] += size;
11510 return;
11511 }
11512 } 11508 }
11513 names_.Add(name);
11514 timing_.Add(ticks);
11515 sizes_.Add(size);
11516 } 11509 }
11510 names_.Add(name);
11511 timing_.Add(ticks);
11512 sizes_.Add(size);
11517 } 11513 }
11518 11514
11519 11515
11520 const char* const HPhase::kFullCodeGen = "Full code generator";
11521
11522
11523 HPhase::HPhase(const char* name, Isolate* isolate, Zone* zone) { 11516 HPhase::HPhase(const char* name, Isolate* isolate, Zone* zone) {
11524 Init(isolate, name, zone, NULL, NULL, NULL); 11517 Init(isolate, name, zone, NULL, NULL, NULL);
11525 } 11518 }
11526 11519
11527 11520
11528 HPhase::HPhase(const char* name, HGraph* graph) { 11521 HPhase::HPhase(const char* name, HGraph* graph) {
11529 Init(graph->isolate(), name, graph->zone(), graph, NULL, NULL); 11522 Init(graph->isolate(), name, graph->zone(), graph, NULL, NULL);
11530 } 11523 }
11531 11524
11532 11525
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
11584 } 11577 }
11585 } 11578 }
11586 11579
11587 #ifdef DEBUG 11580 #ifdef DEBUG
11588 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11581 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11589 if (allocator_ != NULL) allocator_->Verify(); 11582 if (allocator_ != NULL) allocator_->Verify();
11590 #endif 11583 #endif
11591 } 11584 }
11592 11585
11593 } } // namespace v8::internal 11586 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698