summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2017-07-01 03:32:41 +0000
committer android-build-merger <android-build-merger@google.com> 2017-07-01 03:32:41 +0000
commit7e73b5165d9b68c1a4e606d8af46ff8a2d4c3415 (patch)
treefd8a41ec4c0e144e329daf9d30ae210df5e232a8
parent197b62d3fa1b512866d3f642b31fab965249a1f8 (diff)
parent3d901ec5137c92662644ccf9ca582bb6da989613 (diff)
Merge "Add boot profile support"
am: 3d901ec513 Change-Id: I37db2f4bd7e6412954d51e914f6e238db5027a6e
-rw-r--r--core/jni/AndroidRuntime.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index f28a274673ed..08631f1a0b19 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -795,19 +795,27 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
"--compiler-filter=", "-Ximage-compiler-option");
}
- // Make sure there is a preloaded-classes file.
- if (!hasFile("/system/etc/preloaded-classes")) {
- ALOGE("Missing preloaded-classes file, /system/etc/preloaded-classes not found: %s\n",
- strerror(errno));
- return -1;
- }
- addOption("-Ximage-compiler-option");
- addOption("--image-classes=/system/etc/preloaded-classes");
-
- // If there is a compiled-classes file, push it.
- if (hasFile("/system/etc/compiled-classes")) {
+ // If there is a boot profile, it takes precedence over the image and preloaded classes.
+ if (hasFile("/system/etc/boot-image.prof")) {
+ addOption("-Ximage-compiler-option");
+ addOption("--profile-file=/system/etc/boot-image.prof");
+ addOption("-Ximage-compiler-option");
+ addOption("--compiler-filter=speed-profile");
+ } else {
+ // Make sure there is a preloaded-classes file.
+ if (!hasFile("/system/etc/preloaded-classes")) {
+ ALOGE("Missing preloaded-classes file, /system/etc/preloaded-classes not found: %s\n",
+ strerror(errno));
+ return -1;
+ }
addOption("-Ximage-compiler-option");
- addOption("--compiled-classes=/system/etc/compiled-classes");
+ addOption("--image-classes=/system/etc/preloaded-classes");
+
+ // If there is a compiled-classes file, push it.
+ if (hasFile("/system/etc/compiled-classes")) {
+ addOption("-Ximage-compiler-option");
+ addOption("--compiled-classes=/system/etc/compiled-classes");
+ }
}
property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");