OSDN Git Service

Merge korg/donut into korg/master
authorJean-Baptiste Queru <jbq@google.com>
Sun, 26 Jul 2009 03:35:55 +0000 (20:35 -0700)
committerJean-Baptiste Queru <jbq@google.com>
Sun, 26 Jul 2009 03:35:55 +0000 (20:35 -0700)
Conflicts:

libcore/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java
vm/oo/Class.c

1  2 
dexdump/DexDump.c
libcore/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java
vm/Android.mk
vm/Native.c
vm/analysis/CodeVerify.c
vm/mterp/out/InterpC-armv4t.c
vm/oo/Class.c

Simple merge
@@@ -52,8 -53,24 +53,33 @@@ public class PlatformAddressFactory 
       * Array of PlatformAddress references kept from garbage collection.
       */
      private static PlatformAddress[] cache = new PlatformAddress[CACHE_SIZE];
-     // END android-added
  
 -        if (value == 0) {
 -            return PlatformAddress.NULL;
+     /**
+      * Constructs a {@code PlatformAddress} or returns
+      * {@link PlatformAddress#NULL} if given a {@code null} address.
+      *
+      * @param address the start address for the memory; {@code 0} means
+      * {@code null}
+      * @param size the size of the memory in bytes
+      * @return an appropriately-constructed {@code PlatformAddress}
+      */
+     private static PlatformAddress make(int value, long size) {
 -
 -        return new PlatformAddress(value, size);
++        int idx = value >> 5;
++        for (int probe = 0; probe < MAX_PROBES; probe++) {
++            PlatformAddress cachedObj = cache[(idx + probe) & CACHE_MASK];
++            if (cachedObj == null) {
++                return cache[(idx + probe) & CACHE_MASK] =
++                    new PlatformAddress(value, size);
++            }
++            if (cachedObj.osaddr == value && cachedObj.size == size) {
++                return cachedObj;
++            }
+         }
++        replacementIndex = (replacementIndex + 1) % MAX_PROBES;
++        return cache[(idx + replacementIndex) & CACHE_MASK] =
++            new PlatformAddress(value, size);
+     }
+     // END android-added
  
      // BEGIN android-changed
      public synchronized static PlatformAddress on(int value, long size) {
diff --cc vm/Android.mk
Simple merge
diff --cc vm/Native.c
Simple merge
Simple merge
Simple merge
diff --cc vm/oo/Class.c
@@@ -151,8 -151,18 +151,19 @@@ Since the ultimate goal of this test i
  may not be worth the performance hit.
  */
  
+ /*
+  * Class serial numbers start at this value.  We use a nonzero initial
+  * value so they stand out in binary dumps (e.g. hprof output).
+  */
  #define INITIAL_CLASS_SERIAL_NUMBER 0x50000000
- #define ZYGOTE_CLASS_CUTOFF 2000
++
+ /*
+  * Constant used to size an auxillary class object data structure.
+  * For optimum memory use this should be equal to or slightly larger than
+  * the number of classes loaded when the zygote finishes initializing.
+  */
+ #define ZYGOTE_CLASS_CUTOFF 2304
  
  static ClassPathEntry* processClassPath(const char* pathStr, bool isBootstrap);
  static void freeCpeArray(ClassPathEntry* cpe);