Reviewers: Kevin Millikin, fschneider,

Message:
Feel free to reject this one, as it's just a name change. The only reason I'm
posting it is that it took me quite some time to figure out what
HCompareIDAndBranch was for, and thought that a different name might help other
readers.

Description:
rename HCompareIDAndBranch to HCompareNumbersAndBranch

* src/hydrogen-instructions.h (HCompareNumbersAndBranch): Rename from
  HCompareIDAndBranch.  It seems that "ID" stood for "integers or
  doubles", but to an ignorant reader (me) ID can be confused with
  "identities".

* src/arm/lithium-arm.cc:
* src/arm/lithium-arm.h:
* src/hydrogen-instructions.cc:
* src/hydrogen.cc:
* src/ia32/lithium-ia32.cc:
* src/ia32/lithium-ia32.h:
* src/x64/lithium-x64.cc:
* src/x64/lithium-x64.h: Adapt uses.

BUG=
TEST=


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

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

Affected files:
  M src/arm/lithium-arm.h
  M src/arm/lithium-arm.cc
  M src/hydrogen-instructions.h
  M src/hydrogen-instructions.cc
  M src/hydrogen.cc
  M src/ia32/lithium-ia32.h
  M src/ia32/lithium-ia32.cc
  M src/x64/lithium-x64.h
  M src/x64/lithium-x64.cc


Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index ea06064e5ebf2a0827594bc1389ee0bf7e7c9112..0790a42f8b5b2a5d9db1aadc01e90902e3c491c2 100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -1410,8 +1410,8 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
 }


