{"ref":"refs/heads/carz","push_id":54403150,"commits":[{"sha":"90f85f98bb405ccd206f39287d571c69c4259158","author":{"email":"b3c38e7a5e5281f96aa91b8a7efafde8e7719896@google.com","name":"Jeff Brown"},"url":"https://api.github.com/repos/carz2/android_platform_dalvik/commits/90f85f98bb405ccd206f39287d571c69c4259158","message":"DO NOT MERGE: Optimize IndirectRefTable.\n\nRemoved unused debugging code that maintained pointers to the\n4 previous objects in each slot.\n\nPromoted the serial number property of a slot to be first class.\nThis is a sufficiently cheap and useful check to perform that we\nmight as well always do it.\n\nChanged get() and remove() so they check the validity of the\nreferences at the same time as they retrieve them.  They're\nalso a bit smarter about checking the reference kind given\nthat they can assume that the table will only contain references\nof one kind.  The checks are now much more consistent.\nFor example, remove() used to check whether an index was\nstale only in the case where it was not removing the top entry\n(now it always checks).\n\nMade add() return NULL instead of dvmAbort()'ing in the case\nwhere the table overflowed and ensure we don't blow away the\ntable in that cases.  This change resolves an issue with\nTestIndirectRefTable.cpp which deliberately overflows the table\nand expects add() to return NULL (as documented!).  As it\nhappens, the add() method is called in exactly 3 places in\nJni.cpp.  In each of those cases, the code was written to\nhandle a NULL result and only in the case of adding a weak\nglobal reference did it not abort.  Fixed the weak global\nreference case to be consistent with the others.\n\nChanged the signature of contains() to take an Object* since\nthat's what we're actually looking for inside the table.\n\nAdded a couple of calls to dump() in TestIndirectRefTable.cpp\nfor visual inspection of its correctness.\n\nPerformance as measured by TestIndirectRefTable on same hardware.\n\nOld implementation:\n- Add/remove 100 objects FIFO order, 100000 iterations, 0.023ms / iteration\n- Add/remove 100 objects LIFO order, 100000 iterations, 0.020ms / iteration\n- Get 100 objects, 100000 iterations, 0.009ms / iteration\n\nNew implementation:\n- Add/remove 100 objects FIFO order, 100000 iterations, 0.010ms / iteration\n- Add/remove 100 objects LIFO order, 100000 iterations, 0.009ms / iteration\n- Get 100 objects, 100000 iterations, 0.002ms / iteration\n\nCherry-pick from master.\n\nConflicts:\n\n\tvm/IndirectRefTable.cpp\n\nChange-Id: I157f3c1ba598137222878b8e6a5890efb744fe76"},{"sha":"1f7a8a6a296ba9d80659560a042603e5f9174e5a","author":{"email":"fcce078dda1e415b072bbd7a0d74a20c665f0947@google.com","name":"Elliott Hughes"},"url":"https://api.github.com/repos/carz2/android_platform_dalvik/commits/1f7a8a6a296ba9d80659560a042603e5f9174e5a","message":"Knock ::self() out of the ParseXml profile.\n\nNew profile (>=0.6, which is where the original seems to have cut off):\n\n47       11.0070  dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)\n30        7.0258  dvmChangeStatus(Thread*, ThreadStatus)\n29        6.7916  addLocalReference(Thread*, Object*)\n26        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*)\n22        5.1522  dalvik_inst\n15        3.5129  lockMonitor(Thread*, Monitor*)\n14        3.2787  dvmLineNumFromPC\n13        3.0445  javaLangString_equals(unsigned int, unsigned int, unsigned int, unsigned int, JValue*)\n13        3.0445  scanObject(Object const*, GcMarkContext*)\n12        2.8103  ScopedJniThreadState::ScopedJniThreadState(_JNIEnv*)\n12        2.8103  common_invokeMethodNoRange\n12        2.8103  dvmDecodeIndirectRef(Thread*, _jobject*)\n9         2.1077  IndirectRefTable::add(unsigned int, Object*)\n9         2.1077  ReleasePrimitiveArrayCritical(_JNIEnv*, _jarray*, void*, int)\n9         2.1077  markObjectNonNull(Object const*, GcMarkContext*, bool)\n9         2.1077  unpinPrimitiveArray(ArrayObject*)\n8         1.8735  getCodeAddrCommon(unsigned short const*, bool)\n7         1.6393  dexStringByTypeIdx(DexFile const*, unsigned int)\n7         1.6393  dvmHeapSourceAlloc(unsigned int)\n6         1.4052  GetPrimitiveArrayCritical(_JNIEnv*, _jarray*, unsigned char*)\n6         1.4052  dvmPlatformInvoke\n6         1.4052  pinPrimitiveArray(ArrayObject*)\n6         1.4052  readUnsignedLeb128(unsigned char const**)\n6         1.4052  scanFields(Object const*, GcMarkContext*)\n5         1.1710  IndirectRefTable::get(void*) const\n5         1.1710  dvmFindInReferenceTable(ReferenceTable const*, Object**, Object*)\n4         0.9368  common_returnFromMethod\n4         0.9368  dvmAddToReferenceTable(ReferenceTable*, Object*)\n4         0.9368  dvmHeapBitmapScanWalk(HeapBitmap*, void (*)(Object*, void*, void*), void*)\n4         0.9368  dvmInterpret(Thread*, Method const*, JValue*)\n4         0.9368  dvmLockObject\n4         0.9368  dvmMalloc(unsigned int, int)\n4         0.9368  findPackedSwitchIndex(unsigned short const*, int, int)\n4         0.9368  readStringIdx(DexFile const*, unsigned char const**)\n4         0.9368  unlockMonitor(Thread*, Monitor*)\n3         0.7026  dvmSetFinalizable\n\nChange-Id: Ic5c36859f6810413bd0b48aad1d99da7daa6e8ba"},{"sha":"2abd45685316c5173880e79607d3133873d5f33d","author":{"email":"f1f8dcbb1e54d6885eaafdba2fee49a871334033@android.com","name":"Andy McFadden"},"url":"https://api.github.com/repos/carz2/android_platform_dalvik/commits/2abd45685316c5173880e79607d3133873d5f33d","message":"Reduce Dalvik card table overhead\n\nThe VM has a \"growth limit\" (e.g. 48MB) that is used to cap normal\napps, and a \"max heap\" (e.g. 128MB) that is used for apps with unusual\nhigh-memory requirements.  The Dalvik GC uses a 128:1 \"card table\"\nthat spans the entire managed heap, out to the \"max heap\" limit.\n\nThe table is erased during every concurrent GC.  The first time\nwe do that post-zygote, the copy-on-write behavior causes physical\npages to be allocated.  We're currently clearing out to the heap max,\nnot the growth limit, which means we have a bunch of physical memory\nallocated for pages that will never be used.\n\nThis changes it so we only clear out to the growth limit.  If the\ngrowth limit is removed by the app, we clear out to the heap max.\nOn devices with a 128MB max heap, this reduces the private/dirty\nusage for most apps by 640KB.\n\nBug 5567332\n\nChange-Id: Iac633017c128d63b284d48016e47d40cc46df1de"},{"sha":"0be62637adfb377d13dfad68c6f648fafe95ea02","author":{"email":"f1f8dcbb1e54d6885eaafdba2fee49a871334033@android.com","name":"Andy McFadden"},"url":"https://api.github.com/repos/carz2/android_platform_dalvik/commits/0be62637adfb377d13dfad68c6f648fafe95ea02","message":"DO NOT MERGE Further refinement of card table clear\n\nWe're currently using memset() to clear cards out to the growth\nlimit, which on a device configured for 48MB/128MB process caps\nmeans we're sitting on 384KB or 1MB of pages.  We can reduce that\nsubstantially.\n\nThis change attempts to reduce the memset() length to the currently\nactive portion of the card table, based on the placement of objects\nin the \"live objects\" bitmap.  This should avoid faulting in card\npages that we don't actually need.\n\nThis is suboptimal when parts of the card table are used briefly\nand then ignored for a while.  An alternative implementation, which\nuses madvise(DONTNEED) aggressively, is also included (#ifdefed out).\n\nBug 5567332\n\n(cherry-pick from master)\n\nChange-Id: I6b181de20a0c8b6307acaebbc5d6dac20422f25d"},{"sha":"f8fa4b8d69d9cd0c9ec1db395be928838592e361","author":{"email":"a2da1cb1b52d6ee0f2df213cb30ef8eb23d9f3b3@google.com","name":"Ben Cheng"},"url":"https://api.github.com/repos/carz2/android_platform_dalvik/commits/f8fa4b8d69d9cd0c9ec1db395be928838592e361","message":"Initialize the JNI indirect ref table to make Valgrind happy.\n\nSpecifically, this is to eliminate the benign warning about the\n'serial' field being uninitialized.\n\nBUG: 5542417\nChange-Id: I8550972e70db94f24c47c4e5dea0b59cc5840b48"}],"head":"f8fa4b8d69d9cd0c9ec1db395be928838592e361","size":5}