From f57c1ae3682f95e6d7ce08ae4c241d04b09de658 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 28 Jun 2017 17:40:18 +0100 Subject: Prevent loop optimization in debuggable mode. bug: 33775412 Test: no scanner crash (torn on whether I should spend some time working on a smali test) Change-Id: I8b94725ce57171b592bede4bf55cd0a9626a8a10 --- compiler/optimizing/nodes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index ffa16dd787..b21c4a5aa7 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2612,6 +2612,16 @@ class HPhi FINAL : public HVariableInputSizeInstruction { && other->AsPhi()->GetRegNumber() == GetRegNumber(); } + bool HasEquivalentPhi() const { + if (GetPrevious() != nullptr && GetPrevious()->AsPhi()->GetRegNumber() == GetRegNumber()) { + return true; + } + if (GetNext() != nullptr && GetNext()->AsPhi()->GetRegNumber() == GetRegNumber()) { + return true; + } + return false; + } + // Returns the next equivalent phi (starting from the current one) or null if there is none. // An equivalent phi is a phi having the same dex register and type. // It assumes that phis with the same dex register are adjacent. -- cgit v1.2.3-59-g8ed1b