diff options
| author | 2016-04-27 20:51:10 +0000 | |
|---|---|---|
| committer | 2016-04-27 20:51:10 +0000 | |
| commit | 3f8bcb5e9e15f5a93ff0416d7b32aefd3761e146 (patch) | |
| tree | c3c3e380ed16676186040f1da6042fc2cd58e041 /compiler/driver/compiler_driver.cc | |
| parent | 3ce07dd1a1d000a5439e32d64fcee19268846c08 (diff) | |
| parent | e42888f9df4163303244070c65d5229d3e201742 (diff) | |
Merge changes I38cbe315,Ia05cb31f
* changes:
Write conflict tables in image
Add support for eagerly calculating conflict tables
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index be82956e76..e84faff941 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -2440,7 +2440,7 @@ void CompilerDriver::InitializeClasses(jobject jni_class_loader, context.ForAll(0, dex_file.NumClassDefs(), &visitor, init_thread_count); } -class InitializeArrayClassVisitor : public ClassVisitor { +class InitializeArrayClassesAndCreateConflictTablesVisitor : public ClassVisitor { public: virtual bool operator()(mirror::Class* klass) OVERRIDE SHARED_REQUIRES(Locks::mutator_lock_) { if (klass->IsArrayClass()) { @@ -2450,6 +2450,10 @@ class InitializeArrayClassVisitor : public ClassVisitor { true, true); } + // Create the conflict tables. + if (klass->ShouldHaveEmbeddedImtAndVTable()) { + Runtime::Current()->GetClassLinker()->FillIMTAndConflictTables(klass); + } return true; } }; @@ -2462,13 +2466,15 @@ void CompilerDriver::InitializeClasses(jobject class_loader, CHECK(dex_file != nullptr); InitializeClasses(class_loader, *dex_file, dex_files, timings); } - { + if (image_classes_ != nullptr) { // Make sure that we call EnsureIntiailized on all the array classes to call // SetVerificationAttempted so that the access flags are set. If we do not do this they get // changed at runtime resulting in more dirty image pages. + // Also create conflict tables. + // Only useful if we are compiling an image (image_classes_ is not null). ScopedObjectAccess soa(Thread::Current()); - InitializeArrayClassVisitor visitor; - Runtime::Current()->GetClassLinker()->VisitClasses(&visitor); + InitializeArrayClassesAndCreateConflictTablesVisitor visitor; + Runtime::Current()->GetClassLinker()->VisitClassesWithoutClassesLock(&visitor); } if (IsBootImage()) { // Prune garbage objects created during aborted transactions. |