From d20bd6dac14739f1723c89cf1f6f51f4fac8fa1b Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Tue, 16 Sep 2014 12:17:40 +0000 Subject: [PATCH] Adapt some typed lowering unit tests after r23972. R=rossberg@chromium.org TEST=cctest/test-js-typed-lowering Review URL: https://codereview.chromium.org/574713002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23973 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/cctest/compiler/test-js-typed-lowering.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc index fb63583..861cf39 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); -- 2.7.4