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

Side by Side Diff: test/unittests/compiler/js-intrinsic-lowering-unittest.cc

Issue 1994503002: [turbofan] Turn common Guard operator into simplified TypeGuard. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/unittests/compiler/load-elimination-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/diamond.h" 6 #include "src/compiler/diamond.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-intrinsic-lowering.h" 8 #include "src/compiler/js-intrinsic-lowering.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "test/unittests/compiler/graph-unittest.h" 10 #include "test/unittests/compiler/graph-unittest.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleLo) { 85 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleLo) {
86 Node* const input = Parameter(0); 86 Node* const input = Parameter(0);
87 Node* const context = Parameter(1); 87 Node* const context = Parameter(1);
88 Node* const effect = graph()->start(); 88 Node* const effect = graph()->start();
89 Node* const control = graph()->start(); 89 Node* const control = graph()->start();
90 Reduction const r = Reduce( 90 Reduction const r = Reduce(
91 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleLo, 1), 91 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleLo, 1),
92 input, context, effect, control)); 92 input, context, effect, control));
93 ASSERT_TRUE(r.Changed()); 93 ASSERT_TRUE(r.Changed());
94 EXPECT_THAT(r.replacement(), 94 EXPECT_THAT(r.replacement(),
95 IsFloat64ExtractLowWord32(IsGuard(Type::Number(), input, _))); 95 IsFloat64ExtractLowWord32(IsTypeGuard(Type::Number(), input, _)));
96 } 96 }
97 97
98 98
99 // ----------------------------------------------------------------------------- 99 // -----------------------------------------------------------------------------
100 // %_DoubleHi 100 // %_DoubleHi
101 101
102 102
103 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleHi) { 103 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleHi) {
104 Node* const input = Parameter(0); 104 Node* const input = Parameter(0);
105 Node* const context = Parameter(1); 105 Node* const context = Parameter(1);
106 Node* const effect = graph()->start(); 106 Node* const effect = graph()->start();
107 Node* const control = graph()->start(); 107 Node* const control = graph()->start();
108 Reduction const r = Reduce( 108 Reduction const r = Reduce(
109 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleHi, 1), 109 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleHi, 1),
110 input, context, effect, control)); 110 input, context, effect, control));
111 ASSERT_TRUE(r.Changed()); 111 ASSERT_TRUE(r.Changed());
112 EXPECT_THAT(r.replacement(), 112 EXPECT_THAT(r.replacement(), IsFloat64ExtractHighWord32(
113 IsFloat64ExtractHighWord32(IsGuard(Type::Number(), input, _))); 113 IsTypeGuard(Type::Number(), input, _)));
114 } 114 }
115 115
116 116
117 // ----------------------------------------------------------------------------- 117 // -----------------------------------------------------------------------------
118 // %_IsSmi 118 // %_IsSmi
119 119
120 120
121 TEST_F(JSIntrinsicLoweringTest, InlineIsSmi) { 121 TEST_F(JSIntrinsicLoweringTest, InlineIsSmi) {
122 Node* const input = Parameter(0); 122 Node* const input = Parameter(0);
123 Node* const context = Parameter(1); 123 Node* const context = Parameter(1);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 CaptureEq(&if_false0)))))), 280 CaptureEq(&if_false0)))))),
281 IsMerge( 281 IsMerge(
282 IsIfTrue(AllOf(CaptureEq(&branch0), 282 IsIfTrue(AllOf(CaptureEq(&branch0),
283 IsBranch(IsObjectIsSmi(input), control))), 283 IsBranch(IsObjectIsSmi(input), control))),
284 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); 284 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0))))));
285 } 285 }
286 286
287 } // namespace compiler 287 } // namespace compiler
288 } // namespace internal 288 } // namespace internal
289 } // namespace v8 289 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/unittests/compiler/load-elimination-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698