Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Unified Diff: src/compiler/pipeline.cc

Issue 877553007: [turbofan] Gracefully bail out if OSR encounters a loop too deeply nested. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/osr.cc ('k') | test/mjsunit/compiler/osr-nested2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
}
}
« no previous file with comments | « src/compiler/osr.cc ('k') | test/mjsunit/compiler/osr-nested2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698