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

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

Issue 2184513003: [turbofan] Adds handling of number or oddball type feedback to SpeculativeNumberShiftLeft. (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') | 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 8253418519a4d13fb30460bd2a93588a891e84a2..4ae44ee97f28f44207195618b40435863c238fbf 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -910,6 +910,23 @@ TEST_F(JSTypedLoweringTest, JSShiftLeftSmis) {
lhs, rhs, effect, control));
}
+TEST_F(JSTypedLoweringTest, JSShiftLeftNumberOrOddball) {
+ BinaryOperationHints const hints(BinaryOperationHints::kNumberOrOddball,
+ BinaryOperationHints::kNumberOrOddball,
+ BinaryOperationHints::kNumberOrOddball);
+ 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::kNumberOrOddball, lhs,
+ rhs, effect, control));
+}
+
// -----------------------------------------------------------------------------
// JSInstanceOf
// Test that instanceOf is reduced if and only if the right-hand side is a
« no previous file with comments | « test/mjsunit/compiler/turbo-number-feedback.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698