summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2016-01-20 14:50:19 +0000
committer David Brazdil <dbrazdil@google.com> 2016-01-20 16:35:08 +0000
commitbc9ab1630a198efbbf730275541291321ac3d2d4 (patch)
tree68551c86f225e15bbeba00f52236492a4c8fe576 /compiler/optimizing/nodes.h
parentc4004042ca028a3c7898f0032dcee08cddea303b (diff)
ART: Cannot assume String.<init> 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
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h12
1 files changed, 3 insertions, 9 deletions
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