Chromium Code Reviews| Index: src/compiler/pipeline.cc |
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
| index 3a0d27b0593f51ad1306350ac95b4cfb25da4093..246bf471b8588a277ee49b1dac625b9a334e74b8 100644 |
| --- a/src/compiler/pipeline.cc |
| +++ b/src/compiler/pipeline.cc |
| @@ -21,6 +21,7 @@ |
| #include "src/compiler/js-generic-lowering.h" |
| #include "src/compiler/js-inlining.h" |
| #include "src/compiler/js-typed-lowering.h" |
| +#include "src/compiler/jump-threading.h" |
| #include "src/compiler/machine-operator-reducer.h" |
| #include "src/compiler/pipeline-statistics.h" |
| #include "src/compiler/register-allocator.h" |
| @@ -578,6 +579,18 @@ struct ResolveControlFlowPhase { |
| }; |
| +struct JumpThreadingPhase { |
| + static const char* phase_name() { return "jump threading"; } |
| + |
| + void Run(PipelineData* data, Zone* temp_zone) { |
| + ZoneVector<BasicBlock::RpoNumber> result(temp_zone); |
| + if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence())) { |
| + JumpThreading::ApplyForwarding(result, data->sequence()); |
| + } |
| + } |
| +}; |
| + |
| + |
| struct GenerateCodePhase { |
| static const char* phase_name() { return "generate code"; } |
| @@ -902,7 +915,10 @@ void Pipeline::GenerateCode(Linkage* linkage) { |
| BeginPhaseKind("code generation"); |
| - // Generate native sequence. |
| + // Optimimize jumps. |
|
dcarney
2014/11/24 15:59:09
if (FLAG_turbo_jt)
|
| + Run<JumpThreadingPhase>(); |
| + |
| + // Generate final machine code. |
| Run<GenerateCodePhase>(linkage); |
| if (profiler_data != NULL) { |