Commit 3481344d authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Drop (mis)use of HPhase in full code gen.

The full code generator is not a proper Hydrogen phase. The full code
gen ticks are tracked in a special member of HStatistics, so HPhase is
most probably misused at this point.

R=danno@chromium.org
BUG=

Review URL: https://codereview.chromium.org/17590005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15291 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c63a5255
...@@ -367,7 +367,10 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() { ...@@ -367,7 +367,10 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
// performance of the hydrogen-based compiler. // performance of the hydrogen-based compiler.
bool should_recompile = !info()->shared_info()->has_deoptimization_support(); bool should_recompile = !info()->shared_info()->has_deoptimization_support();
if (should_recompile || FLAG_hydrogen_stats) { if (should_recompile || FLAG_hydrogen_stats) {
HPhase phase(HPhase::kFullCodeGen, isolate(), info()->zone()); int64_t start_ticks = 0;
if (FLAG_hydrogen_stats) {
start_ticks = OS::Ticks();
}
CompilationInfoWithZone unoptimized(info()->shared_info()); CompilationInfoWithZone unoptimized(info()->shared_info());
// Note that we use the same AST that we will use for generating the // Note that we use the same AST that we will use for generating the
// optimized code. // optimized code.
...@@ -384,6 +387,10 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() { ...@@ -384,6 +387,10 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
Compiler::RecordFunctionCompilation( Compiler::RecordFunctionCompilation(
Logger::LAZY_COMPILE_TAG, &unoptimized, shared); 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 // Check that the unoptimized, shared code is ready for
......
...@@ -11499,27 +11499,20 @@ void HStatistics::Print() { ...@@ -11499,27 +11499,20 @@ void HStatistics::Print() {
void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) { void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) {
if (name == HPhase::kFullCodeGen) { total_size_ += size;
full_code_gen_ += ticks; for (int i = 0; i < names_.length(); ++i) {
} else { if (strcmp(names_[i], name) == 0) {
total_size_ += size; timing_[i] += ticks;
for (int i = 0; i < names_.length(); ++i) { sizes_[i] += size;
if (strcmp(names_[i], name) == 0) { return;
timing_[i] += ticks;
sizes_[i] += size;
return;
}
} }
names_.Add(name);
timing_.Add(ticks);
sizes_.Add(size);
} }
names_.Add(name);
timing_.Add(ticks);
sizes_.Add(size);
} }
const char* const HPhase::kFullCodeGen = "Full code generator";
HPhase::HPhase(const char* name, Isolate* isolate, Zone* zone) { HPhase::HPhase(const char* name, Isolate* isolate, Zone* zone) {
Init(isolate, name, zone, NULL, NULL, NULL); Init(isolate, name, zone, NULL, NULL, NULL);
} }
......
...@@ -1923,6 +1923,10 @@ class HStatistics: public Malloced { ...@@ -1923,6 +1923,10 @@ class HStatistics: public Malloced {
void Print(); void Print();
void SaveTiming(const char* name, int64_t ticks, unsigned size); void SaveTiming(const char* name, int64_t ticks, unsigned size);
void IncrementFullCodeGen(int64_t full_code_gen) {
full_code_gen_ += full_code_gen;
}
void IncrementSubtotals(int64_t create_graph, void IncrementSubtotals(int64_t create_graph,
int64_t optimize_graph, int64_t optimize_graph,
int64_t generate_code) { int64_t generate_code) {
...@@ -1946,8 +1950,6 @@ class HStatistics: public Malloced { ...@@ -1946,8 +1950,6 @@ class HStatistics: public Malloced {
class HPhase BASE_EMBEDDED { class HPhase BASE_EMBEDDED {
public: public:
static const char* const kFullCodeGen;
HPhase(const char* name, Isolate* isolate, Zone* zone); HPhase(const char* name, Isolate* isolate, Zone* zone);
HPhase(const char* name, HGraph* graph); HPhase(const char* name, HGraph* graph);
HPhase(const char* name, LChunk* chunk); HPhase(const char* name, LChunk* chunk);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment