OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |