Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1290)

Unified Diff: test/cctest/compiler/test-js-typed-lowering.cc

Issue 649543004: [turbofan] Correctify typed lowering. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9dbe3304c3bcfa2d271e017ce924fbc257126cc7..d48a462c1f3b38a95d4b353eaed548cfa5f10636 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -308,7 +308,7 @@ TEST(Int32BitwiseShifts) {
Type::Unsigned32(), Type::Signed32(), Type::MinusZero(),
Type::NaN(), Type::OtherNumber(), Type::Undefined(),
Type::Null(), Type::Boolean(), Type::Number(),
- Type::String(), Type::Object()};
+ Type::String()};
for (size_t i = 0; i < arraysize(types); ++i) {
Node* p0 = R.Parameter(types[i], 0);
@@ -367,8 +367,7 @@ TEST(Int32BitwiseBinops) {
Type::SignedSmall(), Type::UnsignedSmall(), Type::Unsigned32(),
Type::Signed32(), Type::MinusZero(), Type::NaN(),
Type::OtherNumber(), Type::Undefined(), Type::Null(),
- Type::Boolean(), Type::Number(), Type::String(),
- Type::Object()};
+ Type::Boolean(), Type::Number(), Type::String()};
for (size_t i = 0; i < arraysize(types); ++i) {
Node* p0 = R.Parameter(types[i], 0);
@@ -691,33 +690,22 @@ TEST(NumberComparison) {
R.javascript.GreaterThan(), R.simplified.NumberLessThan(),
R.javascript.GreaterThanOrEqual(), R.simplified.NumberLessThanOrEqual()};
- for (size_t i = 0; i < arraysize(kJSTypes); i++) {
- Type* t0 = kJSTypes[i];
- // 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);
+ Node* const p0 = R.Parameter(Type::Number(), 0);
+ Node* const p1 = R.Parameter(Type::Number(), 1);
- for (size_t j = 0; j < arraysize(kJSTypes); j++) {
- Type* t1 = kJSTypes[j];
- // 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) {
+ Node* cmp = R.Binop(ops[k], p0, p1);
+ Node* r = R.reduce(cmp);
- for (size_t k = 0; k < arraysize(ops); k += 2) {
- Node* cmp = R.Binop(ops[k], p0, p1);
- Node* r = R.reduce(cmp);
-
- R.CheckPureBinop(ops[k + 1], r);
- if (k >= 4) {
- // GreaterThan and GreaterThanOrEqual commute the inputs
- // and use the LessThan and LessThanOrEqual operators.
- CheckIsConvertedToNumber(p1, r->InputAt(0));
- CheckIsConvertedToNumber(p0, r->InputAt(1));
- } else {
- CheckIsConvertedToNumber(p0, r->InputAt(0));
- CheckIsConvertedToNumber(p1, r->InputAt(1));
- }
- }
+ R.CheckPureBinop(ops[k + 1], r);
+ if (k >= 4) {
+ // GreaterThan and GreaterThanOrEqual commute the inputs
+ // and use the LessThan and LessThanOrEqual operators.
+ CheckIsConvertedToNumber(p1, r->InputAt(0));
+ CheckIsConvertedToNumber(p0, r->InputAt(1));
+ } else {
+ CheckIsConvertedToNumber(p0, r->InputAt(0));
+ CheckIsConvertedToNumber(p1, r->InputAt(1));
}
}
}
@@ -754,36 +742,6 @@ TEST(MixedComparison1) {
}
-TEST(ObjectComparison) {
- JSTypedLoweringTester R;
-
- Node* p0 = R.Parameter(Type::Number(), 0);
- Node* p1 = R.Parameter(Type::Object(), 1);
-
- Node* cmp = R.Binop(R.javascript.LessThan(), p0, p1);
- Node* effect_use = R.UseForEffect(cmp);
-
- R.CheckEffectInput(R.start(), cmp);
- R.CheckEffectInput(cmp, effect_use);
-
- Node* r = R.reduce(cmp);
-
- R.CheckPureBinop(R.simplified.NumberLessThan(), r);
-
- Node* i0 = r->InputAt(0);
- Node* i1 = r->InputAt(1);
-
- CHECK_EQ(p0, i0);
- CHECK_NE(p1, i1);
- CHECK_EQ(IrOpcode::kParameter, i0->opcode());
- CHECK_EQ(IrOpcode::kJSToNumber, i1->opcode());
-
- // Check effect chain is correct.
- R.CheckEffectInput(R.start(), i1);
- R.CheckEffectInput(i1, effect_use);
-}
-
-
TEST(UnaryNot) {
JSTypedLoweringTester R;
const Operator* opnot = R.javascript.UnaryNot();
@@ -1031,7 +989,7 @@ TEST(OrderNumberBinopEffects1) {
};
for (size_t j = 0; j < arraysize(ops); j += 2) {
- BinopEffectsTester B(ops[j], Type::Object(), Type::String());
+ BinopEffectsTester B(ops[j], Type::String(), Type::String());
CHECK_EQ(ops[j + 1]->opcode(), B.result->op()->opcode());
Node* i0 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 0, true);
@@ -1167,7 +1125,7 @@ TEST(Int32BinopEffects) {
for (int j = 0; j < R.kNumberOps; j += 2) {
bool signed_left = R.signedness[j], signed_right = R.signedness[j + 1];
- BinopEffectsTester B(R.ops[j], Type::Number(), Type::Object());
+ BinopEffectsTester B(R.ops[j], Type::Number(), Type::Primitive());
B.R.CheckPureBinop(B.result->opcode(), B.result);
@@ -1184,7 +1142,7 @@ TEST(Int32BinopEffects) {
for (int j = 0; j < R.kNumberOps; j += 2) {
bool signed_left = R.signedness[j], signed_right = R.signedness[j + 1];
- BinopEffectsTester B(R.ops[j], Type::Object(), Type::Number());
+ BinopEffectsTester B(R.ops[j], Type::Primitive(), Type::Number());
B.R.CheckPureBinop(B.result->opcode(), B.result);
@@ -1201,7 +1159,7 @@ TEST(Int32BinopEffects) {
for (int j = 0; j < R.kNumberOps; j += 2) {
bool signed_left = R.signedness[j], signed_right = R.signedness[j + 1];
- BinopEffectsTester B(R.ops[j], Type::Object(), Type::Object());
+ BinopEffectsTester B(R.ops[j], Type::Primitive(), Type::Primitive());
B.R.CheckPureBinop(B.result->opcode(), B.result);
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698