summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-04-14 10:49:19 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-04-27 12:45:30 -0700
commite42888f9df4163303244070c65d5229d3e201742 (patch)
treec3c3e380ed16676186040f1da6042fc2cd58e041 /compiler/driver/compiler_driver.cc
parent7f98c9a6babe3a21d84ce1f1e1273c99975a47f5 (diff)
Write conflict tables in image
Add image sections for runtime methods and conflict tables. This makes it that we do not need to fake up a length prefixed array for runtime methods. Reduces .art private dirty and PSS. System wide .art PSS goes from 32.5MB to 30.5MB after system boot. Business card .art private dirty goes from 588K to 504K. Increases image size by ~100K. Bug: 27906566 (cherry picked from commit cda9386add68d94697449c6cb08b356747e55c21) Change-Id: I38cbe3150c3eeb385b8cad7cf93614e3980f4162
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc14
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.