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

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

Issue 1092353002: [strong] Disallow implicit conversions for binary arithmetic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback 5 Created 5 years, 8 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
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 6ba205850b6211fd3beb31bc8c70e855f3ab26a3..8652ed83934e4e437c8966da0de981dd49b8088b 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -455,8 +455,9 @@ TEST_F(JSTypedLoweringTest, JSShiftLeftWithSigned32AndConstant) {
Node* const control = graph()->start();
TRACED_FORRANGE(double, rhs, 0, 31) {
Reduction r =
- Reduce(graph()->NewNode(javascript()->ShiftLeft(), lhs,
- NumberConstant(rhs), context, effect, control));
+ Reduce(graph()->NewNode(javascript()->ShiftLeft(LanguageMode::SLOPPY),
+ lhs, NumberConstant(rhs), context, effect,
+ control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsWord32Shl(lhs, IsNumberConstant(BitEq(rhs))));
@@ -470,8 +471,9 @@ TEST_F(JSTypedLoweringTest, JSShiftLeftWithSigned32AndUnsigned32) {
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
- Reduction r = Reduce(graph()->NewNode(javascript()->ShiftLeft(), lhs, rhs,
- context, effect, control));
+ Reduction r =
+ Reduce(graph()->NewNode(javascript()->ShiftLeft(LanguageMode::SLOPPY),
+ lhs, rhs, context, effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsWord32Shl(lhs, IsWord32And(rhs, IsInt32Constant(0x1f))));
@@ -489,7 +491,8 @@ TEST_F(JSTypedLoweringTest, JSShiftRightWithSigned32AndConstant) {
Node* const control = graph()->start();
TRACED_FORRANGE(double, rhs, 0, 31) {
Reduction r =
- Reduce(graph()->NewNode(javascript()->ShiftRight(), lhs,
+ Reduce(graph()->NewNode(javascript()->
+ ShiftRight(LanguageMode::SLOPPY), lhs,
NumberConstant(rhs), context, effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
@@ -504,8 +507,9 @@ TEST_F(JSTypedLoweringTest, JSShiftRightWithSigned32AndUnsigned32) {
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
- Reduction r = Reduce(graph()->NewNode(javascript()->ShiftRight(), lhs, rhs,
- context, effect, control));
+ Reduction r = Reduce(graph()->NewNode(javascript()->
+ ShiftRight(LanguageMode::SLOPPY),
+ lhs, rhs, context, effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsWord32Sar(lhs, IsWord32And(rhs, IsInt32Constant(0x1f))));
@@ -516,15 +520,18 @@ TEST_F(JSTypedLoweringTest, JSShiftRightWithSigned32AndUnsigned32) {
// JSShiftRightLogical
-TEST_F(JSTypedLoweringTest, JSShiftRightLogicalWithUnsigned32AndConstant) {
+TEST_F(JSTypedLoweringTest,
+ JSShiftRightLogicalWithUnsigned32AndConstant) {
Node* const lhs = Parameter(Type::Unsigned32());
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
TRACED_FORRANGE(double, rhs, 0, 31) {
Reduction r =
- Reduce(graph()->NewNode(javascript()->ShiftRightLogical(), lhs,
- NumberConstant(rhs), context, effect, control));
+ Reduce(graph()->NewNode(javascript()->
+ ShiftRightLogical(LanguageMode::SLOPPY),
+ lhs, NumberConstant(rhs), context, effect,
+ control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsWord32Shr(lhs, IsNumberConstant(BitEq(rhs))));
@@ -532,14 +539,16 @@ TEST_F(JSTypedLoweringTest, JSShiftRightLogicalWithUnsigned32AndConstant) {
}
-TEST_F(JSTypedLoweringTest, JSShiftRightLogicalWithUnsigned32AndUnsigned32) {
+TEST_F(JSTypedLoweringTest,
+ JSShiftRightLogicalWithUnsigned32AndUnsigned32) {
Node* const lhs = Parameter(Type::Unsigned32());
Node* const rhs = Parameter(Type::Unsigned32());
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Node* const control = graph()->start();
- Reduction r = Reduce(graph()->NewNode(javascript()->ShiftRightLogical(), lhs,
- rhs, context, effect, control));
+ Reduction r = Reduce(graph()->NewNode(javascript()->
+ ShiftRightLogical(LanguageMode::SLOPPY),
+ lhs, rhs, context, effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
IsWord32Shr(lhs, IsWord32And(rhs, IsInt32Constant(0x1f))));

Powered by Google App Engine
This is Rietveld 408576698