From 718493c6c3c8e380663cb8a94e57ce160a6c473f Mon Sep 17 00:00:00 2001 From: Mingyao Yang Date: Wed, 22 Jul 2015 15:56:34 -0700 Subject: 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 --- compiler/optimizing/ssa_liveness_analysis.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/ssa_liveness_analysis.h') 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; } -- cgit v1.2.3-59-g8ed1b