OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/change-lowering.h" | 8 #include "src/compiler/change-lowering.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/graph-reducer.h" | 10 #include "src/compiler/graph-reducer.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 template <typename ReturnType> | 32 template <typename ReturnType> |
33 class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> { | 33 class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> { |
34 public: | 34 public: |
35 SimplifiedLoweringTester(MachineType p0 = kMachNone, | 35 SimplifiedLoweringTester(MachineType p0 = kMachNone, |
36 MachineType p1 = kMachNone) | 36 MachineType p1 = kMachNone) |
37 : GraphBuilderTester<ReturnType>(p0, p1), | 37 : GraphBuilderTester<ReturnType>(p0, p1), |
38 typer(this->isolate(), this->graph()), | 38 typer(this->isolate(), this->graph()), |
39 javascript(this->zone()), | 39 javascript(this->zone()), |
40 jsgraph(this->isolate(), this->graph(), this->common(), &javascript, | 40 jsgraph(this->isolate(), this->graph(), this->common(), &javascript, |
41 this->machine()), | 41 nullptr, this->machine()), |
42 source_positions(jsgraph.graph()), | 42 source_positions(jsgraph.graph()), |
43 lowering(&jsgraph, this->zone(), &source_positions) {} | 43 lowering(&jsgraph, this->zone(), &source_positions) {} |
44 | 44 |
45 Typer typer; | 45 Typer typer; |
46 JSOperatorBuilder javascript; | 46 JSOperatorBuilder javascript; |
47 JSGraph jsgraph; | 47 JSGraph jsgraph; |
48 SourcePositionTable source_positions; | 48 SourcePositionTable source_positions; |
49 SimplifiedLowering lowering; | 49 SimplifiedLowering lowering; |
50 | 50 |
51 void LowerAllNodes() { | 51 void LowerAllNodes() { |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 Node* p2; | 669 Node* p2; |
670 Node* start; | 670 Node* start; |
671 Node* end; | 671 Node* end; |
672 Node* ret; | 672 Node* ret; |
673 | 673 |
674 explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(), | 674 explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(), |
675 Type* p2_type = Type::None()) | 675 Type* p2_type = Type::None()) |
676 : GraphAndBuilders(main_zone()), | 676 : GraphAndBuilders(main_zone()), |
677 typer(main_isolate(), graph()), | 677 typer(main_isolate(), graph()), |
678 javascript(main_zone()), | 678 javascript(main_zone()), |
679 jsgraph(main_isolate(), graph(), common(), &javascript, machine()) { | 679 jsgraph(main_isolate(), graph(), common(), &javascript, nullptr, |
| 680 machine()) { |
680 start = graph()->NewNode(common()->Start(2)); | 681 start = graph()->NewNode(common()->Start(2)); |
681 graph()->SetStart(start); | 682 graph()->SetStart(start); |
682 ret = | 683 ret = |
683 graph()->NewNode(common()->Return(), jsgraph.Constant(0), start, start); | 684 graph()->NewNode(common()->Return(), jsgraph.Constant(0), start, start); |
684 end = graph()->NewNode(common()->End(1), ret); | 685 end = graph()->NewNode(common()->End(1), ret); |
685 graph()->SetEnd(end); | 686 graph()->SetEnd(end); |
686 p0 = graph()->NewNode(common()->Parameter(0), start); | 687 p0 = graph()->NewNode(common()->Parameter(0), start); |
687 p1 = graph()->NewNode(common()->Parameter(1), start); | 688 p1 = graph()->NewNode(common()->Parameter(1), start); |
688 p2 = graph()->NewNode(common()->Parameter(2), start); | 689 p2 = graph()->NewNode(common()->Parameter(2), start); |
689 typer.Run(); | 690 typer.Run(); |
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 Type* phi_type = Type::Union(d.arg1, d.arg2, z); | 1996 Type* phi_type = Type::Union(d.arg1, d.arg2, z); |
1996 NodeProperties::SetType(phi, phi_type); | 1997 NodeProperties::SetType(phi, phi_type); |
1997 | 1998 |
1998 Node* use = t.Use(phi, d.use); | 1999 Node* use = t.Use(phi, d.use); |
1999 t.Return(use); | 2000 t.Return(use); |
2000 t.Lower(); | 2001 t.Lower(); |
2001 | 2002 |
2002 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); | 2003 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); |
2003 } | 2004 } |
2004 } | 2005 } |
OLD | NEW |