From 03c7df9648028228d75dddfc25cbc81ab8096167 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 6 Apr 2016 14:41:23 -0700 Subject: Check if we require barrier if we did not resolve classes Check fields instead of just always inserting the return void barrier. Bug: 28005874 Change-Id: I62cc1c3979304642109961fcf2607a7df065a162 --- compiler/driver/compiler_driver.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 98e3d890cd..0ed0bb6af7 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -619,6 +619,8 @@ class CompilerDriver { void FreeThreadPools(); void CheckThreadPools(); + bool RequiresConstructorBarrier(const DexFile& dex_file, uint16_t class_def_idx) const; + const CompilerOptions* const compiler_options_; VerificationResults* const verification_results_; DexFileToMethodInlinerMap* const method_inliner_map_; @@ -629,10 +631,14 @@ class CompilerDriver { const InstructionSet instruction_set_; const InstructionSetFeatures* const instruction_set_features_; - // All class references that do not require constructor barriers + // All class references that do not require constructor barriers. Only filled in if + // resolved_classes_ is true. mutable ReaderWriterMutex no_barrier_constructor_classes_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; std::set no_barrier_constructor_classes_ GUARDED_BY(no_barrier_constructor_classes_lock_); + // resolved_classes_ is true if we performed the resolve phase and filled in + // no_barrier_constructor_classes_. + bool resolved_classes_; typedef SafeMap ClassTable; // All class references that this compiler has compiled. -- cgit v1.2.3-59-g8ed1b