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/code-generator.h" | 9 #include "src/compiler/code-generator.h" |
10 #include "src/compiler/graph-replay.h" | 10 #include "src/compiler/graph-replay.h" |
11 #include "src/compiler/graph-visualizer.h" | 11 #include "src/compiler/graph-visualizer.h" |
12 #include "src/compiler/instruction.h" | 12 #include "src/compiler/instruction.h" |
13 #include "src/compiler/instruction-selector.h" | 13 #include "src/compiler/instruction-selector.h" |
14 #include "src/compiler/js-context-specialization.h" | 14 #include "src/compiler/js-context-specialization.h" |
15 #include "src/compiler/js-generic-lowering.h" | 15 #include "src/compiler/js-generic-lowering.h" |
16 #include "src/compiler/js-inlining.h" | |
17 #include "src/compiler/js-typed-lowering.h" | 16 #include "src/compiler/js-typed-lowering.h" |
18 #include "src/compiler/phi-reducer.h" | 17 #include "src/compiler/phi-reducer.h" |
19 #include "src/compiler/register-allocator.h" | 18 #include "src/compiler/register-allocator.h" |
20 #include "src/compiler/schedule.h" | 19 #include "src/compiler/schedule.h" |
21 #include "src/compiler/scheduler.h" | 20 #include "src/compiler/scheduler.h" |
22 #include "src/compiler/simplified-lowering.h" | 21 #include "src/compiler/simplified-lowering.h" |
23 #include "src/compiler/typer.h" | 22 #include "src/compiler/typer.h" |
24 #include "src/compiler/verifier.h" | 23 #include "src/compiler/verifier.h" |
25 #include "src/hydrogen.h" | 24 #include "src/hydrogen.h" |
26 #include "src/ostreams.h" | 25 #include "src/ostreams.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 graph_reducer.AddReducer(&phi_reducer); | 179 graph_reducer.AddReducer(&phi_reducer); |
181 graph_reducer.ReduceGraph(); | 180 graph_reducer.ReduceGraph(); |
182 // TODO(mstarzinger): Running reducer once ought to be enough for everyone. | 181 // TODO(mstarzinger): Running reducer once ought to be enough for everyone. |
183 graph_reducer.ReduceGraph(); | 182 graph_reducer.ReduceGraph(); |
184 graph_reducer.ReduceGraph(); | 183 graph_reducer.ReduceGraph(); |
185 } | 184 } |
186 | 185 |
187 VerifyAndPrintGraph(&graph, "Initial untyped"); | 186 VerifyAndPrintGraph(&graph, "Initial untyped"); |
188 | 187 |
189 if (FLAG_context_specialization) { | 188 if (FLAG_context_specialization) { |
190 SourcePositionTable::Scope pos(&source_positions, | 189 SourcePositionTable::Scope pos_(&source_positions, |
191 SourcePosition::Unknown()); | 190 SourcePosition::Unknown()); |
192 // Specialize the code to the context as aggressively as possible. | 191 // Specialize the code to the context as aggressively as possible. |
193 JSContextSpecializer spec(info(), &jsgraph, context_node); | 192 JSContextSpecializer spec(info(), &jsgraph, context_node); |
194 spec.SpecializeToContext(); | 193 spec.SpecializeToContext(); |
195 VerifyAndPrintGraph(&graph, "Context specialized"); | 194 VerifyAndPrintGraph(&graph, "Context specialized"); |
196 } | 195 } |
197 | 196 |
198 if (FLAG_turbo_inlining) { | |
199 SourcePositionTable::Scope pos(&source_positions, | |
200 SourcePosition::Unknown()); | |
201 JSInliner inliner(info(), &jsgraph); | |
202 inliner.Inline(); | |
203 VerifyAndPrintGraph(&graph, "Inlined"); | |
204 } | |
205 | |
206 // Print a replay of the initial graph. | 197 // Print a replay of the initial graph. |
207 if (FLAG_print_turbo_replay) { | 198 if (FLAG_print_turbo_replay) { |
208 GraphReplayPrinter::PrintReplay(&graph); | 199 GraphReplayPrinter::PrintReplay(&graph); |
209 } | 200 } |
210 | 201 |
211 if (FLAG_turbo_types) { | 202 if (FLAG_turbo_types) { |
212 { | 203 { |
213 // Type the graph. | 204 // Type the graph. |
214 PhaseStats typer_stats(info(), PhaseStats::CREATE_GRAPH, "typer"); | 205 PhaseStats typer_stats(info(), PhaseStats::CREATE_GRAPH, "typer"); |
215 typer.Run(&graph, info()->context()); | 206 typer.Run(&graph, info()->context()); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 349 } |
359 | 350 |
360 | 351 |
361 void Pipeline::TearDown() { | 352 void Pipeline::TearDown() { |
362 InstructionOperand::TearDownCaches(); | 353 InstructionOperand::TearDownCaches(); |
363 } | 354 } |
364 | 355 |
365 } // namespace compiler | 356 } // namespace compiler |
366 } // namespace internal | 357 } // namespace internal |
367 } // namespace v8 | 358 } // namespace v8 |
OLD | NEW |