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

Unified Diff: src/compiler.cc

Issue 17572011: Split HPhase for Lithium and Hydrogen using common CompilationPhase base. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« src/compiler.h ('K') | « src/compiler.h ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 7d5fd930f844de4a632cdfcdae5c0810f925cd14..770ef658534a1774235841fe471dd77ef2512a79 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -367,7 +367,10 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
// performance of the hydrogen-based compiler.
bool should_recompile = !info()->shared_info()->has_deoptimization_support();
if (should_recompile || FLAG_hydrogen_stats) {
- HPhase phase(HPhase::kFullCodeGen, isolate(), info()->zone());
+ int64_t start_ticks = 0;
danno 2013/06/24 12:21:22 Seems like you have more than one patch in this CL
Benedikt Meurer 2013/06/24 13:04:08 Done.
+ if (FLAG_hydrogen_stats) {
+ start_ticks = OS::Ticks();
+ }
CompilationInfoWithZone unoptimized(info()->shared_info());
// Note that we use the same AST that we will use for generating the
// optimized code.
@@ -384,6 +387,10 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
Compiler::RecordFunctionCompilation(
Logger::LAZY_COMPILE_TAG, &unoptimized, shared);
}
+ if (FLAG_hydrogen_stats) {
+ int64_t ticks = OS::Ticks() - start_ticks;
+ isolate()->GetHStatistics()->IncrementFullCodeGen(ticks);
+ }
}
// Check that the unoptimized, shared code is ready for
@@ -1206,4 +1213,32 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
info));
}
+
+CompilationPhase::CompilationPhase(const char* name,
+ Isolate* isolate,
+ Zone* zone)
+ : name_(name), isolate_(isolate), zone_(zone) {
+ if (FLAG_hydrogen_stats) {
+ start_allocation_size_ = zone->allocation_size();
+ start_ticks_ = OS::Ticks();
+ }
+}
+
+
+CompilationPhase::~CompilationPhase() {
+ if (FLAG_hydrogen_stats) {
+ unsigned size = zone_->allocation_size() - start_allocation_size_;
+ int64_t ticks = OS::Ticks() - start_ticks_;
+ isolate_->GetHStatistics()->SaveTiming(name_, ticks, size);
+ }
+}
+
+
+bool CompilationPhase::ShouldProduceTraceOutput() const {
+ // Produce trace output if flag is set so that the first letter of the
+ // phase name matches the command line parameter FLAG_trace_phase.
+ return (FLAG_trace_hydrogen &&
+ OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
+}
+
} } // namespace v8::internal
« src/compiler.h ('K') | « src/compiler.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698