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 "src/compiler/js-graph.h" | 5 #include "src/compiler/js-graph.h" |
6 #include "src/compiler/js-typed-lowering.h" | 6 #include "src/compiler/js-typed-lowering.h" |
7 #include "src/compiler/machine-operator.h" | 7 #include "src/compiler/machine-operator.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 Node* state_node = | 82 Node* state_node = |
83 graph.NewNode(common.FrameState(JS_FRAME, BailoutId::None(), | 83 graph.NewNode(common.FrameState(JS_FRAME, BailoutId::None(), |
84 OutputFrameStateCombine::Ignore()), | 84 OutputFrameStateCombine::Ignore()), |
85 parameters, locals, stack, context, UndefinedConstant()); | 85 parameters, locals, stack, context, UndefinedConstant()); |
86 | 86 |
87 return state_node; | 87 return state_node; |
88 } | 88 } |
89 | 89 |
90 Node* reduce(Node* node) { | 90 Node* reduce(Node* node) { |
91 JSGraph jsgraph(main_isolate(), &graph, &common, &javascript, &machine); | 91 JSGraph jsgraph(main_isolate(), &graph, &common, &javascript, &machine); |
92 JSTypedLowering reducer(&jsgraph, main_zone()); | 92 // TODO(titzer): mock the GraphReducer here for better unit testing. |
| 93 GraphReducer graph_reducer(&graph, main_zone()); |
| 94 JSTypedLowering reducer(&graph_reducer, &jsgraph, main_zone()); |
93 Reduction reduction = reducer.Reduce(node); | 95 Reduction reduction = reducer.Reduce(node); |
94 if (reduction.Changed()) return reduction.replacement(); | 96 if (reduction.Changed()) return reduction.replacement(); |
95 return node; | 97 return node; |
96 } | 98 } |
97 | 99 |
98 Node* start() { return graph.start(); } | 100 Node* start() { return graph.start(); } |
99 | 101 |
100 Node* context() { | 102 Node* context() { |
101 if (context_node == NULL) { | 103 if (context_node == NULL) { |
102 context_node = graph.NewNode(common.Parameter(-1), graph.start()); | 104 context_node = graph.NewNode(common.Parameter(-1), graph.start()); |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 CHECK_EQ(p1, r->InputAt(0)); | 1274 CHECK_EQ(p1, r->InputAt(0)); |
1273 CHECK_EQ(p0, r->InputAt(1)); | 1275 CHECK_EQ(p0, r->InputAt(1)); |
1274 } else { | 1276 } else { |
1275 CHECK_EQ(p0, r->InputAt(0)); | 1277 CHECK_EQ(p0, r->InputAt(0)); |
1276 CHECK_EQ(p1, r->InputAt(1)); | 1278 CHECK_EQ(p1, r->InputAt(1)); |
1277 } | 1279 } |
1278 } | 1280 } |
1279 } | 1281 } |
1280 } | 1282 } |
1281 } | 1283 } |
OLD | NEW |