| 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 <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 443 } |
| 444 }; | 444 }; |
| 445 | 445 |
| 446 | 446 |
| 447 struct InliningPhase { | 447 struct InliningPhase { |
| 448 static const char* phase_name() { return "inlining"; } | 448 static const char* phase_name() { return "inlining"; } |
| 449 | 449 |
| 450 void Run(PipelineData* data, Zone* temp_zone) { | 450 void Run(PipelineData* data, Zone* temp_zone) { |
| 451 SourcePositionTable::Scope pos(data->source_positions(), | 451 SourcePositionTable::Scope pos(data->source_positions(), |
| 452 SourcePosition::Unknown()); | 452 SourcePosition::Unknown()); |
| 453 JSInliner inliner(temp_zone, data->info(), data->jsgraph()); | 453 JSInliner inliner(data->info()->is_inlining_enabled() |
| 454 ? JSInliner::kGeneralInlining |
| 455 : JSInliner::kBuiltinsInlining, |
| 456 temp_zone, data->info(), data->jsgraph()); |
| 454 GraphReducer graph_reducer(data->graph(), temp_zone); | 457 GraphReducer graph_reducer(data->graph(), temp_zone); |
| 455 AddReducer(data, &graph_reducer, &inliner); | 458 AddReducer(data, &graph_reducer, &inliner); |
| 456 graph_reducer.ReduceGraph(); | 459 graph_reducer.ReduceGraph(); |
| 457 } | 460 } |
| 458 }; | 461 }; |
| 459 | 462 |
| 460 | 463 |
| 461 struct TyperPhase { | 464 struct TyperPhase { |
| 462 static const char* phase_name() { return "typer"; } | 465 static const char* phase_name() { return "typer"; } |
| 463 | 466 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 | 911 |
| 909 Run<EarlyControlReductionPhase>(); | 912 Run<EarlyControlReductionPhase>(); |
| 910 RunPrintAndVerify("Early Control reduced", true); | 913 RunPrintAndVerify("Early Control reduced", true); |
| 911 | 914 |
| 912 if (info()->is_context_specializing()) { | 915 if (info()->is_context_specializing()) { |
| 913 // Specialize the code to the context as aggressively as possible. | 916 // Specialize the code to the context as aggressively as possible. |
| 914 Run<ContextSpecializerPhase>(); | 917 Run<ContextSpecializerPhase>(); |
| 915 RunPrintAndVerify("Context specialized", true); | 918 RunPrintAndVerify("Context specialized", true); |
| 916 } | 919 } |
| 917 | 920 |
| 918 if (info()->is_inlining_enabled()) { | 921 if (info()->is_builtin_inlining_enabled() || info()->is_inlining_enabled()) { |
| 919 Run<InliningPhase>(); | 922 Run<InliningPhase>(); |
| 920 RunPrintAndVerify("Inlined", true); | 923 RunPrintAndVerify("Inlined", true); |
| 921 } | 924 } |
| 922 | 925 |
| 923 if (FLAG_print_turbo_replay) { | 926 if (FLAG_print_turbo_replay) { |
| 924 // Print a replay of the initial graph. | 927 // Print a replay of the initial graph. |
| 925 GraphReplayPrinter::PrintReplay(data.graph()); | 928 GraphReplayPrinter::PrintReplay(data.graph()); |
| 926 } | 929 } |
| 927 | 930 |
| 928 // Bailout here in case target architecture is not supported. | 931 // Bailout here in case target architecture is not supported. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1198 |
| 1196 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { | 1199 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { |
| 1197 TurboCfgFile tcf(data->isolate()); | 1200 TurboCfgFile tcf(data->isolate()); |
| 1198 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); | 1201 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); |
| 1199 } | 1202 } |
| 1200 } | 1203 } |
| 1201 | 1204 |
| 1202 } // namespace compiler | 1205 } // namespace compiler |
| 1203 } // namespace internal | 1206 } // namespace internal |
| 1204 } // namespace v8 | 1207 } // namespace v8 |
| OLD | NEW |