Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 802527c6 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 20713 into donut

* changes:
  Updated preloaded-classes file.
parents c8ddd37a 2e93f65c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -291,6 +291,15 @@ public class ZygoteInit {
                        } else {
                            missingClasses += " " + line;
                        }
                    } catch (Throwable t) {
                        Log.e(TAG, "Error preloading " + line + ".", t);
                        if (t instanceof Error) {
                            throw (Error) t;
                        }
                        if (t instanceof RuntimeException) {
                            throw (RuntimeException) t;
                        }
                        throw new RuntimeException(t);
                    }
                }

+1419 −129

File changed.

Preview size limit exceeded, changes collapsed.

+15 MiB

File added.

No diff preview for this file type.

+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class ClassRank implements Comparator<Operation> {
     * Increase this number to add more weight to classes which were loaded
     * earlier.
     */
    static final int SEQUENCE_WEIGHT = 500; // 5 ms
    static final int SEQUENCE_WEIGHT = 500; // 0.5ms

    static final int BUCKET_SIZE = 5;

+15 −25
Original line number Diff line number Diff line
@@ -15,10 +15,7 @@
 */

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.*;

/**
 * A loaded class.
@@ -54,7 +51,7 @@ class LoadedClass implements Serializable, Comparable<LoadedClass> {
    }

    void measureMemoryUsage() {
        this.memoryUsage = MemoryUsage.forClass(name);        
//        this.memoryUsage = MemoryUsage.forClass(name);
    }

    int mlt = -1;
@@ -102,31 +99,20 @@ class LoadedClass implements Serializable, Comparable<LoadedClass> {
        }
    }

    /**
     * Counts loads by apps.
     */
    int appLoads() {
        return operationsByApps(loads);
    }

    /**
     * Counts inits by apps.
     */
    int appInits() {
        return operationsByApps(initializations);
    /** Returns names of apps that loaded this class. */
    Set<String> applicationNames() {
        Set<String> appNames = new HashSet<String>();
        addProcessNames(loads, appNames);
        addProcessNames(initializations, appNames);
        return appNames;
    }

    /**
     * Counts number of app operations in the given list.
     */
    private static int operationsByApps(List<Operation> operations) {
        int byApps = 0;
        for (Operation operation : operations) {
    private void addProcessNames(List<Operation> ops, Set<String> appNames) {
        for (Operation operation : ops) {
            if (operation.process.isApplication()) {
                byApps++;
                appNames.add(operation.process.name);
            }
        }
        return byApps;
    }

    public int compareTo(LoadedClass o) {
@@ -160,4 +146,8 @@ class LoadedClass implements Serializable, Comparable<LoadedClass> {

        return false;
    }

    public boolean isPreloadable() {
        return systemClass && Policy.isPreloadableClass(name);
    }
}
Loading