summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-04-07 13:19:19 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-04-08 11:00:58 -0700
commitb7248b9f1a6d62a30f0cefc12de63c216b5d46e2 (patch)
treeed721ac7ae66016d346e9ed92b50cfe4dbdcfc92 /compiler/optimizing/builder.cc
parent539d38c67c521aa17741a41fc4c4462b576adfd9 (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. (cherry picked from commit c4ae916def97b9e1ef6df35c8fabb3921a0e380c) Bug: 28005874 Change-Id: I4a417819aa129c95f4a83c38df1a66eb77824ea9
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r--compiler/optimizing/builder.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index b6b8322f03..9820497888 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -639,10 +639,10 @@ void HGraphBuilder::Binop_22b(const Instruction& instruction, bool reverse, uint
UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction(), dex_pc);
}
-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());
}
void HGraphBuilder::BuildReturn(const Instruction& instruction,
@@ -652,7 +652,7 @@ void HGraphBuilder::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.";
}
current_block_->AddInstruction(new (arena_) HMemoryBarrier(kStoreStore, dex_pc));