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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/change-lowering.h" | 9 #include "src/compiler/change-lowering.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 this->End(); | 53 this->End(); |
54 typer.Run(); | 54 typer.Run(); |
55 lowering.LowerAllNodes(); | 55 lowering.LowerAllNodes(); |
56 } | 56 } |
57 | 57 |
58 void LowerAllNodesAndLowerChanges() { | 58 void LowerAllNodesAndLowerChanges() { |
59 this->End(); | 59 this->End(); |
60 typer.Run(); | 60 typer.Run(); |
61 lowering.LowerAllNodes(); | 61 lowering.LowerAllNodes(); |
62 | 62 |
63 ChangeLowering lowering(&jsgraph); | |
64 GraphReducer reducer(this->zone(), this->graph()); | 63 GraphReducer reducer(this->zone(), this->graph()); |
| 64 ChangeLowering lowering(&reducer, &jsgraph); |
65 reducer.AddReducer(&lowering); | 65 reducer.AddReducer(&lowering); |
66 reducer.ReduceGraph(); | 66 reducer.ReduceGraph(); |
67 Verifier::Run(this->graph()); | 67 Verifier::Run(this->graph()); |
68 } | 68 } |
69 | 69 |
70 void CheckNumberCall(double expected, double input) { | 70 void CheckNumberCall(double expected, double input) { |
71 // TODO(titzer): make calls to NewNumber work in cctests. | 71 // TODO(titzer): make calls to NewNumber work in cctests. |
72 if (expected <= Smi::kMinValue) return; | 72 if (expected <= Smi::kMinValue) return; |
73 if (expected >= Smi::kMaxValue) return; | 73 if (expected >= Smi::kMaxValue) return; |
74 Handle<Object> num = factory()->NewNumber(input); | 74 Handle<Object> num = factory()->NewNumber(input); |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 719 |
720 void Lower() { | 720 void Lower() { |
721 SourcePositionTable table(jsgraph.graph()); | 721 SourcePositionTable table(jsgraph.graph()); |
722 SimplifiedLowering(&jsgraph, jsgraph.zone(), &table).LowerAllNodes(); | 722 SimplifiedLowering(&jsgraph, jsgraph.zone(), &table).LowerAllNodes(); |
723 } | 723 } |
724 | 724 |
725 void LowerAllNodesAndLowerChanges() { | 725 void LowerAllNodesAndLowerChanges() { |
726 SourcePositionTable table(jsgraph.graph()); | 726 SourcePositionTable table(jsgraph.graph()); |
727 SimplifiedLowering(&jsgraph, jsgraph.zone(), &table).LowerAllNodes(); | 727 SimplifiedLowering(&jsgraph, jsgraph.zone(), &table).LowerAllNodes(); |
728 | 728 |
729 ChangeLowering lowering(&jsgraph); | |
730 GraphReducer reducer(this->zone(), this->graph()); | 729 GraphReducer reducer(this->zone(), this->graph()); |
| 730 ChangeLowering lowering(&reducer, &jsgraph); |
731 reducer.AddReducer(&lowering); | 731 reducer.AddReducer(&lowering); |
732 reducer.ReduceGraph(); | 732 reducer.ReduceGraph(); |
733 Verifier::Run(this->graph()); | 733 Verifier::Run(this->graph()); |
734 } | 734 } |
735 | 735 |
736 // Inserts the node as the return value of the graph. | 736 // Inserts the node as the return value of the graph. |
737 Node* Return(Node* node) { | 737 Node* Return(Node* node) { |
738 ret->ReplaceInput(0, node); | 738 ret->ReplaceInput(0, node); |
739 return node; | 739 return node; |
740 } | 740 } |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 t.Return(use); | 1963 t.Return(use); |
1964 t.Lower(); | 1964 t.Lower(); |
1965 | 1965 |
1966 CHECK_EQ(d.expected, PhiRepresentationOf(phi->op())); | 1966 CHECK_EQ(d.expected, PhiRepresentationOf(phi->op())); |
1967 } | 1967 } |
1968 } | 1968 } |
1969 | 1969 |
1970 } // namespace compiler | 1970 } // namespace compiler |
1971 } // namespace internal | 1971 } // namespace internal |
1972 } // namespace v8 | 1972 } // namespace v8 |
OLD | NEW |