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

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

Issue 2263273003: [turbofan] Improve fast case of JSInstanceOf lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
« src/compiler/js-typed-lowering.cc ('K') | « src/compiler/js-typed-lowering.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 6b418d706d99e21ac50210f27f6fae2c31b9cd2d..fc30a5c6a5347a90c1c5f3cc149b1f4529dbe3be 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -1025,43 +1025,18 @@ TEST_F(JSTypedLoweringTest, JSSubtractSmis) {
// 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) {
+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();
- // Reduce if left-hand side is known to be an object.
- Node* instanceOf =
- graph()->NewNode(javascript()->InstanceOf(), Parameter(Type::Object(), 0),
- HeapConstant(isolate()->object_function()), context,
- frame_state, effect, control);
- Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context,
- frame_state, effect, control);
- Reduction r = Reduce(instanceOf);
- ASSERT_TRUE(r.Changed());
- ASSERT_EQ(r.replacement(), dummy->InputAt(0));
- ASSERT_NE(instanceOf, dummy->InputAt(0));
-}
-
-
-TEST_F(JSTypedLoweringTest, JSInstanceOfSpecializationWithSmiCheck) {
- Node* const context = Parameter(Type::Any());
- Node* const frame_state = EmptyFrameState();
- Node* const effect = graph()->start();
- Node* const control = graph()->start();
-
- // Reduce if left-hand side could be a Smi.
Node* instanceOf =
graph()->NewNode(javascript()->InstanceOf(), Parameter(Type::Any(), 0),
HeapConstant(isolate()->object_function()), context,
frame_state, effect, control);
- Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context,
- frame_state, effect, control);
Reduction r = Reduce(instanceOf);
ASSERT_TRUE(r.Changed());
- ASSERT_EQ(r.replacement(), dummy->InputAt(0));
- ASSERT_NE(instanceOf, dummy->InputAt(0));
}
« src/compiler/js-typed-lowering.cc ('K') | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698