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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 JSOperatorBuilder* javascript() { return &javascript_; } | 46 JSOperatorBuilder* javascript() { return &javascript_; } |
47 | 47 |
48 private: | 48 private: |
49 JSOperatorBuilder javascript_; | 49 JSOperatorBuilder javascript_; |
50 }; | 50 }; |
51 | 51 |
52 | 52 |
53 // ----------------------------------------------------------------------------- | 53 // ----------------------------------------------------------------------------- |
54 // %_ConstructDouble | |
55 | |
56 | |
57 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedConstructDouble) { | |
58 Node* const input0 = Parameter(0); | |
59 Node* const input1 = Parameter(1); | |
60 Node* const context = Parameter(2); | |
61 Node* const effect = graph()->start(); | |
62 Node* const control = graph()->start(); | |
63 Reduction const r = Reduce(graph()->NewNode( | |
64 javascript()->CallRuntime(Runtime::kInlineConstructDouble, 2), input0, | |
65 input1, context, effect, control)); | |
66 ASSERT_TRUE(r.Changed()); | |
67 EXPECT_THAT(r.replacement(), IsFloat64InsertHighWord32( | |
68 IsFloat64InsertLowWord32( | |
69 IsNumberConstant(BitEq(0.0)), input1), | |
70 input0)); | |
71 } | |
72 | |
73 | |
74 // ----------------------------------------------------------------------------- | |
75 // %_DoubleLo | 54 // %_DoubleLo |
76 | 55 |
77 | 56 |
78 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleLo) { | 57 TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleLo) { |
79 Node* const input = Parameter(0); | 58 Node* const input = Parameter(0); |
80 Node* const context = Parameter(1); | 59 Node* const context = Parameter(1); |
81 Node* const effect = graph()->start(); | 60 Node* const effect = graph()->start(); |
82 Node* const control = graph()->start(); | 61 Node* const control = graph()->start(); |
83 Reduction const r = Reduce( | 62 Reduction const r = Reduce( |
84 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleLo, 1), | 63 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleLo, 1), |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 CaptureEq(&if_false0)))))), | 252 CaptureEq(&if_false0)))))), |
274 IsMerge( | 253 IsMerge( |
275 IsIfTrue(AllOf(CaptureEq(&branch0), | 254 IsIfTrue(AllOf(CaptureEq(&branch0), |
276 IsBranch(IsObjectIsSmi(input), control))), | 255 IsBranch(IsObjectIsSmi(input), control))), |
277 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 256 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
278 } | 257 } |
279 | 258 |
280 } // namespace compiler | 259 } // namespace compiler |
281 } // namespace internal | 260 } // namespace internal |
282 } // namespace v8 | 261 } // namespace v8 |
OLD | NEW |