Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index ef0144cfe303056a43873db4fd719fa22b8dd609..6e712156faaf245999734e25b689b87b7b446b69 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -414,7 +414,9 @@ struct OsrDeconstructionPhase { |
SourcePositionTable::Scope pos(data->source_positions(), |
SourcePosition::Unknown()); |
OsrHelper osr_helper(data->info()); |
- osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone); |
+ bool success = |
+ osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone); |
+ if (!success) data->info()->RetryOptimization(kOsrCompileFailed); |
} |
}; |
@@ -774,8 +776,11 @@ void Pipeline::RunPrintAndVerify(const char* phase, bool untyped) { |
Handle<Code> Pipeline::GenerateCode() { |
- // TODO(turbofan): Make OSR work with inner loops and remove this bailout. |
- if (info()->is_osr() && !FLAG_turbo_osr) return Handle<Code>::null(); |
+ if (info()->is_osr() && !FLAG_turbo_osr) { |
+ // TODO(turbofan): remove this flag and always handle OSR |
+ info()->RetryOptimization(kOsrCompileFailed); |
+ return Handle<Code>::null(); |
+ } |
// TODO(mstarzinger): This is just a temporary hack to make TurboFan work, |
// the correct solution is to restore the context register after invoking |
@@ -863,6 +868,7 @@ Handle<Code> Pipeline::GenerateCode() { |
if (info()->is_osr()) { |
Run<OsrDeconstructionPhase>(); |
+ if (info()->bailout_reason() != kNoReason) return Handle<Code>::null(); |
RunPrintAndVerify("OSR deconstruction"); |
} |
@@ -880,6 +886,7 @@ Handle<Code> Pipeline::GenerateCode() { |
} else { |
if (info()->is_osr()) { |
Run<OsrDeconstructionPhase>(); |
+ if (info()->bailout_reason() != kNoReason) return Handle<Code>::null(); |
RunPrintAndVerify("OSR deconstruction"); |
} |
} |