Reviewers: Kevin Millikin,

Description:
Small cleanup of unused code in hydrogen IR.


Please review this at http://codereview.chromium.org/6513008/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/hydrogen-instructions.h
  M     src/hydrogen.h
  M     src/hydrogen.cc


Index: src/hydrogen-instructions.h
===================================================================
--- src/hydrogen-instructions.h (revision 6757)
+++ src/hydrogen-instructions.h (working copy)
@@ -611,9 +611,6 @@

   virtual HType CalculateInferredType() const;

-  // Helper for type conversions used by normal and phi instructions.
- void InsertInputConversion(HInstruction* previous, int index, HType type);
-
 #ifdef DEBUG
   virtual void Verify() = 0;
 #endif
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc     (revision 6757)
+++ src/hydrogen.cc     (working copy)
@@ -65,6 +65,7 @@
       first_instruction_index_(-1),
       last_instruction_index_(-1),
       deleted_phis_(4),
+      parent_loop_header_(NULL),
       is_inline_return_target_(false) {
 }

@@ -293,20 +294,6 @@
   // Check that every block is finished.
   ASSERT(IsFinished());
   ASSERT(block_id() >= 0);
-
- // Verify that all blocks targetting a branch target, have the same boolean
-  // value on top of their expression stack.
-  if (!cond().is_null()) {
-    ASSERT(predecessors()->length() > 0);
-    for (int i = 1; i < predecessors()->length(); i++) {
-      HBasicBlock* pred = predecessors()->at(i);
-      HValue* top = pred->last_environment()->Top();
-      ASSERT(top->IsConstant());
-      Object* a = *HConstant::cast(top)->handle();
-      Object* b = *cond();
-      ASSERT(a == b);
-    }
-  }
 }
 #endif

Index: src/hydrogen.h
===================================================================
--- src/hydrogen.h      (revision 6757)
+++ src/hydrogen.h      (working copy)
@@ -103,16 +103,14 @@
   void ClearEnvironment() { last_environment_ = NULL; }
   bool HasEnvironment() const { return last_environment_ != NULL; }
   void UpdateEnvironment(HEnvironment* env) { last_environment_ = env; }
-  HBasicBlock* parent_loop_header() const {
-    if (!HasParentLoopHeader()) return NULL;
-    return parent_loop_header_.get();
-  }
+  HBasicBlock* parent_loop_header() const { return parent_loop_header_; }

   void set_parent_loop_header(HBasicBlock* block) {
-    parent_loop_header_.set(block);
+    ASSERT(parent_loop_header_ == NULL);
+    parent_loop_header_ = block;
   }

-  bool HasParentLoopHeader() const { return parent_loop_header_.is_set(); }
+  bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; }

   void SetJoinId(int id);

@@ -136,9 +134,6 @@
   bool IsInlineReturnTarget() const { return is_inline_return_target_; }
   void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; }

-  Handle<Object> cond() { return cond_; }
-  void set_cond(Handle<Object> value) { cond_ = value; }
-
 #ifdef DEBUG
   void Verify();
 #endif
@@ -166,9 +161,8 @@
   int first_instruction_index_;
   int last_instruction_index_;
   ZoneList<int> deleted_phis_;
-  SetOncePointer<HBasicBlock> parent_loop_header_;
+  HBasicBlock* parent_loop_header_;
   bool is_inline_return_target_;
-  Handle<Object> cond_;
 };




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to