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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 using namespace v8::internal; | 29 using namespace v8::internal; |
30 using namespace v8::internal::compiler; | 30 using namespace v8::internal::compiler; |
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(), MaybeHandle<Context>()), | 38 typer(this->isolate(), this->graph(), nullptr, MaybeHandle<Context>()), |
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 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; |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 Node* p0; | 693 Node* p0; |
694 Node* p1; | 694 Node* p1; |
695 Node* p2; | 695 Node* p2; |
696 Node* start; | 696 Node* start; |
697 Node* end; | 697 Node* end; |
698 Node* ret; | 698 Node* ret; |
699 | 699 |
700 explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(), | 700 explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(), |
701 Type* p2_type = Type::None()) | 701 Type* p2_type = Type::None()) |
702 : GraphAndBuilders(main_zone()), | 702 : GraphAndBuilders(main_zone()), |
703 typer(main_isolate(), graph(), MaybeHandle<Context>()), | 703 typer(main_isolate(), graph(), nullptr, MaybeHandle<Context>()), |
704 javascript(main_zone()), | 704 javascript(main_zone()), |
705 jsgraph(main_isolate(), graph(), common(), &javascript, machine()) { | 705 jsgraph(main_isolate(), graph(), common(), &javascript, machine()) { |
706 start = graph()->NewNode(common()->Start(2)); | 706 start = graph()->NewNode(common()->Start(2)); |
707 graph()->SetStart(start); | 707 graph()->SetStart(start); |
708 ret = | 708 ret = |
709 graph()->NewNode(common()->Return(), jsgraph.Constant(0), start, start); | 709 graph()->NewNode(common()->Return(), jsgraph.Constant(0), start, start); |
710 end = graph()->NewNode(common()->End(1), ret); | 710 end = graph()->NewNode(common()->End(1), ret); |
711 graph()->SetEnd(end); | 711 graph()->SetEnd(end); |
712 p0 = graph()->NewNode(common()->Parameter(0), start); | 712 p0 = graph()->NewNode(common()->Parameter(0), start); |
713 p1 = graph()->NewNode(common()->Parameter(1), start); | 713 p1 = graph()->NewNode(common()->Parameter(1), start); |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); | 2086 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); |
2087 NodeProperties::SetBounds(phi, phi_bounds); | 2087 NodeProperties::SetBounds(phi, phi_bounds); |
2088 | 2088 |
2089 Node* use = t.Use(phi, d.use); | 2089 Node* use = t.Use(phi, d.use); |
2090 t.Return(use); | 2090 t.Return(use); |
2091 t.Lower(); | 2091 t.Lower(); |
2092 | 2092 |
2093 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); | 2093 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); |
2094 } | 2094 } |
2095 } | 2095 } |
OLD | NEW |