diff options
author | Mingyao Yang <mingyao@google.com> | 2015-07-22 15:56:34 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2015-07-28 20:00:45 +0000 |
commit | 681652d8e8a33bc07c5c082a71aea13d0f15e0a0 (patch) | |
tree | 5444f5832d76d91b8fef997ce6ff665b917aaf51 /compiler | |
parent | af50e415a187190488d4694f307c23705203c53e (diff) | |
download | art-681652d8e8a33bc07c5c082a71aea13d0f15e0a0.zip art-681652d8e8a33bc07c5c082a71aea13d0f15e0a0.tar.gz art-681652d8e8a33bc07c5c082a71aea13d0f15e0a0.tar.bz2 |
HDeoptimize should hold values live in env.
Values that are not live in compiled code anymore may still be needed in
interpreter, due to code motion, etc.
(cherry-picked from commit 718493c6c3c8e380663cb8a94e57ce160a6c473f)
Bug: 22665511
Change-Id: I8b85833c5c462f8fe36f86d6026a51b07563995a
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/optimizing/ssa_liveness_analysis.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/ssa_liveness_analysis.h | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc index 250eb04..ce376da 100644 --- a/compiler/optimizing/ssa_liveness_analysis.cc +++ b/compiler/optimizing/ssa_liveness_analysis.cc @@ -225,7 +225,7 @@ void SsaLivenessAnalysis::ComputeLiveRanges() { // SsaLivenessAnalysis. for (size_t i = 0, e = environment->Size(); i < e; ++i) { HInstruction* instruction = environment->GetInstructionAt(i); - bool should_be_live = ShouldBeLiveForEnvironment(instruction); + bool should_be_live = ShouldBeLiveForEnvironment(current, instruction); if (should_be_live) { DCHECK(instruction->HasSsaIndex()); live_in->SetBit(instruction->GetSsaIndex()); diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h index 82c5454..c46fac2 100644 --- a/compiler/optimizing/ssa_liveness_analysis.h +++ b/compiler/optimizing/ssa_liveness_analysis.h @@ -1190,8 +1190,14 @@ class SsaLivenessAnalysis : public ValueObject { // Update the live_out set of the block and returns whether it has changed. bool UpdateLiveOut(const HBasicBlock& block); - static bool ShouldBeLiveForEnvironment(HInstruction* instruction) { + // Returns whether `instruction` in an HEnvironment held by `env_holder` + // should be kept live by the HEnvironment. + static bool ShouldBeLiveForEnvironment(HInstruction* env_holder, + HInstruction* instruction) { if (instruction == nullptr) return false; + // A value that's not live in compiled code may still be needed in interpreter, + // due to code motion, etc. + if (env_holder->IsDeoptimize()) return true; if (instruction->GetBlock()->GetGraph()->IsDebuggable()) return true; return instruction->GetType() == Primitive::kPrimNot; } |