Revision: 6206
Author: [email protected]
Date: Thu Jan  6 06:02:46 2011
Log: Use hydrogen accessor instead of copying members.

BUG=
TEST=

Review URL: http://codereview.chromium.org/6119001
http://code.google.com/p/v8/source/detail?r=6206

Modified:
 /branches/bleeding_edge/src/ia32/lithium-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.h

=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Wed Jan 5 04:31:31 2011 +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Thu Jan 6 06:02:46 2011
@@ -1285,12 +1285,7 @@
     HCompareMapAndBranch* instr) {
   ASSERT(instr->value()->representation().IsTagged());
   LOperand* value = UseRegisterAtStart(instr->value());
-  HBasicBlock* first = instr->FirstSuccessor();
-  HBasicBlock* second = instr->SecondSuccessor();
-  return new LCmpMapAndBranch(value,
-                              instr->map(),
-                              first->block_id(),
-                              second->block_id());
+  return new LCmpMapAndBranch(value);
 }


=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h     Wed Jan  5 04:31:31 2011
+++ /branches/bleeding_edge/src/ia32/lithium-ia32.h     Thu Jan  6 06:02:46 2011
@@ -1145,27 +1145,20 @@

 class LCmpMapAndBranch: public LUnaryOperation {
  public:
-  LCmpMapAndBranch(LOperand* value,
-                   Handle<Map> map,
-                   int true_block_id,
-                   int false_block_id)
-      : LUnaryOperation(value),
-        map_(map),
-        true_block_id_(true_block_id),
-        false_block_id_(false_block_id) { }
+  explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation(value) { }

   DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
+  DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch)

   virtual bool IsControl() const { return true; }

-  Handle<Map> map() const { return map_; }
-  int true_block_id() const { return true_block_id_; }
-  int false_block_id() const { return false_block_id_; }
-
- private:
-  Handle<Map> map_;
-  int true_block_id_;
-  int false_block_id_;
+  Handle<Map> map() const { return hydrogen()->map(); }
+  int true_block_id() const {
+    return hydrogen()->true_destination()->block_id();
+  }
+  int false_block_id() const {
+    return hydrogen()->false_destination()->block_id();
+  }
 };


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

Reply via email to