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
// 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.
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
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);
}
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) {
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);