Permalink
Switch branches/tags
Nothing to show
Commits on Mar 31, 2012
  1. Merge remote-tracking branch 'remotes/aosp/ics-mr1-release' into ics

    greg-pe committed Mar 31, 2012
    Conflicts:
    	tests/083-jit-regressions/expected.txt
    	tests/083-jit-regressions/info.txt
    	tests/083-jit-regressions/src/Main.java
    	vm/analysis/CodeVerify.cpp
    	vm/compiler/Frontend.cpp
    	vm/mterp/common/asm-constants.h
    	vm/native/dalvik_system_Zygote.cpp
Commits on Feb 10, 2012
  1. [PATCH] Basic KSM Support

    showp1984 authored and greg-pe committed Jan 25, 2012
    Be sure to add '#define MADV_MERGEABLE 12' to
    bionic/libc/include/sys/mman.h so we can have a central place for this
    
    parse the process memory map and inform madvise common HEAP/Stack
    regions on fork from zygote
    
    These then can be used by the kernel KSM module to re-join (copy on write)
    pages between the various dalvik processes.
    
    As is on a fully loaded system you can expect ~12MB to be indicated to be
    scanned by KSM.. of this 10-15% will be saved; as such a recommend a very
    slow scan until as any logic to stop scanning while sleeping will require
    another process and remove all memory savings provided by this logic.
    
    To activate on a KSM kernel (2min for full scan of ~16m and 1%CPU):
    
    echo 4000 > /sys/kernel/mm/ksm/sleep_millisecs
    echo 128 > /sys/kernel/mm/ksm/pages_to_scan
    echo 1 > /sys/kernel/mm/ksm/run
    
    Newer kernels only require the last line.
    
    In future additional memory regions and kernel logic may improve this.
    
    Change-Id: I271cbee74a1f02a89c34c6ee9006a4ea81360154
  2. Initial upload

    greg-pe committed Feb 10, 2012
Commits on Jan 21, 2012
  1. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Jan 21, 2012
Commits on Jan 19, 2012
  1. Fix to dex verifier to handle float types that look like Boolean.

    jeffyhao committed Jan 18, 2012
    Addresses http://code.google.com/p/android/issues/detail?id=23465, where
    a Float value is potentially 0x0 or Float.MIN_VALUE (0x1), which combines
    into a Boolean type, which should be allowed to be promoted to Float.
    
    (cherry picked from commit 2a249c5)
    
    Change-Id: I1b81fad5e1e166246535bdfa4b7a98db3b2531bf
  2. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Jan 19, 2012
Commits on Jan 18, 2012
  1. Bug fix for control-flow construction involving nested loops.

    Ben Cheng
    Ben Cheng committed Jan 18, 2012
    Bug: 5884080
    Change-Id: Ic2f42abae3e71f9c0729984902396f92902184a3
Commits on Jan 14, 2012
  1. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Jan 14, 2012
Commits on Jan 13, 2012
  1. fix personality call.

    nickkral committed Jan 13, 2012
    Change-Id: I25845344494ac15b4a6876784d2b040779892459
  2. Prevent memory fragmentation.

    Selim Gurun
    Selim Gurun committed Jan 13, 2012
    	Bug: 5817320
    
    Prevent memory fragmentation and potential allocation failures. This
    change is temporary.
    
    Change-Id: Id1e8f9606687648235ea9e18861125a8c799d812
Commits on Dec 2, 2011
  1. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Dec 2, 2011
Commits on Dec 1, 2011
  1. Initialize the vC field of inlined getters/setters.

    Ben Cheng
    Ben Cheng committed Dec 1, 2011
    To eliminate a benign Valgrind warning.
    
    Change-Id: I5f0ae53b8c86fe476f0b7ddfb6589191aea464f6
Commits on Nov 30, 2011
  1. Initialize the JNI indirect ref table to make Valgrind happy.

    Ben Cheng
    Ben Cheng committed Nov 30, 2011
    Specifically, this is to eliminate the benign warning about the
    'serial' field being uninitialized.
    
    BUG: 5542417
    Change-Id: I8550972e70db94f24c47c4e5dea0b59cc5840b48
