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

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

Issue 2511223003: [turbofan] Properly optimize instanceof (even in the presence of @@hasInstance). (Closed)
Patch Set: Created 4 years, 1 month 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 6cd0cc8e68cffde5a79b59cd3947cab8cc59aed0..6883052abbf533c4bdc781a3d86c5c7bc16f23e7 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -860,43 +860,6 @@ TEST_F(JSTypedLoweringTest, JSSubtractSmis) {
}
// -----------------------------------------------------------------------------
-// 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, JSInstanceOfSpecialization) {
- Node* const context = Parameter(Type::Any());
- Node* const frame_state = EmptyFrameState();
- Node* const effect = graph()->start();
- Node* const control = graph()->start();
-
- Node* instanceOf =
- graph()->NewNode(javascript()->InstanceOf(), Parameter(Type::Any(), 0),
- HeapConstant(isolate()->object_function()), context,
- frame_state, effect, control);
- Reduction r = Reduce(instanceOf);
- ASSERT_TRUE(r.Changed());
-}
-
-
-TEST_F(JSTypedLoweringTest, JSInstanceOfNoSpecialization) {
- Node* const context = Parameter(Type::Any());
- Node* const frame_state = EmptyFrameState();
- Node* const effect = graph()->start();
- Node* const control = graph()->start();
-
- // Do not reduce if right-hand side is not a function constant.
- Node* instanceOf = graph()->NewNode(
- javascript()->InstanceOf(), Parameter(Type::Any(), 0),
- Parameter(Type::Any()), context, frame_state, effect, control);
- Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context,
- frame_state, effect, control);
- Reduction r = Reduce(instanceOf);
- ASSERT_FALSE(r.Changed());
- ASSERT_EQ(instanceOf, dummy->InputAt(0));
-}
-
-// -----------------------------------------------------------------------------
// JSBitwiseAnd
TEST_F(JSTypedLoweringTest, JSBitwiseAndWithSignedSmallHint) {
« src/compiler/js-native-context-specialization.cc ('K') | « test/mjsunit/compiler/instanceof.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698