summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-04-06 14:41:23 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-04-06 16:01:48 -0700
commit20fd7cdd25364b16d878df037c6ae0fbd5f2a9ac (patch)
tree3872f8e290990ceb9267313452d2a5e4a7d1ce0d /compiler/driver/compiler_driver.h
parent43574b561a9f4b1721ea4ab2bbccae7a825c2ebb (diff)
Check if we require barrier if we did not resolve classes
Check fields instead of just always inserting the return void barrier. Bug: 28005874 (cherry picked from commit 03c7df9648028228d75dddfc25cbc81ab8096167) Change-Id: I1207fecc9a4425d024a7e5e1a850c9e2a6e17c31
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h8
1 files changed, 7 insertions, 1 deletions
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<ClassReference> 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<const ClassReference, CompiledClass*> ClassTable;
// All class references that this compiler has compiled.