diff options
author | 2016-04-22 13:16:14 +0100 | |
---|---|---|
committer | 2016-04-27 10:18:48 +0100 | |
commit | 93a18c5d4160f632ecdb92af099574e9c7098c49 (patch) | |
tree | 328e28e160fe894fb9487a625cbbfc4ab94c093c /compiler/optimizing/bounds_check_elimination.cc | |
parent | f7cda8088ec57ab1422f85f08df78e217a9f7094 (diff) |
Forbid HDeoptimize instructions in OSR methods.
Otherwise dominated instructions will assume something that
isn't necessarily correct if coming from the interpreter.
bug:28335959
bug:28249238
bug:28348878
bug:28080135
Change-Id: I842bd1c6a919aff48cf6048d2ea51cf2d40f3c1d
Diffstat (limited to 'compiler/optimizing/bounds_check_elimination.cc')
-rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index 659c6f8497..b65e98a120 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -552,7 +552,11 @@ class BCEVisitor : public HGraphVisitor { DCHECK(!IsAddedBlock(block)); first_index_bounds_check_map_.clear(); HGraphVisitor::VisitBasicBlock(block); - AddComparesWithDeoptimization(block); + // We should never deoptimize from an osr method, otherwise we might wrongly optimize + // code dominated by the deoptimization. + if (!GetGraph()->IsCompilingOsr()) { + AddComparesWithDeoptimization(block); + } } void Finish() { @@ -1358,6 +1362,11 @@ class BCEVisitor : public HGraphVisitor { if (loop->IsIrreducible()) { return false; } + // We should never deoptimize from an osr method, otherwise we might wrongly optimize + // code dominated by the deoptimization. + if (GetGraph()->IsCompilingOsr()) { + return false; + } // A try boundary preheader is hard to handle. // TODO: remove this restriction. if (loop->GetPreHeader()->GetLastInstruction()->IsTryBoundary()) { |