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 15 matching lines...) Expand all Loading... |
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(), &machine); | 35 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
36 JSIntrinsicLowering reducer(&jsgraph); | 36 // TODO(titzer): mock the GraphReducer here for better unit testing. |
| 37 GraphReducer graph_reducer(graph(), zone()); |
| 38 JSIntrinsicLowering reducer(&graph_reducer, &jsgraph); |
37 return reducer.Reduce(node); | 39 return reducer.Reduce(node); |
38 } | 40 } |
39 | 41 |
40 Node* EmptyFrameState() { | 42 Node* EmptyFrameState() { |
41 MachineOperatorBuilder machine(zone()); | 43 MachineOperatorBuilder machine(zone()); |
42 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); | 44 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
43 return jsgraph.EmptyFrameState(); | 45 return jsgraph.EmptyFrameState(); |
44 } | 46 } |
45 | 47 |
46 JSOperatorBuilder* javascript() { return &javascript_; } | 48 JSOperatorBuilder* javascript() { return &javascript_; } |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 CaptureEq(&if_false0)))))), | 409 CaptureEq(&if_false0)))))), |
408 IsMerge( | 410 IsMerge( |
409 IsIfTrue(AllOf(CaptureEq(&branch0), | 411 IsIfTrue(AllOf(CaptureEq(&branch0), |
410 IsBranch(IsObjectIsSmi(input), control))), | 412 IsBranch(IsObjectIsSmi(input), control))), |
411 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); | 413 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); |
412 } | 414 } |
413 | 415 |
414 } // namespace compiler | 416 } // namespace compiler |
415 } // namespace internal | 417 } // namespace internal |
416 } // namespace v8 | 418 } // namespace v8 |
OLD | NEW |