Merge "Regenerate preloaded classes for Gingerbread." into gingerbread
This commit is contained in:
1305
preloaded-classes
1305
preloaded-classes
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,11 @@ public class WritePreloadedClassFile {
|
|||||||
*/
|
*/
|
||||||
static final int MIN_LOAD_TIME_MICROS = 1250;
|
static final int MIN_LOAD_TIME_MICROS = 1250;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preload any class that was loaded by at least MIN_PROCESSES processes.
|
||||||
|
*/
|
||||||
|
static final int MIN_PROCESSES = 10;
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException,
|
public static void main(String[] args) throws IOException,
|
||||||
ClassNotFoundException {
|
ClassNotFoundException {
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
@@ -58,6 +63,7 @@ public class WritePreloadedClassFile {
|
|||||||
out.write("# Automatically generated by frameworks/base/tools/preload/"
|
out.write("# Automatically generated by frameworks/base/tools/preload/"
|
||||||
+ WritePreloadedClassFile.class.getSimpleName() + ".java.\n");
|
+ WritePreloadedClassFile.class.getSimpleName() + ".java.\n");
|
||||||
out.write("# MIN_LOAD_TIME_MICROS=" + MIN_LOAD_TIME_MICROS + "\n");
|
out.write("# MIN_LOAD_TIME_MICROS=" + MIN_LOAD_TIME_MICROS + "\n");
|
||||||
|
out.write("# MIN_PROCESSES=" + MIN_PROCESSES + "\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The set of classes to preload. We preload a class if:
|
* The set of classes to preload. We preload a class if:
|
||||||
@@ -73,7 +79,12 @@ public class WritePreloadedClassFile {
|
|||||||
// the memory associated with these classes will be shared.
|
// the memory associated with these classes will be shared.
|
||||||
for (LoadedClass loadedClass : root.loadedClasses.values()) {
|
for (LoadedClass loadedClass : root.loadedClasses.values()) {
|
||||||
Set<String> names = loadedClass.processNames();
|
Set<String> names = loadedClass.processNames();
|
||||||
if (shouldPreload(loadedClass) && names.size() > 1) {
|
if (!Policy.isPreloadable(loadedClass)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (names.size() >= MIN_PROCESSES ||
|
||||||
|
(loadedClass.medianTimeMicros() > MIN_LOAD_TIME_MICROS && names.size() > 1)) {
|
||||||
toPreload.add(loadedClass);
|
toPreload.add(loadedClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(call all-subdir-java-files)
|
LOCAL_SRC_FILES := $(call all-subdir-java-files)
|
||||||
|
LOCAL_MODULE_TAGS := tests
|
||||||
|
|
||||||
LOCAL_MODULE := loadclass
|
LOCAL_MODULE := loadclass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user