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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include "src/base/platform/elapsed-timer.h" | 7 #include "src/base/platform/elapsed-timer.h" |
8 #include "src/compiler/ast-graph-builder.h" | 8 #include "src/compiler/ast-graph-builder.h" |
| 9 #include "src/compiler/change-lowering.h" |
9 #include "src/compiler/code-generator.h" | 10 #include "src/compiler/code-generator.h" |
10 #include "src/compiler/graph-replay.h" | 11 #include "src/compiler/graph-replay.h" |
11 #include "src/compiler/graph-visualizer.h" | 12 #include "src/compiler/graph-visualizer.h" |
12 #include "src/compiler/instruction.h" | 13 #include "src/compiler/instruction.h" |
13 #include "src/compiler/instruction-selector.h" | 14 #include "src/compiler/instruction-selector.h" |
14 #include "src/compiler/js-context-specialization.h" | 15 #include "src/compiler/js-context-specialization.h" |
15 #include "src/compiler/js-generic-lowering.h" | 16 #include "src/compiler/js-generic-lowering.h" |
16 #include "src/compiler/js-inlining.h" | 17 #include "src/compiler/js-inlining.h" |
17 #include "src/compiler/js-typed-lowering.h" | 18 #include "src/compiler/js-typed-lowering.h" |
18 #include "src/compiler/phi-reducer.h" | 19 #include "src/compiler/phi-reducer.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 "typed lowering"); | 227 "typed lowering"); |
227 SourcePositionTable::Scope pos(&source_positions, | 228 SourcePositionTable::Scope pos(&source_positions, |
228 SourcePosition::Unknown()); | 229 SourcePosition::Unknown()); |
229 JSTypedLowering lowering(&jsgraph); | 230 JSTypedLowering lowering(&jsgraph); |
230 GraphReducer graph_reducer(&graph); | 231 GraphReducer graph_reducer(&graph); |
231 graph_reducer.AddReducer(&lowering); | 232 graph_reducer.AddReducer(&lowering); |
232 graph_reducer.ReduceGraph(); | 233 graph_reducer.ReduceGraph(); |
233 | 234 |
234 VerifyAndPrintGraph(&graph, "Lowered typed"); | 235 VerifyAndPrintGraph(&graph, "Lowered typed"); |
235 } | 236 } |
| 237 { |
| 238 // Lower simplified operators and insert changes. |
| 239 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, |
| 240 "simplified lowering"); |
| 241 SourcePositionTable::Scope pos(&source_positions, |
| 242 SourcePosition::Unknown()); |
| 243 SimplifiedLowering lowering(&jsgraph); |
| 244 lowering.LowerAllNodes(); |
| 245 |
| 246 VerifyAndPrintGraph(&graph, "Lowered simplified"); |
| 247 } |
| 248 { |
| 249 // Lower changes that have been inserted before. |
| 250 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, |
| 251 "change lowering"); |
| 252 SourcePositionTable::Scope pos(&source_positions, |
| 253 SourcePosition::Unknown()); |
| 254 Linkage linkage(info()); |
| 255 MachineOperatorBuilder machine(zone()); |
| 256 ChangeLowering lowering(&jsgraph, &linkage, &machine); |
| 257 GraphReducer graph_reducer(&graph); |
| 258 graph_reducer.AddReducer(&lowering); |
| 259 graph_reducer.ReduceGraph(); |
| 260 |
| 261 VerifyAndPrintGraph(&graph, "Lowered changes"); |
| 262 } |
236 } | 263 } |
237 | 264 |
238 Handle<Code> code = Handle<Code>::null(); | 265 Handle<Code> code = Handle<Code>::null(); |
239 if (SupportedTarget()) { | 266 if (SupportedTarget()) { |
240 { | 267 { |
241 // Lower any remaining generic JSOperators. | 268 // Lower any remaining generic JSOperators. |
242 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, | 269 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, |
243 "generic lowering"); | 270 "generic lowering"); |
244 SourcePositionTable::Scope pos(&source_positions, | 271 SourcePositionTable::Scope pos(&source_positions, |
245 SourcePosition::Unknown()); | 272 SourcePosition::Unknown()); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 390 } |
364 | 391 |
365 | 392 |
366 void Pipeline::TearDown() { | 393 void Pipeline::TearDown() { |
367 InstructionOperand::TearDownCaches(); | 394 InstructionOperand::TearDownCaches(); |
368 } | 395 } |
369 | 396 |
370 } // namespace compiler | 397 } // namespace compiler |
371 } // namespace internal | 398 } // namespace internal |
372 } // namespace v8 | 399 } // namespace v8 |
OLD | NEW |