summaryrefslogtreecommitdiff
path: root/compiler/optimizing/ssa_liveness_analysis.h
diff options
context:
space:
mode:
author Mingyao Yang <mingyao@google.com> 2015-07-22 15:56:34 -0700
committer Mingyao Yang <mingyao@google.com> 2015-07-27 10:46:45 -0700
commit718493c6c3c8e380663cb8a94e57ce160a6c473f (patch)
tree718e2041b8556d6343349d38982609efe5b22f78 /compiler/optimizing/ssa_liveness_analysis.h
parent9578d10b5866bfab63cc4218ec5ab3f6dd10c8ce (diff)
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. Bug: 22665511 Change-Id: I8b85833c5c462f8fe36f86d6026a51b07563995a
Diffstat (limited to 'compiler/optimizing/ssa_liveness_analysis.h')
-rw-r--r--compiler/optimizing/ssa_liveness_analysis.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h
index 220ee6a8d0..a7044de850 100644
--- a/compiler/optimizing/ssa_liveness_analysis.h
+++ b/compiler/optimizing/ssa_liveness_analysis.h
@@ -1201,8 +1201,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;
}