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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 effect, CaptureEq(&if_false)), | 277 effect, CaptureEq(&if_false)), |
278 effect, _), | 278 effect, _), |
279 IsInt32Constant(JS_REGEXP_TYPE)), | 279 IsInt32Constant(JS_REGEXP_TYPE)), |
280 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), | 280 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), |
281 IsBranch(IsObjectIsSmi(input), control))), | 281 IsBranch(IsObjectIsSmi(input), control))), |
282 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); | 282 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); |
283 } | 283 } |
284 | 284 |
285 | 285 |
286 // ----------------------------------------------------------------------------- | 286 // ----------------------------------------------------------------------------- |
287 // %_IsSpecObject | 287 // %_IsJSReceiver |
288 | 288 |
289 | 289 |
290 TEST_F(JSIntrinsicLoweringTest, InlineIsSpecObject) { | 290 TEST_F(JSIntrinsicLoweringTest, InlineIsJSReceiver) { |
291 Node* const input = Parameter(0); | 291 Node* const input = Parameter(0); |
292 Node* const context = Parameter(1); | 292 Node* const context = Parameter(1); |
293 Node* const effect = graph()->start(); | 293 Node* const effect = graph()->start(); |
294 Node* const control = graph()->start(); | 294 Node* const control = graph()->start(); |
295 Reduction const r = Reduce(graph()->NewNode( | 295 Reduction const r = Reduce(graph()->NewNode( |
296 javascript()->CallRuntime(Runtime::kInlineIsSpecObject, 1), input, | 296 javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1), input, |
297 context, effect, control)); | 297 context, effect, control)); |
298 ASSERT_TRUE(r.Changed()); | 298 ASSERT_TRUE(r.Changed()); |
299 | 299 |
300 Node* phi = r.replacement(); | 300 Node* phi = r.replacement(); |
301 Capture<Node *> branch, if_false; | 301 Capture<Node *> branch, if_false; |
302 EXPECT_THAT( | 302 EXPECT_THAT( |
303 phi, | 303 phi, |
304 IsPhi( | 304 IsPhi( |
305 static_cast<MachineType>(kTypeBool | kRepTagged), IsFalseConstant(), | 305 static_cast<MachineType>(kTypeBool | kRepTagged), IsFalseConstant(), |
306 IsUint32LessThanOrEqual( | 306 IsUint32LessThanOrEqual( |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 CaptureEq(&if_false0)))))), | 441 CaptureEq(&if_false0)))))), |
442 IsMerge( | 442 IsMerge( |
443 IsIfTrue(AllOf(CaptureEq(&branch0), | 443 IsIfTrue(AllOf(CaptureEq(&branch0), |
444 IsBranch(IsObjectIsSmi(input), control))), | 444 IsBranch(IsObjectIsSmi(input), control))), |
445 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 445 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
446 } | 446 } |
447 | 447 |
448 } // namespace compiler | 448 } // namespace compiler |
449 } // namespace internal | 449 } // namespace internal |
450 } // namespace v8 | 450 } // namespace v8 |
OLD | NEW |