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 <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/compiler/ast-graph-builder.h" | 10 #include "src/compiler/ast-graph-builder.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 VerifyAndPrintGraph(&graph, "Lowered typed"); | 309 VerifyAndPrintGraph(&graph, "Lowered typed"); |
310 } | 310 } |
311 { | 311 { |
312 // Lower simplified operators and insert changes. | 312 // Lower simplified operators and insert changes. |
313 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, | 313 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, |
314 "simplified lowering"); | 314 "simplified lowering"); |
315 SourcePositionTable::Scope pos(&source_positions, | 315 SourcePositionTable::Scope pos(&source_positions, |
316 SourcePosition::Unknown()); | 316 SourcePosition::Unknown()); |
317 SimplifiedLowering lowering(&jsgraph); | 317 SimplifiedLowering lowering(&jsgraph); |
318 lowering.LowerAllNodes(); | 318 lowering.LowerAllNodes(); |
| 319 ValueNumberingReducer vn_reducer(zone()); |
| 320 SimplifiedOperatorReducer simple_reducer(&jsgraph); |
| 321 GraphReducer graph_reducer(&graph); |
| 322 graph_reducer.AddReducer(&simple_reducer); |
| 323 graph_reducer.AddReducer(&vn_reducer); |
| 324 graph_reducer.ReduceGraph(); |
319 | 325 |
320 VerifyAndPrintGraph(&graph, "Lowered simplified"); | 326 VerifyAndPrintGraph(&graph, "Lowered simplified"); |
321 } | 327 } |
322 { | 328 { |
323 // Lower changes that have been inserted before. | 329 // Lower changes that have been inserted before. |
324 PhaseStats lowering_stats(info(), PhaseStats::OPTIMIZATION, | 330 PhaseStats lowering_stats(info(), PhaseStats::OPTIMIZATION, |
325 "change lowering"); | 331 "change lowering"); |
326 SourcePositionTable::Scope pos(&source_positions, | 332 SourcePositionTable::Scope pos(&source_positions, |
327 SourcePosition::Unknown()); | 333 SourcePosition::Unknown()); |
328 Linkage linkage(info()); | 334 Linkage linkage(info()); |
329 ValueNumberingReducer vn_reducer(zone()); | 335 ValueNumberingReducer vn_reducer(zone()); |
330 SimplifiedOperatorReducer simple_reducer(&jsgraph); | |
331 ChangeLowering lowering(&jsgraph, &linkage); | 336 ChangeLowering lowering(&jsgraph, &linkage); |
332 MachineOperatorReducer mach_reducer(&jsgraph); | 337 MachineOperatorReducer mach_reducer(&jsgraph); |
333 GraphReducer graph_reducer(&graph); | 338 GraphReducer graph_reducer(&graph); |
334 // TODO(titzer): Figure out if we should run all reducers at once here. | 339 // TODO(titzer): Figure out if we should run all reducers at once here. |
335 graph_reducer.AddReducer(&vn_reducer); | 340 graph_reducer.AddReducer(&vn_reducer); |
336 graph_reducer.AddReducer(&simple_reducer); | |
337 graph_reducer.AddReducer(&lowering); | 341 graph_reducer.AddReducer(&lowering); |
338 graph_reducer.AddReducer(&mach_reducer); | 342 graph_reducer.AddReducer(&mach_reducer); |
339 graph_reducer.ReduceGraph(); | 343 graph_reducer.ReduceGraph(); |
340 | 344 |
341 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. | 345 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
342 VerifyAndPrintGraph(&graph, "Lowered changes", true); | 346 VerifyAndPrintGraph(&graph, "Lowered changes", true); |
343 } | 347 } |
344 } | 348 } |
345 | 349 |
346 { | 350 { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 494 } |
491 | 495 |
492 | 496 |
493 void Pipeline::TearDown() { | 497 void Pipeline::TearDown() { |
494 InstructionOperand::TearDownCaches(); | 498 InstructionOperand::TearDownCaches(); |
495 } | 499 } |
496 | 500 |
497 } // namespace compiler | 501 } // namespace compiler |
498 } // namespace internal | 502 } // namespace internal |
499 } // namespace v8 | 503 } // namespace v8 |
OLD | NEW |