Revision: 15291
Author:   [email protected]
Date:     Mon Jun 24 06:25:44 2013
Log:      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.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/17590005
http://code.google.com/p/v8/source/detail?r=15291

Modified:
 /branches/bleeding_edge/src/compiler.cc
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/hydrogen.h

=======================================
--- /branches/bleeding_edge/src/compiler.cc     Wed Jun 19 10:00:01 2013
+++ /branches/bleeding_edge/src/compiler.cc     Mon Jun 24 06:25:44 2013
@@ -367,7 +367,10 @@
   // 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 @@
       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
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Mon Jun 24 06:07:20 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Mon Jun 24 06:25:44 2013
@@ -11499,25 +11499,18 @@


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) {
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Thu Jun 20 03:48:14 2013
+++ /branches/bleeding_edge/src/hydrogen.h      Mon Jun 24 06:25:44 2013
@@ -1923,6 +1923,10 @@
   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 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);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to