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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 TEST_F(JSIntrinsicLoweringTest, InlineStringGetLength) { | 367 TEST_F(JSIntrinsicLoweringTest, InlineStringGetLength) { |
368 Node* const input = Parameter(0); | 368 Node* const input = Parameter(0); |
369 Node* const context = Parameter(1); | 369 Node* const context = Parameter(1); |
370 Node* const effect = graph()->start(); | 370 Node* const effect = graph()->start(); |
371 Node* const control = graph()->start(); | 371 Node* const control = graph()->start(); |
372 Reduction const r = Reduce(graph()->NewNode( | 372 Reduction const r = Reduce(graph()->NewNode( |
373 javascript()->CallRuntime(Runtime::kInlineStringGetLength, 1), input, | 373 javascript()->CallRuntime(Runtime::kInlineStringGetLength, 1), input, |
374 context, effect, control)); | 374 context, effect, control)); |
375 ASSERT_TRUE(r.Changed()); | 375 ASSERT_TRUE(r.Changed()); |
376 EXPECT_THAT(r.replacement(), | 376 EXPECT_THAT(r.replacement(), IsLoadField(AccessBuilder::ForStringLength(), |
377 IsLoadField(AccessBuilder::ForStringLength(zone()), input, effect, | 377 input, effect, control)); |
378 control)); | |
379 } | 378 } |
380 | 379 |
381 | 380 |
382 // ----------------------------------------------------------------------------- | 381 // ----------------------------------------------------------------------------- |
383 // %_MathClz32 | 382 // %_MathClz32 |
384 | 383 |
385 | 384 |
386 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { | 385 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { |
387 Node* const input = Parameter(0); | 386 Node* const input = Parameter(0); |
388 Node* const context = Parameter(1); | 387 Node* const context = Parameter(1); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 CaptureEq(&if_false0)))))), | 457 CaptureEq(&if_false0)))))), |
459 IsMerge( | 458 IsMerge( |
460 IsIfTrue(AllOf(CaptureEq(&branch0), | 459 IsIfTrue(AllOf(CaptureEq(&branch0), |
461 IsBranch(IsObjectIsSmi(input), control))), | 460 IsBranch(IsObjectIsSmi(input), control))), |
462 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 461 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
463 } | 462 } |
464 | 463 |
465 } // namespace compiler | 464 } // namespace compiler |
466 } // namespace internal | 465 } // namespace internal |
467 } // namespace v8 | 466 } // namespace v8 |
OLD | NEW |