From 062157f4e07b525728fa58f4ec57ffe1bf15d545 Mon Sep 17 00:00:00 2001 From: Mingyao Yang Date: Wed, 2 Mar 2016 10:15:36 -0800 Subject: Enable allocation elimination as part of LSE After load-store elimination, an allocation may not be used any more and may be eliminated. Change-Id: I7fcaaefa9d6ec2c611e46119c5799293770a917c --- compiler/optimizing/instruction_builder.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/instruction_builder.cc') diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index f5e49c2235..12cb826395 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -897,12 +897,12 @@ bool HInstructionBuilder::BuildNewInstance(uint16_t type_index, uint32_t dex_pc) Handle outer_dex_cache = outer_compilation_unit_->GetDexCache(); bool finalizable; - bool can_throw = NeedsAccessCheck(type_index, dex_cache, &finalizable); + bool needs_access_check = NeedsAccessCheck(type_index, dex_cache, &finalizable); // Only the non-resolved entrypoint handles the finalizable class case. If we // need access checks, then we haven't resolved the method and the class may // again be finalizable. - QuickEntrypointEnum entrypoint = (finalizable || can_throw) + QuickEntrypointEnum entrypoint = (finalizable || needs_access_check) ? kQuickAllocObject : kQuickAllocObjectInitialized; @@ -917,7 +917,7 @@ bool HInstructionBuilder::BuildNewInstance(uint16_t type_index, uint32_t dex_pc) outer_dex_file, IsOutermostCompilingClass(type_index), dex_pc, - /*needs_access_check*/ can_throw, + needs_access_check, compiler_driver_->CanAssumeTypeIsPresentInDexCache(outer_dex_cache, type_index)); AppendInstruction(load_class); @@ -933,7 +933,7 @@ bool HInstructionBuilder::BuildNewInstance(uint16_t type_index, uint32_t dex_pc) dex_pc, type_index, *dex_compilation_unit_->GetDexFile(), - can_throw, + needs_access_check, finalizable, entrypoint)); return true; -- cgit v1.2.3-59-g8ed1b