Commits on Nov 10, 2011
  1. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Nov 10, 2011
  2. DO NOT MERGE Further refinement of card table clear

    fadden committed Nov 8, 2011
    We're currently using memset() to clear cards out to the growth
    limit, which on a device configured for 48MB/128MB process caps
    means we're sitting on 384KB or 1MB of pages.  We can reduce that
    substantially.
    
    This change attempts to reduce the memset() length to the currently
    active portion of the card table, based on the placement of objects
    in the "live objects" bitmap.  This should avoid faulting in card
    pages that we don't actually need.
    
    This is suboptimal when parts of the card table are used briefly
    and then ignored for a while.  An alternative implementation, which
    uses madvise(DONTNEED) aggressively, is also included (#ifdefed out).
    
    Bug 5567332
    
    (cherry-pick from master)
    
    Change-Id: I6b181de20a0c8b6307acaebbc5d6dac20422f25d
Commits on Nov 6, 2011
  1. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Nov 6, 2011
Commits on Nov 5, 2011
  1. Merge "Don't pay for filename/line number lookup unless you need to."…

    enh authored and Android (Google) Code Review committed Nov 5, 2011
    … into ics-mr1
  2. Merge "Knock ::self() out of the ParseXml profile." into ics-mr1

    enh authored and Android (Google) Code Review committed Nov 5, 2011
Commits on Nov 4, 2011
  1. Merge "Reduce Dalvik card table overhead" into ics-mr1

    fadden authored and Android (Google) Code Review committed Nov 4, 2011
  2. Don't decr profiling count without incr

    fadden committed Nov 4, 2011
    The failure cleanup code in dvmMethodTraceStart() was assuming
    that profiling had already been started, which was true until my
    previous change.  The code in the interpreter isn't too picky, but
    updateActiveProfilers() is trying to keep an accurate acount, and
    gets upset.  If you pass in a bad filename, we disable something that
    was never enabled, and the VM gets confused and aborts out of spite.
    
    Related to bug 5564440
    
    Change-Id: I17fd8bf4654c29f49efb10142d222a91c190b6ed
  3. Reduce Dalvik card table overhead

    fadden committed Nov 4, 2011
    The VM has a "growth limit" (e.g. 48MB) that is used to cap normal
    apps, and a "max heap" (e.g. 128MB) that is used for apps with unusual
    high-memory requirements.  The Dalvik GC uses a 128:1 "card table"
    that spans the entire managed heap, out to the "max heap" limit.
    
    The table is erased during every concurrent GC.  The first time
    we do that post-zygote, the copy-on-write behavior causes physical
    pages to be allocated.  We're currently clearing out to the heap max,
    not the growth limit, which means we have a bunch of physical memory
    allocated for pages that will never be used.
    
    This changes it so we only clear out to the growth limit.  If the
    growth limit is removed by the app, we clear out to the heap max.
    On devices with a 128MB max heap, this reduces the private/dirty
    usage for most apps by 640KB.
    
    Bug 5567332
    
    Change-Id: Iac633017c128d63b284d48016e47d40cc46df1de
  4. Don't pay for filename/line number lookup unless you need to.

    enh committed Nov 4, 2011
    This wasn't a regression; the code's always been like this. But this shows up
    in profiles of anything doing a lot of synchronized stuff, even when there's
    no contention.
    
    There are two awkward cases. One is that the old code used to offer a variety
    of special-case messages for failures to find the current frame, save area,
    and Method*. I assume this was just to help in debugging and shouldn't happen
    in practice, so I don't think we've lost anything there. The other case was
    that on unlocking, we used to explicitly say "unlocked". But I'm not sure we
    could get into a situation where we'd be reporting contention on a monitor
    that wasn't locked when we tried to lock it. So I think that's okay too.
    
    Change-Id: Ib4401c771f717e9c8cc9c4e5346ec7a5f46a1636
Commits on Nov 3, 2011
  1. Knock ::self() out of the ParseXml profile.

    enh committed Nov 3, 2011
    New profile (>=0.6, which is where the original seems to have cut off):
    
    47       11.0070  dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)
    30        7.0258  dvmChangeStatus(Thread*, ThreadStatus)
    29        6.7916  addLocalReference(Thread*, Object*)
    26        6.0890  dexDecodeDebugInfo(DexFile const*, DexCode const*, char const*, unsigned int, unsigned int, int (*)(void*, unsigned int, unsigned int), void (*)(void*, unsigned short, unsigned int, unsigned int, char const*, char const*, char const*), void*)
    22        5.1522  dalvik_inst
    15        3.5129  lockMonitor(Thread*, Monitor*)
    14        3.2787  dvmLineNumFromPC
    13        3.0445  javaLangString_equals(unsigned int, unsigned int, unsigned int, unsigned int, JValue*)
    13        3.0445  scanObject(Object const*, GcMarkContext*)
    12        2.8103  ScopedJniThreadState::ScopedJniThreadState(_JNIEnv*)
    12        2.8103  common_invokeMethodNoRange
    12        2.8103  dvmDecodeIndirectRef(Thread*, _jobject*)
    9         2.1077  IndirectRefTable::add(unsigned int, Object*)
    9         2.1077  ReleasePrimitiveArrayCritical(_JNIEnv*, _jarray*, void*, int)
    9         2.1077  markObjectNonNull(Object const*, GcMarkContext*, bool)
    9         2.1077  unpinPrimitiveArray(ArrayObject*)
    8         1.8735  getCodeAddrCommon(unsigned short const*, bool)
    7         1.6393  dexStringByTypeIdx(DexFile const*, unsigned int)
    7         1.6393  dvmHeapSourceAlloc(unsigned int)
    6         1.4052  GetPrimitiveArrayCritical(_JNIEnv*, _jarray*, unsigned char*)
    6         1.4052  dvmPlatformInvoke
    6         1.4052  pinPrimitiveArray(ArrayObject*)
    6         1.4052  readUnsignedLeb128(unsigned char const**)
    6         1.4052  scanFields(Object const*, GcMarkContext*)
    5         1.1710  IndirectRefTable::get(void*) const
    5         1.1710  dvmFindInReferenceTable(ReferenceTable const*, Object**, Object*)
    4         0.9368  common_returnFromMethod
    4         0.9368  dvmAddToReferenceTable(ReferenceTable*, Object*)
    4         0.9368  dvmHeapBitmapScanWalk(HeapBitmap*, void (*)(Object*, void*, void*), void*)
    4         0.9368  dvmInterpret(Thread*, Method const*, JValue*)
    4         0.9368  dvmLockObject
    4         0.9368  dvmMalloc(unsigned int, int)
    4         0.9368  findPackedSwitchIndex(unsigned short const*, int, int)
    4         0.9368  readStringIdx(DexFile const*, unsigned char const**)
    4         0.9368  unlockMonitor(Thread*, Monitor*)
    3         0.7026  dvmSetFinalizable
    
    Change-Id: Ic5c36859f6810413bd0b48aad1d99da7daa6e8ba
  2. Start profiling after state prep

    fadden committed Nov 3, 2011
    The updateActiveProfilers() call was happening before the profiler
    state setup was completed, creating a race that could lead to a
    native crash.
    
    Bug 5564440
    
    Change-Id: I8c030fc87f106aa8b2a67876d604a5bd79e05175
  3. Merge "DO NOT MERGE: Optimize IndirectRefTable." into ics-mr1

    enh authored and Android (Google) Code Review committed Nov 3, 2011
