| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class JSIntrinsicLoweringTest : public GraphTest { | 26 class JSIntrinsicLoweringTest : public GraphTest { |
| 27 public: | 27 public: |
| 28 JSIntrinsicLoweringTest() : GraphTest(3), javascript_(zone()) {} | 28 JSIntrinsicLoweringTest() : GraphTest(3), javascript_(zone()) {} |
| 29 ~JSIntrinsicLoweringTest() override {} | 29 ~JSIntrinsicLoweringTest() override {} |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags = | 32 Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags = |
| 33 MachineOperatorBuilder::kNoFlags) { | 33 MachineOperatorBuilder::kNoFlags) { |
| 34 MachineOperatorBuilder machine(zone(), kMachPtr, flags); | 34 MachineOperatorBuilder machine(zone(), kMachPtr, flags); |
| 35 JSGraph jsgraph(isolate(), graph(), common(), javascript(), nullptr, | 35 SimplifiedOperatorBuilder simplified(zone()); |
| 36 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &simplified, |
| 36 &machine); | 37 &machine); |
| 37 // TODO(titzer): mock the GraphReducer here for better unit testing. | 38 // TODO(titzer): mock the GraphReducer here for better unit testing. |
| 38 GraphReducer graph_reducer(zone(), graph()); | 39 GraphReducer graph_reducer(zone(), graph()); |
| 39 JSIntrinsicLowering reducer(&graph_reducer, &jsgraph, | 40 JSIntrinsicLowering reducer(&graph_reducer, &jsgraph, |
| 40 JSIntrinsicLowering::kDeoptimizationEnabled); | 41 JSIntrinsicLowering::kDeoptimizationEnabled); |
| 41 return reducer.Reduce(node); | 42 return reducer.Reduce(node); |
| 42 } | 43 } |
| 43 | 44 |
| 44 Node* EmptyFrameState() { | 45 Node* EmptyFrameState() { |
| 45 MachineOperatorBuilder machine(zone()); | 46 MachineOperatorBuilder machine(zone()); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 CaptureEq(&if_false0)))))), | 458 CaptureEq(&if_false0)))))), |
| 458 IsMerge( | 459 IsMerge( |
| 459 IsIfTrue(AllOf(CaptureEq(&branch0), | 460 IsIfTrue(AllOf(CaptureEq(&branch0), |
| 460 IsBranch(IsObjectIsSmi(input), control))), | 461 IsBranch(IsObjectIsSmi(input), control))), |
| 461 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 462 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
| 462 } | 463 } |
| 463 | 464 |
| 464 } // namespace compiler | 465 } // namespace compiler |
| 465 } // namespace internal | 466 } // namespace internal |
| 466 } // namespace v8 | 467 } // namespace v8 |
| OLD | NEW |