summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-01-22 16:32:29 +0000
committer Vladimir Marko <vmarko@google.com> 2018-01-23 17:43:15 +0000
commit718e8319c728e9ee2ec15b1d56ca96baa4393028 (patch)
tree179d05bf61f23b02001da80df30cbd89fd5b5903 /compiler/driver/compiler_driver.h
parentbe2b613f5a30cdf2291b9f4f5d0acc2c1bb0b4ae (diff)
ART: Use the bitstring type check for AOT app compilation.
For boot image target classes that have their bitstring already assigned in the boot image. The size of the services.odex for aosp_taimen-userdebug: - before: - arm64: 20988640 - after: - arm64: 20968016 (-20KiB, -0.1%) (There is no arm version, only arm64.) Test: New test case in 552-checker-sharpening. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 64692057 Change-Id: I9585efca8ba0df15400e7536e5e2cc76aca13e8d
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h
index 4b5916d572..30042751b3 100644
--- a/compiler/driver/compiler_driver.h
+++ b/compiler/driver/compiler_driver.h
@@ -385,12 +385,17 @@ class CompilerDriver {
return dex_to_dex_compiler_;
}
+ bool IsBootImageClassWithAssignedBitstring(ObjPtr<mirror::Class> klass)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
private:
void PreCompile(jobject class_loader,
const std::vector<const DexFile*>& dex_files,
TimingLogger* timings)
REQUIRES(!Locks::mutator_lock_);
+ void RecordBootImageClassesWithAssignedBitstring() REQUIRES(!Locks::mutator_lock_);
+
void LoadImageClasses(TimingLogger* timings) REQUIRES(!Locks::mutator_lock_);
// Attempt to resolve all type, methods, fields, and strings
@@ -513,6 +518,12 @@ class CompilerDriver {
// This option may be restricted to the boot image, depending on a flag in the implementation.
std::unique_ptr<std::unordered_set<std::string>> methods_to_compile_;
+ // For AOT app compilation, we keep the set of boot image classes with assigned type check
+ // bitstring. We need to retrieve this set before we initialize app image classes as the
+ // initialization can cause more boot image bitstrings to be assigned.
+ // Note that boot image classes are non-moveable, so it's OK to keep raw pointers.
+ std::unique_ptr<std::unordered_set<mirror::Class*>> boot_image_classes_with_assigned_bitstring_;
+
std::atomic<uint32_t> number_of_soft_verifier_failures_;
bool had_hard_verifier_failure_;