Reviewers: rossberg,

Description:
Adapt some typed lowering unit tests after r23972.

[email protected]
TEST=cctest/test-js-typed-lowering

Please review this at https://codereview.chromium.org/574713002/

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

Affected files (+11, -10 lines):
  M test/cctest/compiler/test-js-typed-lowering.cc


Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc index fb63583f88a6d60ac45d977a68919d5127f38fe0..861cf3932b67e395f3c9001133e2d84fe4bb1c43 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -684,12 +684,14 @@ TEST(NumberComparison) {

   for (size_t i = 0; i < arraysize(kJSTypes); i++) {
     Type* t0 = kJSTypes[i];
-    if (t0->Is(Type::String())) continue;  // skip Type::String
+ // Skip Type::String and Type::Receiver which might coerce into a string.
+    if (t0->Is(Type::String()) || t0->Is(Type::Receiver())) continue;
     Node* p0 = R.Parameter(t0, 0);

     for (size_t j = 0; j < arraysize(kJSTypes); j++) {
       Type* t1 = kJSTypes[j];
-      if (t1->Is(Type::String())) continue;  // skip Type::String
+ // Skip Type::String and Type::Receiver which might coerce into a string.
+      if (t1->Is(Type::String()) || t0->Is(Type::Receiver())) continue;
       Node* p1 = R.Parameter(t1, 1);

       for (size_t k = 0; k < arraysize(ops); k += 2) {
@@ -746,7 +748,7 @@ TEST(MixedComparison1) {
 TEST(ObjectComparison) {
   JSTypedLoweringTester R;

-  Node* p0 = R.Parameter(Type::Object(), 0);
+  Node* p0 = R.Parameter(Type::Number(), 0);
   Node* p1 = R.Parameter(Type::Object(), 1);

   Node* cmp = R.Binop(R.javascript.LessThan(), p0, p1);
@@ -762,14 +764,13 @@ TEST(ObjectComparison) {
   Node* i0 = r->InputAt(0);
   Node* i1 = r->InputAt(1);

-  CHECK_NE(p0, i0);
+  CHECK_EQ(p0, i0);
   CHECK_NE(p1, i1);
-  CHECK_EQ(IrOpcode::kJSToNumber, i0->opcode());
+  CHECK_EQ(IrOpcode::kParameter, i0->opcode());
   CHECK_EQ(IrOpcode::kJSToNumber, i1->opcode());

   // Check effect chain is correct.
-  R.CheckEffectInput(R.start(), i0);
-  R.CheckEffectInput(i0, i1);
+  R.CheckEffectInput(R.start(), i1);
   R.CheckEffectInput(i1, effect_use);
 }

@@ -1084,7 +1085,7 @@ TEST(OrderCompareEffects) {
   };

   for (size_t j = 0; j < arraysize(ops); j += 2) {
-    BinopEffectsTester B(ops[j], Type::Object(), Type::String());
+    BinopEffectsTester B(ops[j], Type::Boolean(), Type::String());
     CHECK_EQ(ops[j + 1]->opcode(), B.result->op()->opcode());

     Node* i0 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 0, true);
@@ -1099,7 +1100,7 @@ TEST(OrderCompareEffects) {
   }

   for (size_t j = 0; j < arraysize(ops); j += 2) {
-    BinopEffectsTester B(ops[j], Type::Number(), Type::Object());
+    BinopEffectsTester B(ops[j], Type::Number(), Type::Boolean());

     Node* i0 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 0, true);
     Node* i1 = B.result->InputAt(1);
@@ -1112,7 +1113,7 @@ TEST(OrderCompareEffects) {
   }

   for (size_t j = 0; j < arraysize(ops); j += 2) {
-    BinopEffectsTester B(ops[j], Type::Object(), Type::Number());
+    BinopEffectsTester B(ops[j], Type::Boolean(), Type::Number());

     Node* i0 = B.result->InputAt(0);
     Node* i1 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 1, true);


--
--
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/d/optout.

Reply via email to