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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 Node* const control = graph()->start(); | 268 Node* const control = graph()->start(); |
269 Reduction const r = Reduce( | 269 Reduction const r = Reduce( |
270 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathSqrt, 1), | 270 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathSqrt, 1), |
271 input, context, effect, control)); | 271 input, context, effect, control)); |
272 ASSERT_TRUE(r.Changed()); | 272 ASSERT_TRUE(r.Changed()); |
273 EXPECT_THAT(r.replacement(), IsFloat64Sqrt(input)); | 273 EXPECT_THAT(r.replacement(), IsFloat64Sqrt(input)); |
274 } | 274 } |
275 | 275 |
276 | 276 |
277 // ----------------------------------------------------------------------------- | 277 // ----------------------------------------------------------------------------- |
278 // %_GetOrdinaryHasInstance | |
Michael Starzinger
2016/03/17 12:43:53
nit: Let's not squeeze this in between the test fo
mvstanton
2016/03/17 13:23:03
Done.
| |
279 | |
280 TEST_F(JSIntrinsicLoweringTest, InlineGetOrdinaryHasInstance) { | |
281 Node* const context = Parameter(0); | |
282 Node* const effect = graph()->start(); | |
283 Node* const control = graph()->start(); | |
284 Reduction const r = Reduce(graph()->NewNode( | |
285 javascript()->CallRuntime(Runtime::kInlineGetOrdinaryHasInstance, 0), | |
286 context, effect, control)); | |
287 ASSERT_TRUE(r.Changed()); | |
Michael Starzinger
2016/03/17 12:43:53
nit: Let's also check that ...
EXPECT_THAT(r.repl
mvstanton
2016/03/17 13:23:03
Done.
| |
288 } | |
289 | |
290 // ----------------------------------------------------------------------------- | |
278 // %_MathClz32 | 291 // %_MathClz32 |
279 | 292 |
280 | |
281 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { | 293 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { |
282 Node* const input = Parameter(0); | 294 Node* const input = Parameter(0); |
283 Node* const context = Parameter(1); | 295 Node* const context = Parameter(1); |
284 Node* const effect = graph()->start(); | 296 Node* const effect = graph()->start(); |
285 Node* const control = graph()->start(); | 297 Node* const control = graph()->start(); |
286 Reduction const r = Reduce( | 298 Reduction const r = Reduce( |
287 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathClz32, 1), | 299 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathClz32, 1), |
288 input, context, effect, control)); | 300 input, context, effect, control)); |
289 ASSERT_TRUE(r.Changed()); | 301 ASSERT_TRUE(r.Changed()); |
290 EXPECT_THAT(r.replacement(), IsWord32Clz(input)); | 302 EXPECT_THAT(r.replacement(), IsWord32Clz(input)); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 CaptureEq(&if_false0)))))), | 342 CaptureEq(&if_false0)))))), |
331 IsMerge( | 343 IsMerge( |
332 IsIfTrue(AllOf(CaptureEq(&branch0), | 344 IsIfTrue(AllOf(CaptureEq(&branch0), |
333 IsBranch(IsObjectIsSmi(input), control))), | 345 IsBranch(IsObjectIsSmi(input), control))), |
334 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 346 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
335 } | 347 } |
336 | 348 |
337 } // namespace compiler | 349 } // namespace compiler |
338 } // namespace internal | 350 } // namespace internal |
339 } // namespace v8 | 351 } // namespace v8 |
OLD | NEW |