From 032cacdbf32c50d3c43590600ed1e171a35fa93c Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Thu, 6 Apr 2017 14:40:08 -0700 Subject: 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 --- compiler/optimizing/optimizing_unit_test.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/optimizing_unit_test.h') diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index bf963b8996..1cdcbd2e9b 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -79,7 +79,9 @@ void RemoveSuspendChecks(HGraph* graph) { inline HGraph* CreateGraph(ArenaAllocator* allocator) { return new (allocator) HGraph( - allocator, *reinterpret_cast(allocator->Alloc(sizeof(DexFile))), -1, false, + allocator, + *reinterpret_cast(allocator->Alloc(sizeof(DexFile))), + /*method_idx*/-1, kRuntimeISA); } -- cgit v1.2.3-59-g8ed1b