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

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

Issue 1494973002: [turbofan] Introduce ToBooleanHints on ToBoolean operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « test/unittests/compiler/js-operator-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/js-typed-lowering-unittest.cc
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
index a92a68c5826a143840cffbe679e0ca8134af7de6..dc5825326d2e13941c3d16b2662371cbd1c76e8c 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -224,8 +224,9 @@ TEST_F(JSTypedLoweringTest, ParameterWithUndefined) {
TEST_F(JSTypedLoweringTest, JSToBooleanWithBoolean) {
Node* input = Parameter(Type::Boolean(), 0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_TRUE(r.Changed());
EXPECT_EQ(input, r.replacement());
}
@@ -253,8 +254,9 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithFalsish) {
zone()),
0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsFalseConstant());
}
@@ -268,8 +270,9 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithTruish) {
zone()),
0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsTrueConstant());
}
@@ -278,8 +281,9 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithTruish) {
TEST_F(JSTypedLoweringTest, JSToBooleanWithNonZeroPlainNumber) {
Node* input = Parameter(Type::Range(1, V8_INFINITY, zone()), 0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsTrueConstant());
}
@@ -288,8 +292,9 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithNonZeroPlainNumber) {
TEST_F(JSTypedLoweringTest, JSToBooleanWithOrderedNumber) {
Node* input = Parameter(Type::OrderedNumber(), 0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsBooleanNot(IsNumberEqual(input, IsNumberConstant(0.0))));
@@ -299,8 +304,9 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithOrderedNumber) {
TEST_F(JSTypedLoweringTest, JSToBooleanWithString) {
Node* input = Parameter(Type::String(), 0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
@@ -313,8 +319,9 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithString) {
TEST_F(JSTypedLoweringTest, JSToBooleanWithAny) {
Node* input = Parameter(Type::Any(), 0);
Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->ToBoolean(), input,
- context, graph()->start()));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
+ input, context, graph()->start()));
ASSERT_FALSE(r.Changed());
}
« no previous file with comments | « test/unittests/compiler/js-operator-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698