From 6de1938e562b0d06e462512dd806166e754035ea Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Fri, 8 Jan 2016 17:37:10 +0000 Subject: ART: Remove incorrect HFakeString optimization Simplification of HFakeString assumes that it cannot be used until String. is called which is not true and causes different behaviour between the compiler and the interpreter. This patch removes the optimization together with the HFakeString instruction. Instead, HNewInstance is generated and an empty String allocated until it is replaced with the result of the StringFactory call. This is consistent with the behaviour of the interpreter but is too conservative. A follow-up CL will attempt to optimize out the initial allocation when possible. Bug: 26457745 Bug: 26486014 Change-Id: I7139e37ed00a880715bfc234896a930fde670c44 --- compiler/optimizing/ssa_builder.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'compiler/optimizing/ssa_builder.h') diff --git a/compiler/optimizing/ssa_builder.h b/compiler/optimizing/ssa_builder.h index 0fcc3a1306..efe0dff4ed 100644 --- a/compiler/optimizing/ssa_builder.h +++ b/compiler/optimizing/ssa_builder.h @@ -70,13 +70,14 @@ class SsaBuilder : public HGraphVisitor { ArenaVector* GetLocalsFor(HBasicBlock* block); HInstruction* ValueOfLocal(HBasicBlock* block, size_t local); - void VisitBasicBlock(HBasicBlock* block); - void VisitLoadLocal(HLoadLocal* load); - void VisitStoreLocal(HStoreLocal* store); - void VisitInstruction(HInstruction* instruction); - void VisitTemporary(HTemporary* instruction); - void VisitArrayGet(HArrayGet* aget); - void VisitArraySet(HArraySet* aset); + void VisitBasicBlock(HBasicBlock* block) OVERRIDE; + void VisitLoadLocal(HLoadLocal* load) OVERRIDE; + void VisitStoreLocal(HStoreLocal* store) OVERRIDE; + void VisitInstruction(HInstruction* instruction) OVERRIDE; + void VisitTemporary(HTemporary* instruction) OVERRIDE; + void VisitArrayGet(HArrayGet* aget) OVERRIDE; + void VisitArraySet(HArraySet* aset) OVERRIDE; + void VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) OVERRIDE; static constexpr const char* kSsaBuilderPassName = "ssa_builder"; -- cgit v1.2.3-59-g8ed1b