summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2016-04-07 14:57:50 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-04-07 14:57:50 +0000
commit35d6a426c699da05ee6f962cfbe426b7d638780a (patch)
treeece769c9094c2791015b4fc61035ea50221bb477 /compiler/driver/compiler_driver.cc
parent173e99a73e535f07bc32fc76d3ff9f987caeffda (diff)
parenta7ab4997f7263439561093ffbc7dea29181a47c5 (diff)
Merge "Revert "Check if we require barrier if we did not resolve classes""
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc32
1 files changed, 2 insertions, 30 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 5fe81c789c..22e35ad634 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -358,7 +358,6 @@ CompilerDriver::CompilerDriver(
instruction_set_(instruction_set),
instruction_set_features_(instruction_set_features),
no_barrier_constructor_classes_lock_("freezing constructor lock"),
- resolved_classes_(false),
compiled_classes_lock_("compiled classes lock"),
compiled_methods_lock_("compiled method lock"),
compiled_methods_(MethodTable::key_compare()),
@@ -713,8 +712,6 @@ void CompilerDriver::Resolve(jobject class_loader,
resolve_thread_count,
timings);
}
-
- resolved_classes_ = true;
}
// Resolve const-strings in the code. Done to have deterministic allocation behavior. Right now
@@ -2009,28 +2006,6 @@ static void CheckAndClearResolveException(Thread* self)
self->ClearException();
}
-bool CompilerDriver::RequiresConstructorBarrier(const DexFile& dex_file,
- uint16_t class_def_idx) const {
- const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_idx);
- const uint8_t* class_data = dex_file.GetClassData(class_def);
- if (class_data == nullptr) {
- // Empty class such as a marker interface.
- return false;
- }
- ClassDataItemIterator it(dex_file, class_data);
- while (it.HasNextStaticField()) {
- it.Next();
- }
- // We require a constructor barrier if there are final instance fields.
- while (it.HasNextInstanceField()) {
- if (it.MemberIsFinal()) {
- return true;
- }
- it.Next();
- }
- return false;
-}
-
class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor {
public:
explicit ResolveClassFieldsAndMethodsVisitor(const ParallelCompilationManager* manager)
@@ -2804,11 +2779,8 @@ void CompilerDriver::AddRequiresNoConstructorBarrier(Thread* self,
bool CompilerDriver::RequiresConstructorBarrier(Thread* self,
const DexFile* dex_file,
uint16_t class_def_index) const {
- if (resolved_classes_) {
- ReaderMutexLock mu(self, no_barrier_constructor_classes_lock_);
- return no_barrier_constructor_classes_.count(ClassReference(dex_file, class_def_index)) == 0;
- }
- return RequiresConstructorBarrier(*dex_file, class_def_index);
+ ReaderMutexLock mu(self, no_barrier_constructor_classes_lock_);
+ return no_barrier_constructor_classes_.count(ClassReference(dex_file, class_def_index)) == 0;
}
std::string CompilerDriver::GetMemoryUsageString(bool extended) const {