From c4ae916def97b9e1ef6df35c8fabb3921a0e380c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 7 Apr 2016 13:19:19 -0700 Subject: Store precice set of which constructors require barriers Fixes bugs where things in the boot image might not have been calculated even though resolved_clases was true. This only occured for app and test compiles though. Fixes test 476-checker-ctor-memory-barrier which was failing due to inlining something in the boot class path and getting a unexpected barrier since the barrier defaults to enabled. No measurable increase in RAM usage. Bug: 28005874 Change-Id: I4a417819aa129c95f4a83c38df1a66eb77824ea9 --- compiler/optimizing/instruction_builder.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/instruction_builder.cc') diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index b0f0893720..06b39680b2 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -567,10 +567,10 @@ void HInstructionBuilder::Binop_22b(const Instruction& instruction, bool reverse UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); } -static bool RequiresConstructorBarrier(const DexCompilationUnit* cu, const CompilerDriver& driver) { +static bool RequiresConstructorBarrier(const DexCompilationUnit* cu, CompilerDriver* driver) { Thread* self = Thread::Current(); return cu->IsConstructor() - && driver.RequiresConstructorBarrier(self, cu->GetDexFile(), cu->GetClassDefIndex()); + && driver->RequiresConstructorBarrier(self, cu->GetDexFile(), cu->GetClassDefIndex()); } // Returns true if `block` has only one successor which starts at the next @@ -616,7 +616,7 @@ void HInstructionBuilder::BuildReturn(const Instruction& instruction, if (graph_->ShouldGenerateConstructorBarrier()) { // The compilation unit is null during testing. if (dex_compilation_unit_ != nullptr) { - DCHECK(RequiresConstructorBarrier(dex_compilation_unit_, *compiler_driver_)) + DCHECK(RequiresConstructorBarrier(dex_compilation_unit_, compiler_driver_)) << "Inconsistent use of ShouldGenerateConstructorBarrier. Should not generate a barrier."; } AppendInstruction(new (arena_) HMemoryBarrier(kStoreStore, dex_pc)); -- cgit v1.2.3-59-g8ed1b