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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 TEST_F(JSIntrinsicLoweringTest, InlineStringGetLength) { | 310 TEST_F(JSIntrinsicLoweringTest, InlineStringGetLength) { |
311 Node* const input = Parameter(0); | 311 Node* const input = Parameter(0); |
312 Node* const context = Parameter(1); | 312 Node* const context = Parameter(1); |
313 Node* const effect = graph()->start(); | 313 Node* const effect = graph()->start(); |
314 Node* const control = graph()->start(); | 314 Node* const control = graph()->start(); |
315 Reduction const r = Reduce(graph()->NewNode( | 315 Reduction const r = Reduce(graph()->NewNode( |
316 javascript()->CallRuntime(Runtime::kInlineStringGetLength, 1), input, | 316 javascript()->CallRuntime(Runtime::kInlineStringGetLength, 1), input, |
317 context, effect, control)); | 317 context, effect, control)); |
318 ASSERT_TRUE(r.Changed()); | 318 ASSERT_TRUE(r.Changed()); |
319 EXPECT_THAT(r.replacement(), IsLoadField(AccessBuilder::ForStringLength(), | 319 EXPECT_THAT(r.replacement(), |
320 input, effect, control)); | 320 IsLoadField(AccessBuilder::ForStringLength(zone()), input, effect, |
| 321 control)); |
321 } | 322 } |
322 | 323 |
323 | 324 |
324 // ----------------------------------------------------------------------------- | 325 // ----------------------------------------------------------------------------- |
325 // %_MathClz32 | 326 // %_MathClz32 |
326 | 327 |
327 | 328 |
328 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { | 329 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { |
329 Node* const input = Parameter(0); | 330 Node* const input = Parameter(0); |
330 Node* const context = Parameter(1); | 331 Node* const context = Parameter(1); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 CaptureEq(&if_false0)))))), | 401 CaptureEq(&if_false0)))))), |
401 IsMerge( | 402 IsMerge( |
402 IsIfTrue(AllOf(CaptureEq(&branch0), | 403 IsIfTrue(AllOf(CaptureEq(&branch0), |
403 IsBranch(IsObjectIsSmi(input), control))), | 404 IsBranch(IsObjectIsSmi(input), control))), |
404 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 405 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
405 } | 406 } |
406 | 407 |
407 } // namespace compiler | 408 } // namespace compiler |
408 } // namespace internal | 409 } // namespace internal |
409 } // namespace v8 | 410 } // namespace v8 |
OLD | NEW |