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

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

Issue 2150553002: [turbofan] Introduces the SpeculativeNumberShiftLeft opcode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 5 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 | « test/mjsunit/compiler/turbo-number-feedback.js ('k') | test/unittests/compiler/node-test-utils.h » ('j') | 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 5128a3faba27fc4d1219eed9b02a58c77db8ed65..45af02c1ce3c6a15dfd9c2ace959e2ddd859d260 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -889,11 +889,30 @@ TEST_F(JSTypedLoweringTest, JSSubtractSmis) {
}
// -----------------------------------------------------------------------------
+// JSShiftLeft
+
+TEST_F(JSTypedLoweringTest, JSShiftLeftSmis) {
+ BinaryOperationHints const hints(BinaryOperationHints::kSignedSmall,
+ BinaryOperationHints::kSignedSmall,
+ BinaryOperationHints::kSignedSmall);
+ Node* lhs = Parameter(Type::Number(), 2);
+ Node* rhs = Parameter(Type::Number(), 3);
+ Node* effect = graph()->start();
+ Node* control = graph()->start();
+ Reduction r = Reduce(graph()->NewNode(
+ javascript()->ShiftLeft(hints), lhs, rhs, UndefinedConstant(),
+ EmptyFrameState(), EmptyFrameState(), effect, control));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(),
+ IsSpeculativeNumberShiftLeft(BinaryOperationHints::kSignedSmall,
+ lhs, rhs, effect, control));
+}
+
+// -----------------------------------------------------------------------------
// JSInstanceOf
// Test that instanceOf is reduced if and only if the right-hand side is a
// function constant. Functional correctness is ensured elsewhere.
-
TEST_F(JSTypedLoweringTest, JSInstanceOfSpecializationWithoutSmiCheck) {
Node* const context = Parameter(Type::Any());
Node* const frame_state = EmptyFrameState();
« no previous file with comments | « test/mjsunit/compiler/turbo-number-feedback.js ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698