Commits on Nov 2, 2011
  1. Don't malloc between fork and exec

    fadden committed Nov 2, 2011
    This was causing hangs in DEX file loading.
    
    Bug 5329833
    
    Change-Id: I19e9e0624f3823cc771c71a4b4ac177d57343c58
  2. merge in ics-mr1-release history after reset to ics-mr1

    The Android Automerger
    The Android Automerger committed Nov 2, 2011
Commits on Nov 1, 2011
  1. am 3931f79: Fix cleanup (cherry-picked from ics-mr1)

    fadden authored and Android Git Automerger committed Nov 1, 2011
    * commit '3931f79801b67577bf8ac12d0b3fb5b4aeaaf766':
      Fix cleanup (cherry-picked from ics-mr1)
  2. Fix cleanup

    fadden authored and Ben Cheng committed Nov 1, 2011
    (cherry-picked from ics-mr1)
    
    The code was attempting to null out a struct member after freeing
    the struct.
    
    Also, changed the order of directory permission tests so that
    writable comes first.  Somehow "dalvik-cache directory not
    writable" seems more direct than "not readable", since the code
    isn't generally interested in reading the directory.
    
    Bug 5549907
    
    Change-Id: If737ab822b356aae98e47292d21946e33a04342b
  3. am e3d9cde: Disable JIT single-stepping resume mode.

    Ben Cheng Android Git Automerger
    Ben Cheng authored and Android Git Automerger committed Nov 1, 2011
    * commit 'e3d9cde40f96bf40dd4ad3d495949869bde5dd1e':
      Disable JIT single-stepping resume mode.
  4. Disable JIT single-stepping resume mode.

    Ben Cheng
    Ben Cheng committed Nov 1, 2011
    BUG: 5551114
    Change-Id: Id8ee75be5e71ee258994235952871ad181024e56
  5. Fix cleanup

    fadden committed Nov 1, 2011
    The code was attempting to null out a struct member after freeing
    the struct.
    
    Also, changed the order of directory permission tests so that
    writable comes first.  Somehow "dalvik-cache directory not
    writable" seems more direct than "not readable", since the code
    isn't generally interested in reading the directory.
    
    Bug 5549907
    
    Change-Id: Ie412ff6c0870357b92e53606f70cb9407e04e7cf
  6. DO NOT MERGE: Optimize IndirectRefTable.

    j9brown authored and Christopher Tate committed Oct 27, 2011
    Removed unused debugging code that maintained pointers to the
    4 previous objects in each slot.
    
    Promoted the serial number property of a slot to be first class.
    This is a sufficiently cheap and useful check to perform that we
    might as well always do it.
    
    Changed get() and remove() so they check the validity of the
    references at the same time as they retrieve them.  They're
    also a bit smarter about checking the reference kind given
    that they can assume that the table will only contain references
    of one kind.  The checks are now much more consistent.
    For example, remove() used to check whether an index was
    stale only in the case where it was not removing the top entry
    (now it always checks).
    
    Made add() return NULL instead of dvmAbort()'ing in the case
    where the table overflowed and ensure we don't blow away the
    table in that cases.  This change resolves an issue with
    TestIndirectRefTable.cpp which deliberately overflows the table
    and expects add() to return NULL (as documented!).  As it
    happens, the add() method is called in exactly 3 places in
    Jni.cpp.  In each of those cases, the code was written to
    handle a NULL result and only in the case of adding a weak
    global reference did it not abort.  Fixed the weak global
    reference case to be consistent with the others.
    
    Changed the signature of contains() to take an Object* since
    that's what we're actually looking for inside the table.
    
    Added a couple of calls to dump() in TestIndirectRefTable.cpp
    for visual inspection of its correctness.
    
    Performance as measured by TestIndirectRefTable on same hardware.
    
    Old implementation:
    - Add/remove 100 objects FIFO order, 100000 iterations, 0.023ms / iteration
    - Add/remove 100 objects LIFO order, 100000 iterations, 0.020ms / iteration
    - Get 100 objects, 100000 iterations, 0.009ms / iteration
    
    New implementation:
    - Add/remove 100 objects FIFO order, 100000 iterations, 0.010ms / iteration
    - Add/remove 100 objects LIFO order, 100000 iterations, 0.009ms / iteration
    - Get 100 objects, 100000 iterations, 0.002ms / iteration
    
    Cherry-pick from master.
    
    Conflicts:
    
    	vm/IndirectRefTable.cpp
    
    Change-Id: I157f3c1ba598137222878b8e6a5890efb744fe76
Commits on Oct 28, 2011
  1. Fix single-stepping resume mode in the interpreter.

    Ben Cheng The Android Automerger
    Ben Cheng authored and The Android Automerger committed Oct 27, 2011
    (cherry-picked from master)
    
    When a resume attempt is cancelled due to other pending request make sure
    the old native resume PC is cleared. Otherwise the JIT code cache may be
    re-entered with mismatching Dalvik PC.
    
    Also fix a code bloat problem where single-step count is not set properly
    after executing a return instruction.
    
    BUG: 5208786
    
    Change-Id: I39db1633dcda1f464311c878ded4b5695a9b7ffd
  2. am b1e2271: Fix single-stepping resume mode in the interpreter.

    Ben Cheng Android Git Automerger
    Ben Cheng authored and Android Git Automerger committed Oct 28, 2011
    * commit 'b1e2271b51cfb1f264b8966f1151652767259751':
      Fix single-stepping resume mode in the interpreter.