From bc9ab1630a198efbbf730275541291321ac3d2d4 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Wed, 20 Jan 2016 14:50:19 +0000 Subject: ART: Cannot assume String. called on NewInstance Irreducible loops create uneliminatable phis for all live vregs. This breaks the StringFactory optimization which assumes that the first input is always a NewInstance instruction. Bug: 26676472 Change-Id: Ib7dfdadbafbbfef89e1f5b1a80eb75ecf792621a --- compiler/optimizing/nodes.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index e222ef7260..019be5d494 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -3689,19 +3689,13 @@ class HInvokeStaticOrDirect : public HInvoke { DCHECK(!IsStaticWithExplicitClinitCheck()); } - HNewInstance* GetThisArgumentOfStringInit() const { + HInstruction* GetAndRemoveThisArgumentOfStringInit() { DCHECK(IsStringInit()); size_t index = InputCount() - 1; - DCHECK(InputAt(index)->IsNewInstance()); - return InputAt(index)->AsNewInstance(); - } - - void RemoveThisArgumentOfStringInit() { - DCHECK(IsStringInit()); - size_t index = InputCount() - 1; - DCHECK(InputAt(index)->IsNewInstance()); + HInstruction* input = InputAt(index); RemoveAsUserOfInput(index); inputs_.pop_back(); + return input; } // Is this a call to a static method whose declaring class has an -- cgit v1.2.3-59-g8ed1b