-LInstruction* LChunkBuilder::DoCompareIDAndBranch(
-    HCompareIDAndBranch* instr) {
+LInstruction* LChunkBuilder::DoCompareNumbersAndBranch(
+    HCompareNumbersAndBranch* instr) {
   Representation r = instr->GetInputRepresentation();
   if (r.IsInteger32()) {
     ASSERT(instr->left()->representation().IsInteger32());
Index: src/arm/lithium-arm.h
diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h
index 70c348de69f8c406b8fada3988e1f9958275fbb5..b3237e26822df95e152a6a619d6ab242cf1b6ca7 100644
--- a/src/arm/lithium-arm.h
+++ b/src/arm/lithium-arm.h
@@ -577,7 +577,7 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
   }

   DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
-  DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
+  DECLARE_HYDROGEN_ACCESSOR(CompareNumbersAndBranch)

   Token::Value op() const { return hydrogen()->token(); }
   bool is_double() const {
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 2be2a032574b6bf9af1f8560e19fe95d1694bab7..84a36d0546cbdadf7fde46aef3b2a7333cdb51c8 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1277,7 +1277,7 @@ void HCompareGeneric::PrintDataTo(StringStream* stream) {
 }


-void HCompareIDAndBranch::PrintDataTo(StringStream* stream) {
+void HCompareNumbersAndBranch::PrintDataTo(StringStream* stream) {
   stream->Add(Token::Name(token()));
   stream->Add(" ");
   left()->PrintNameTo(stream);
@@ -1286,7 +1286,7 @@ void HCompareIDAndBranch::PrintDataTo(StringStream* stream) {
 }


-void HCompareIDAndBranch::SetInputRepresentation(Representation r) {
+void HCompareNumbersAndBranch::SetInputRepresentation(Representation r) {
   input_representation_ = r;
   if (r.IsDouble()) {
     SetFlag(kDeoptimizeOnUndefined);
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index fcf5b25588e088817721183368db94d8b87167ec..d2c6c8d5a401c5432d5800971bb77e6cc307cca0 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -92,7 +92,7 @@ class LChunkBuilder;
   V(CheckSmi)                                  \
   V(ClampToUint8)                              \
   V(ClassOfTestAndBranch)                      \
-  V(CompareIDAndBranch)                        \
+  V(CompareNumbersAndBranch)                   \
   V(CompareGeneric)                            \
   V(CompareObjectEqAndBranch)                  \
   V(CompareMap)                                \
@@ -2574,9 +2574,9 @@ class HCompareGeneric: public HBinaryOperation {
 };


-class HCompareIDAndBranch: public HTemplateControlInstruction<2, 2> {
+class HCompareNumbersAndBranch: public HTemplateControlInstruction<2, 2> {
  public:
-  HCompareIDAndBranch(HValue* left, HValue* right, Token::Value token)
+  HCompareNumbersAndBranch(HValue* left, HValue* right, Token::Value token)
       : token_(token) {
     ASSERT(Token::IsCompareOp(token));
     SetOperandAt(0, left);
@@ -2597,7 +2597,7 @@ class HCompareIDAndBranch: public HTemplateControlInstruction<2, 2> {
   }
   virtual void PrintDataTo(StringStream* stream);

-  DECLARE_CONCRETE_INSTRUCTION(CompareIDAndBranch)
+  DECLARE_CONCRETE_INSTRUCTION(CompareNumbersAndBranch)

  private:
   Representation input_representation_;
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a6205ecdf5a6de3e10dbd6cd219a6faef1010434..8bbc42d801a7310c4f4ea3511f5d0d5d3d500312 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -891,7 +891,8 @@ class HRangeAnalysis BASE_EMBEDDED {
  private:
   void TraceRange(const char* msg, ...);
   void Analyze(HBasicBlock* block);
-  void InferControlFlowRange(HCompareIDAndBranch* test, HBasicBlock* dest);
+  void InferControlFlowRange(HCompareNumbersAndBranch* test,
+                             HBasicBlock* dest);
void UpdateControlFlowRange(Token::Value op, HValue* value, HValue* other);
   void InferRange(HValue* value);
   void RollBackTo(int index);
@@ -926,8 +927,9 @@ void HRangeAnalysis::Analyze(HBasicBlock* block) {
   // Infer range based on control flow.
   if (block->predecessors()->length() == 1) {
     HBasicBlock* pred = block->predecessors()->first();
-    if (pred->end()->IsCompareIDAndBranch()) {
-      InferControlFlowRange(HCompareIDAndBranch::cast(pred->end()), block);
+    if (pred->end()->IsCompareNumbersAndBranch()) {
+      InferControlFlowRange(HCompareNumbersAndBranch::cast(pred->end()),
+                            block);
     }
   }

@@ -953,7 +955,7 @@ void HRangeAnalysis::Analyze(HBasicBlock* block) {
 }


-void HRangeAnalysis::InferControlFlowRange(HCompareIDAndBranch* test,
+void HRangeAnalysis::InferControlFlowRange(HCompareNumbersAndBranch* test,
                                            HBasicBlock* dest) {
ASSERT((test->FirstSuccessor() == dest) == (test->SecondSuccessor() != dest));
   if (test->GetInputRepresentation().IsInteger32()) {
@@ -1936,8 +1938,8 @@ void HGraph::MarkDeoptimizeOnUndefined() {
   HPhase phase("MarkDeoptimizeOnUndefined", this);
   // Compute DeoptimizeOnUndefined flag for phis.
   // Any phi that can reach a use with DeoptimizeOnUndefined set must
- // have DeoptimizeOnUndefined set. Currently only HCompareIDAndBranch, with
-  // double input representation, has this flag set.
+ // have DeoptimizeOnUndefined set. Currently only HCompareNumbersAndBranch,
+  // with double input representation, has this flag set.
   // The flag is used by HChange tagged->double, which must deoptimize
   // if one of its uses has this flag set.
   for (int i = 0; i < phi_list()->length(); i++) {
@@ -2673,10 +2675,10 @@ void HGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
     // Otherwise generate a compare and branch.
     CHECK_ALIVE(VisitForValue(clause->label()));
     HValue* label_value = Pop();
-    HCompareIDAndBranch* compare =
-        new(zone()) HCompareIDAndBranch(tag_value,
-                                        label_value,
-                                        Token::EQ_STRICT);
+    HCompareNumbersAndBranch* compare =
+        new(zone()) HCompareNumbersAndBranch(tag_value,
+                                             label_value,
+                                             Token::EQ_STRICT);
     compare->SetInputRepresentation(Representation::Integer32());
     HBasicBlock* body_block = graph()->CreateBasicBlock();
     HBasicBlock* next_test_block = graph()->CreateBasicBlock();
@@ -5756,8 +5758,8 @@ void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
       result->set_position(expr->position());
       return ast_context()->ReturnInstruction(result, expr->id());
     } else {
-      HCompareIDAndBranch* result =
-          new(zone()) HCompareIDAndBranch(left, right, op);
+      HCompareNumbersAndBranch* result =
+          new(zone()) HCompareNumbersAndBranch(left, right, op);
       result->set_position(expr->position());
       result->SetInputRepresentation(r);
       return ast_context()->ReturnControl(result, expr->id());
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index 9951d2540bb1cab9136db7c2acf028cc04584473..a469a213757e550c03fa2ac3e6dd4bb9c34dbf0f 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -1430,8 +1430,8 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
 }


-LInstruction* LChunkBuilder::DoCompareIDAndBranch(
-    HCompareIDAndBranch* instr) {
+LInstruction* LChunkBuilder::DoCompareNumbersAndBranch(
+    HCompareNumbersAndBranch* instr) {
   Representation r = instr->GetInputRepresentation();
   if (r.IsInteger32()) {
     ASSERT(instr->left()->representation().IsInteger32());
Index: src/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index 6b60a6e40e3da4d9d50170b08dda492520ec9ad4..ead425d8c7ca54a9facad2ccb7f835a4eeb0596e 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -563,7 +563,7 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
   }

   DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
-  DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
+  DECLARE_HYDROGEN_ACCESSOR(CompareNumbersAndBranch)

   Token::Value op() const { return hydrogen()->token(); }
   bool is_double() const {
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index 5b502a80c91b1ca40226c17d08e2d0786897fe1f..e7ff595908aa9eb2e6695e95d427ac416ebaa288 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -1401,8 +1401,8 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
 }


-LInstruction* LChunkBuilder::DoCompareIDAndBranch(
-    HCompareIDAndBranch* instr) {
+LInstruction* LChunkBuilder::DoCompareNumbersAndBranch(
+    HCompareNumbersAndBranch* instr) {
   Representation r = instr->GetInputRepresentation();
   if (r.IsInteger32()) {
     ASSERT(instr->left()->representation().IsInteger32());
Index: src/x64/lithium-x64.h
diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h
index 12bdfb28aed4bb1966270cf28ef05c5433e91bf4..60cb2ae274ccafc1e3e8efec845f0b5b4144e8a2 100644
--- a/src/x64/lithium-x64.h
+++ b/src/x64/lithium-x64.h
@@ -561,7 +561,7 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
   }

   DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
-  DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
+  DECLARE_HYDROGEN_ACCESSOR(CompareNumbersAndBranch)

   Token::Value op() const { return hydrogen()->token(); }
   bool is_double() const {


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

Reply via email to