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() {
// 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;
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
......
......@@ -11499,27 +11499,20 @@ void HStatistics::Print() {
void HStatistics::SaveTiming(const char* name, int64_t ticks, unsigned size) {
if (name == HPhase::kFullCodeGen) {
full_code_gen_ += ticks;
} else {
total_size_ += size;
for (int i = 0; i < names_.length(); ++i) {
if (strcmp(names_[i], name) == 0) {
timing_[i] += ticks;
sizes_[i] += size;
return;
}
total_size_ += size;
for (int i = 0; i < names_.length(); ++i) {
if (strcmp(names_[i], name) == 0) {
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) {
Init(isolate, name, zone, NULL, NULL, NULL);
}
......
......@@ -1923,6 +1923,10 @@ class HStatistics: public Malloced {
void Print();
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,
int64_t optimize_graph,
int64_t generate_code) {
......@@ -1946,8 +1950,6 @@ class HStatistics: public Malloced {
class HPhase BASE_EMBEDDED {
public:
static const char* const kFullCodeGen;
HPhase(const char* name, Isolate* isolate, Zone* zone);
HPhase(const char* name, HGraph* graph);
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