summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2017-04-06 14:40:08 -0700
committerIgor Murashkin <iam@google.com>2017-04-10 14:59:19 -0700
commit032cacdbf32c50d3c43590600ed1e171a35fa93c (patch)
treec3e3eb480f46de2224fe58e8c30d8d5698238998 /compiler/optimizing/optimizing_compiler.cc
parent8827cec4193238c2261d83c4d2c0404cc20641f0 (diff)
optimizing: do not illegally remove constructor barriers after inlining
Remove the illegal optimization that destroyed constructor barriers after inlining invoke-super constructor calls. --- According to JLS 7.5.1, "Note that if one constructor invokes another constructor, and the invoked constructor sets a final field, the freeze for the final field takes place at the end of the invoked constructor." This means if an object is published (stored to a location potentially visible to another thread) inside of an outer constructor, all final field stores from any inner constructors must be visible to other threads. Test: art/test.py Bug: 37001605 Change-Id: I3b55f6c628ff1773dab88022a6475d50a1a6f906
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc6
1 files changed, 0 insertions, 6 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index e542cbbe37..8aad539851 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -930,16 +930,10 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* arena,
/* verified_method */ nullptr,
dex_cache);
- bool requires_barrier = dex_compilation_unit.IsConstructor()
- && compiler_driver->RequiresConstructorBarrier(Thread::Current(),
- dex_compilation_unit.GetDexFile(),
- dex_compilation_unit.GetClassDefIndex());
-
HGraph* graph = new (arena) HGraph(
arena,
dex_file,
method_idx,
- requires_barrier,
compiler_driver->GetInstructionSet(),
kInvalidInvokeType,
compiler_driver->GetCompilerOptions().GetDebuggable(),