Revision: 15438
Author:   [email protected]
Date:     Tue Jul  2 01:29:33 2013
Log:      Turn escape analysis into a proper HPhase.

[email protected], [email protected]

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

Modified:
 /branches/bleeding_edge/src/hydrogen-escape-analysis.cc
 /branches/bleeding_edge/src/hydrogen-escape-analysis.h
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Fri Jun 28 09:09:54 2013 +++ /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Tue Jul 2 01:29:33 2013
@@ -31,7 +31,7 @@
 namespace internal {


-void HEscapeAnalysis::CollectIfNoEscapingUses(HInstruction* instr) {
+void HEscapeAnalysisPhase::CollectIfNoEscapingUses(HInstruction* instr) {
   for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
     HValue* use = it.value();
     if (use->HasEscapingOperandAt(it.index())) {
@@ -45,14 +45,14 @@
   if (FLAG_trace_escape_analysis) {
     PrintF("#%d (%s) is being captured\n", instr->id(), instr->Mnemonic());
   }
-  captured_.Add(instr, zone_);
+  captured_.Add(instr, zone());
 }


-void HEscapeAnalysis::CollectCapturedValues() {
-  int block_count = graph_->blocks()->length();
+void HEscapeAnalysisPhase::CollectCapturedValues() {
+  int block_count = graph()->blocks()->length();
   for (int i = 0; i < block_count; ++i) {
-    HBasicBlock* block = graph_->blocks()->at(i);
+    HBasicBlock* block = graph()->blocks()->at(i);
     for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
       HInstruction* instr = it.Current();
       if (instr->IsAllocate() || instr->IsAllocateObject()) {
@@ -61,12 +61,6 @@
     }
   }
 }
-
-
-void HEscapeAnalysis::Analyze() {
-  HPhase phase("H_Escape analysis", graph_);
-  CollectCapturedValues();
-}


 } }  // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/hydrogen-escape-analysis.h Fri Jun 28 09:09:54 2013 +++ /branches/bleeding_edge/src/hydrogen-escape-analysis.h Tue Jul 2 01:29:33 2013
@@ -35,19 +35,19 @@
 namespace internal {


-class HEscapeAnalysis BASE_EMBEDDED {
+class HEscapeAnalysisPhase : public HPhase {
  public:
-  explicit HEscapeAnalysis(HGraph* graph)
-      : graph_(graph), zone_(graph->zone()), captured_(0, zone_) { }
+  explicit HEscapeAnalysisPhase(HGraph* graph)
+      : HPhase("H_Escape analysis", graph), captured_(0, zone()) { }

-  void Analyze();
+  void Run() {
+    CollectCapturedValues();
+  }

  private:
   void CollectCapturedValues();
   void CollectIfNoEscapingUses(HInstruction* instr);

-  HGraph* graph_;
-  Zone* zone_;
   ZoneList<HValue*> captured_;
 };

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Mon Jul  1 08:12:21 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Tue Jul  2 01:29:33 2013
@@ -3815,10 +3815,7 @@

   if (FLAG_use_canonicalizing) Canonicalize();

-  if (FLAG_use_escape_analysis) {
-    HEscapeAnalysis escape_analysis(this);
-    escape_analysis.Analyze();
-  }
+  if (FLAG_use_escape_analysis) Run<HEscapeAnalysisPhase>();

   if (FLAG_use_gvn) Run<HGlobalValueNumberingPhase>();

--
--
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