diff options
author | Mathieu Chartier <mathieuc@google.com> | 2016-04-07 13:19:19 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2016-04-08 10:33:00 -0700 |
commit | c4ae916def97b9e1ef6df35c8fabb3921a0e380c (patch) | |
tree | 9423d8a1df2ae043e2a9abb7a20977d849d1b7d6 /compiler/optimizing/instruction_builder.cc | |
parent | b5d386118334fa5181c31b83b3fee6332537f4b7 (diff) |
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
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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)); |