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

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: Split LPhase into LPhase and LAllocatorPhase. Cleanup. 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
« no previous file with comments | « 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 87028bda35406f673b37cebda80d4a0a2bb7cf89..575afaaf0b2c74513585952c1315f41d07a0eaa3 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1224,4 +1224,32 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
info));
}
+
+CompilationPhase::CompilationPhase(const char* name,
+ Isolate* isolate,
+ Zone* zone)
+ : name_(name), isolate_(isolate), zone_scope_(zone, DELETE_ON_EXIT) {
+ 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
« no previous file with comments | « src/compiler.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698