9d7a4ac1c3dc9075302c573e298ea2557cc90549 |
|
22-Mar-2016 |
Mathieu Chartier <mathieuc@google.com> |
Delete too spammy VLOG(heap) in ReleasePrimitiveArray Change-Id: I7a482ba366d7ad3e5d1689ae615dbcacbc7a41a6
|
4d87df607a0b86cdf4b2c04f61d72a60d8975ce0 |
|
08-Jan-2016 |
Mathieu Chartier <mathieuc@google.com> |
Improve handling of daemon threads after runtime shutdown The main issue comes from the fact that user daemon threads are allowed to continue running after the runtime has shutdown. They may still have a JNI env pointer. To prevent crashing if they call into the env, we replace the function pointers with functions that sleep forever. The other issue is that user daemon threads that are blocked in an ART condition variable may get woken up by another user daemon inside of Monitor::Notify or by a spurious wakeup (i.e. SIGQUIT). To deal with this issue, we check the JNI env for shutdown runtime when we are woken up from a condition variable wait. This check fixes test 132 with --host --gdb --interpreter. Previously this test crashed since dlclose was somehow causing a spurious futex wakeup. TODO: Investigate adding a unit test. Bug: 18577101 Change-Id: I479b38968ee9fbc4ee4b252ee2528787279972cc
|
e64300b8488716056775ecbfa2915dd1b4ce7e08 |
|
16-Dec-2015 |
Alex Light <allight@google.com> |
Revert "Revert "Combine direct_methods_ and virtual_methods_ fields of mirror::Class"" This reverts commit ae358c1d5cef227b44d6f4971b79e1ab91aa26eb. Bug: 24618811 Change-Id: I8becf9bae3258450b90cfef5e79589db7c535a4d
|
2efb0aa57da168944f99a2d13aed2a426cfa76e7 |
|
15-Dec-2015 |
Alex Light <allight@google.com> |
Revert "Combine direct_methods_ and virtual_methods_ fields of mirror::Class" This reverts commit 9539150b85142c18e9e8c2264b5b6100942667c3. Change-Id: I596876cd643ec0ad524a56621efb6b89e8886230
|
ae358c1d5cef227b44d6f4971b79e1ab91aa26eb |
|
15-Dec-2015 |
Alex Light <allight@google.com> |
Revert "Combine direct_methods_ and virtual_methods_ fields of mirror::Class" This reverts commit 6286a97bea0f584342803a215550038852b24776. Change-Id: I5b00f6d1350e9c587acd4b185367dc815ea707de
|
9539150b85142c18e9e8c2264b5b6100942667c3 |
|
04-Dec-2015 |
Alex Light <allight@google.com> |
Combine direct_methods_ and virtual_methods_ fields of mirror::Class Manual cherry-pick of 6286a97 to master This makes several parts of the overall runtime simpler and reduces the size of a class object by 32-bits. Bug: 24618811 Change-Id: I36129b52189e26898ea56fa2b7b45652e06af236
|
6286a97bea0f584342803a215550038852b24776 |
|
04-Dec-2015 |
Alex Light <allight@google.com> |
Combine direct_methods_ and virtual_methods_ fields of mirror::Class This makes several parts of the overall runtime simpler and reduces the size of a class object by 32-bits. Bug: 24618811 Change-Id: I36129b52189e26898ea56fa2b7b45652e06af236
|
1646d7a22e43a1fb25452ead47a4073e63d7f391 |
|
28-Oct-2015 |
Bruce Hoult <b.hoult@samsung.com> |
Optimize some commonly used utf8 functions by: - using counted loops instead of searching for terminating null. In the important cases the caller already knows the length: change the API to pass it in. Keep the old API version as well to avoid extensive changes to non-critical debug and test code. - ensure the common cases are at the start of if/then/else chains. Usually 99+% of characters are ASCII even in mixed strings. - for the "convert" functions, when both utf8 and utf16 lengths are passed, and are equal, it means the entire string is ASCII, and a specialized loop can be used. The compiler might then unroll or even vectorize this. The functions improved are (tested on Nexus 5 with a 44 character ASCII string): CountModifiedUtf8Chars : 20% faster ConvertUtf16ToModifiedUtf8: 80% faster ConvertModifiedUtf8ToUtf16: 200% faster Also for completeness CountUtf8Bytes has been cleaned up a little, but the speed is unchanged. Unlike CountModifiedUtf8Chars, it was already passed the length, rather than searching for null. Change-Id: I1c9b7dea3eda869fc9f5f6b4dd6be8cdd5bc3ac0
|
8a89433aafe6dbb88fa1659b4364d733e5af739b |
|
07-May-2015 |
Piotr Jastrzebski <haaawk@google.com> |
Update runtime to work with the OpenJdk String. The key difference here is that the OpenJdk String class does not maintain an offset or a count field into its backing char[] array. The offset is assumed to be zero, and the count is always array.length. Change-Id: I8b0518642f440cd38d24d9b90c575b7110233cc5
|
795e341fff6c1984a34667c971a7153a8d63eb23 |
|
06-Nov-2015 |
Vladimir Marko <vmarko@google.com> |
ART: Fix potential integer overflow in JNI. Change-Id: I06fe2035f911cfc8537e27961c2dc2c7e4d1e20d
|
4b8f1ecd3aa5a29ec1463ff88fee9db365f257dc |
|
26-Aug-2015 |
Roland Levillain <rpl@google.com> |
Use ATTRIBUTE_UNUSED more. Use it in lieu of UNUSED(), which had some incorrect uses. Change-Id: If247dce58b72056f6eea84968e7196f0b5bef4da
|
76f55b030d2517d434f227bee2363c3fb760e5c6 |
|
22-Aug-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Synchronize JNI critical calls with the CC collector thread flip. JNI critical calls (like GetArrayElementsCritical) would need to block for the whole GC run to finish if the CC collector GC is ongoing. This CL changes it so that they don't need to block for the GC run, but only for the duration of the thread flip operation, which is much shorter. This is valid due to the to-space invariant. Bug: 12687968 Bug: 19235243 Change-Id: I1b6b4ae4fa539ddc0ec50b10ae8c8709f2a12fe8
|
90443477f9a0061581c420775ce3b7eeae7468bc |
|
17-Jul-2015 |
Mathieu Chartier <mathieuc@google.com> |
Move to newer clang annotations Also enable -Wthread-safety-negative. Changes: Switch to capabilities and negative capabilities. Future work: Use capabilities to implement uninterruptible annotations to work with AssertNoThreadSuspension. Bug: 20072211 Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
|
e290896bfccb170f589407c0d10945c8ae0c5807 |
|
26-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
Require mutator lock for DeleteLocalRef There was a race condition where suspended threads could call DeleteLocalRef while the GC was marking their roots. This could cause the GC to attempt to mark a null object. (cherry picked from commit dd06afecd67fc6a60856436ab150a4d1b9a8ad29) Bug: 22119403 Change-Id: I962c717bb87b2acb2a4710a2d7ab16793e031401
|
dd06afecd67fc6a60856436ab150a4d1b9a8ad29 |
|
26-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
Require mutator lock for DeleteLocalRef There was a race condition where suspended threads could call DeleteLocalRef while the GC was marking their roots. This could cause the GC to attempt to mark a null object. Bug: 22119403 Change-Id: I962c717bb87b2acb2a4710a2d7ab16793e031401
|
08ac922cf18e6a34a964a89031505395eeeeef2e |
|
22-May-2015 |
Brian Carlstrom <bdc@google.com> |
Fix JNI GetSuperClasss Change-Id: I005e9f84220dabfcea7cbc7b7b0ad422dd435a40
|
3d21bdf8894e780d349c481e5c9e29fe1556051c |
|
22-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Move mirror::ArtMethod to native Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 (cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33) Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d Fix some ArtMethod related bugs Added root visiting for runtime methods, not currently required since the GcRoots in these methods are null. Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes --trace run-tests 005, 044. Fixed optimizing compiler bug where we used a normal stack location instead of double on ARM64, this fixes the debuggable tests. TODO: Fix JDWP tests. Bug: 19264997 Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3 ART: Fix casts for 64-bit pointers on 32-bit compiler. Bug: 19264997 Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457 Fix JDWP tests after ArtMethod change Fixes Throwable::GetStackDepth for exception event detection after internal stack trace representation change. Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of proxy method. Bug: 19264997 Change-Id: I363e293796848c3ec491c963813f62d868da44d2 Fix accidental IMT and root marking regression Was always using the conflict trampoline. Also included fix for regression in GC time caused by extra roots. Most of the regression was IMT. Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to detached thread. EvaluateAndApplyChanges: From ~2500 -> ~1980 GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots Bug: 19264997 Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0 Fix bogus image test assert Previously we were comparing the size of the non moving space to size of the image file. Now we properly compare the size of the image space against the size of the image file. Bug: 19264997 Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a [MIPS64] Fix art_quick_invoke_stub argument offsets. ArtMethod reference's size got bigger, so we need to move other args and leave enough space for ArtMethod* and 'this' pointer. This fixes mips64 boot. Bug: 19264997 Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
|
e401d146407d61eeb99f8d6176b2ac13c4df1e33 |
|
22-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Move mirror::ArtMethod to native Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
|
39b6c24ce68cf05db0f82f454b4401cfb03d675f |
|
20-May-2015 |
Jeff Hao <jeffhao@google.com> |
Intercept JNI invocation of String.<init> methods. libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and initialize a string instead of using the recommended NewObject. This change adds an intercept to change the String.<init> call to a StringFactory call instead. Then, it uses the object id of the original string object referrer and maps it to the result of the StringFactory. Bug: 21288130 (cherry picked from commit 15e9ad1d028d7f12cb598b075453173532a00d91) Change-Id: I3421c43722c07397da4a398c2ca9110e1d40bcfa
|
15e9ad1d028d7f12cb598b075453173532a00d91 |
|
20-May-2015 |
Jeff Hao <jeffhao@google.com> |
Intercept JNI invocation of String.<init> methods. libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and initialize a string instead of using the recommended NewObject. This change adds an intercept to change the String.<init> call to a StringFactory call instead. Then, it uses the object id of the original string object referrer and maps it to the result of the StringFactory. Bug: 21288130 Change-Id: Ib4db402c178bc37188d5c5faf30b6e4fdc747b17
|
82566091466b5b3f529168681ecfe3e739ef08b5 |
|
19-May-2015 |
Andreas Gampe <agampe@google.com> |
ART: Fix RegisterNative order First check for both direct and virtual methods in the current class, then move to the parent. Optimize registration by checking first whether the current method under test is native. This slows down registering implementations in parent classes. Add a CheckJNI warning for this. Add a run-test to check the behavior. Fix host comparison testing. Bug: 19569721 (cherry picked from commit 3f1dc56914177993b1b018bf21ce7d39d7feecda) Change-Id: I61e77117d96310632aad123d7f1279d0f834dc99
|
3f1dc56914177993b1b018bf21ce7d39d7feecda |
|
19-May-2015 |
Andreas Gampe <agampe@google.com> |
ART: Fix RegisterNative order First check for both direct and virtual methods in the current class, then move to the parent. Optimize registration by checking first whether the current method under test is native. This slows down registering implementations in parent classes. Add a CheckJNI warning for this. Add a run-test to check the behavior. Fix host comparison testing. Bug: 19569721 Change-Id: I61e77117d96310632aad123d7f1279d0f834dc99
|
368010a82f796f9716c62f7af339ea51785768ae |
|
12-May-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Add notes about fast JNI calls. (cherry pick commit 36bce58f01a6b37e4d07ff9544c03a3238be087f) Bug: 19665903 Change-Id: I7cc37ab572d2e9ff86f6388c80a3c453a2bca046
|
36bce58f01a6b37e4d07ff9544c03a3238be087f |
|
12-May-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Add notes about fast JNI calls. Bug: 19665903 Change-Id: Ie0610aa17ab1365c08cb0b5b0931a8cefb65f252
|
a6ce5b2d5ade23087ab15f26d4c487570ad84b5e |
|
04-May-2015 |
Mathieu Chartier <mathieuc@google.com> |
Improve JNI registration failure logging Print INTERNAL_FATAL instead of ERROR, print the "Failed to register native method" message last. (cherry picked from commit 5c02d6cd0cc7e10d30d8c26166ebaaf6d313d771) Bug: 13885477 Change-Id: I9f1a7ea45bd926f3984b8008d84c75e676a1ed10
|
5c02d6cd0cc7e10d30d8c26166ebaaf6d313d771 |
|
04-May-2015 |
Mathieu Chartier <mathieuc@google.com> |
Improve JNI registration failure logging Print INTERNAL_FATAL instead of ERROR, print the "Failed to register native method" message last. Bug: 13885477 Change-Id: I9f1a7ea45bd926f3984b8008d84c75e676a1ed10
|
848f70a3d73833fc1bf3032a9ff6812e429661d9 |
|
15-Jan-2014 |
Jeff Hao <jeffhao@google.com> |
Replace String CharArray with internal uint16_t array. Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
|
2cebb24bfc3247d3e9be138a3350106737455918 |
|
22-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Replace NULL with nullptr Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
|
fc58af45e342ba9e18bbdf597f205a58ec731658 |
|
17-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add AbstractMethod, Constructor, Method Moves functionality to ART from libcore. Precursor to moving ArtMethods to native. Mostly performance improvements. N5 perf before (irrelevant results removed): Class_getConstructor 962.87 =========== Class_getDeclaredMethod 2394.37 ============================ Class_getMethod 2509.20 ============================== Class_newInstance 1999.81 ======================= Method_invokeI 1439.02 ================= Method_invokePreBoxedI 1415.82 ================ Method_invokeStaticI 1456.24 ================= Method_invokeStaticPreBoxedI 1427.32 ================= Method_invokeStaticV 814.47 ========= Method_invokeV 816.56 ========= After: benchmark ns linear runtime Class_getConstructor 1302.04 ================ Class_getDeclaredMethod 1459.01 ================== Class_getMethod 1560.40 =================== Class_newInstance 2029.94 ========================= Method_invokeI 1312.89 ================ Method_invokePreBoxedI 1255.01 =============== Method_invokeStaticI 1289.13 =============== Method_invokeStaticPreBoxedI 1196.52 ============== Method_invokeStaticV 790.82 ========= Method_invokeV 791.73 ========= Performance improvements are more than just fixing regressions introduced in: http://android-review.googlesource.com/#/c/146069/ Bug: 19264997 Change-Id: Ife79c469fdb09f30e3aefcfc3e0ce5ed32303fce
|
c785344b87221f5e4e6473e5b762e4e61fe65dcf |
|
27-Mar-2015 |
Mathieu Chartier <mathieuc@google.com> |
Move ArtField to native Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
|
02d2f290380c6aeff5f5a089ee38fa5d55e46130 |
|
03-Apr-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix the read barrier builds. A check failure (!UseJit() in ArtMethod::Invoke()) in forced interpret only mode in the eng build with JIT enabled by default on target. A build failure (inl header file issues) in the USE_BAKER_READ_BARRIER build. Change-Id: Ib13632b10864ad8b4691b66971c0ab5d2ae1e675
|
daaf3265806eb2eadb2e03302bd68022fab5ca28 |
|
24-Mar-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add AccessibleObject and Field to mirror Main motivation is to remove all the functionality / field access on java side to ArtField. Also comes with some reflection speedups / slowdowns. Summary results: getDeclaredField/getField are slower mostly due to JNI overhead. However, there is a large speedup in getInt, setInt, GetInstanceField, and GetStaticField. Before timings (N5 --compiler-filter=everything): benchmark ns linear runtime Class_getDeclaredField 782.86 === Class_getField 832.77 === Field_getInt 160.17 = Field_setInt 195.88 = GetInstanceField 3214.38 ============== GetStaticField 6809.49 ============================== After: Class_getDeclaredField 1068.15 ============ Class_getField 1180.00 ============== Field_getInt 121.85 = Field_setInt 139.98 = GetInstanceField 1986.15 ======================= GetStaticField 2523.63 ============================== Bug: 19264997 Change-Id: Ic0d0fc1b56b95cd6d60f8e76f19caeaa23045c77
|
4585f876eb5dfb936bd0d6cb6acd78a1f2182ba6 |
|
28-Mar-2015 |
Andreas Gampe <agampe@google.com> |
ART: Some runtime cleanup Use an enum for the compiler-callback mode. Refactor and remove some unnecessary includes in runtime.h. Change-Id: If2245fa470171311b8e05b677cf6bb28f209585a
|
81c6f8db12b203878a7d72444ead2bc7cf5c47ad |
|
26-Mar-2015 |
Andreas Gampe <agampe@google.com> |
ART: PathClassLoader for compiler Use an actual PathClassLoader when compiling apps, instead of a side structure and cutout. This CL sets up a minimal object 'cluster' that recreates the Java side of a regular ClassLoader such that the Class-Linker will recognize it and use the internal native fast-path. This CL removes the now unnecessary compile-time-classpath and replaces it with a single 'compiling-the-boot-image' flag in the compiler callbacks. Note: This functionality is *only* intended for the compiler, as the objects have not been completely initialized. Bug: 19781184 Change-Id: I7f36af12dd7852d21281110a25c119e8c0669c1d
|
0aa50ce2fb75bfc2e815a0c33adf9b049561923b |
|
10-Mar-2015 |
Nicolas Geoffray <ngeoffray@google.com> |
Remove ThrowLocation. Note that this is a cleanup change, and has no functionality change. The ThrowLocation had no use anymore. Change-Id: I3d2126af1dc673cec3a0453ff3d56a172663a5f6
|
14691c5e786e8c2c5734f687e4c96217340771be |
|
05-Mar-2015 |
Nicolas Geoffray <ngeoffray@google.com> |
Compute the right catch location for the debugger. Also remove tls ThrowLocation, it is not needed anymore. Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
|
7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0 |
|
26-Feb-2015 |
Nicolas Geoffray <ngeoffray@google.com> |
Change how we report exceptions to the debugger. This is only a refactoring/cleanup. Bug fixes with respect to catch location, and more cleanups will follow. Change-Id: I30d3c6260b0c8f8115a811621397225b88f2063a
|
12f7423a2bb4bfab76700d84eb6d4338d211983a |
|
14-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Print more info in MarkSweep::VerifyRoot Refactored old root callback to use a new class called RootInfo. RootInfo contains all the relevant info related to the root associated with the callback. The MarkSweep::VerifyRoot function now uses this info to print the StackVisitor's described location if the GC root is of the type kRootJavaFrame. Some other cleanup. Example output: E/art (12167): Tried to mark 0x123 not contained by any spaces E/art (12167): Attempting see if it's a bad root E/art (12167): Found invalid root: 0x123 with type RootJavaFrame E/art (12167): Location=Visiting method 'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0) vreg=0 Bug: 18588862 Change-Id: Ic5a2781f704e931265ffb3621c2eab4b2e25f60f
|
246a0130c5583170f4d168532feb49367fce2b47 |
|
20-Dec-2014 |
Andreas Gampe <agampe@google.com> |
ART: Do not JNI abort on nullptr GetObjectRefType A nullptr is a valid input, as it is different from a null reference. Bug: 18820997 (cherry picked from commit a87630724ef4f8760684fa69c8ecc685735aff88) Change-Id: Ibda8907ba13b20d2055049492a356ffdf4ddc714
|
a87630724ef4f8760684fa69c8ecc685735aff88 |
|
20-Dec-2014 |
Andreas Gampe <agampe@google.com> |
ART: Do not JNI abort on nullptr GetObjectRefType A nullptr is a valid input, as it is different from a null reference. Bug: 18820997 Change-Id: Ibda8907ba13b20d2055049492a356ffdf4ddc714
|
95c51b3c3765124adf367047caa56f16bfb6eb6f |
|
26-Nov-2014 |
Stephen Hines <srhines@google.com> |
Add a missing SHARED_LOCKS_REQUIRED(mutator_lock_). This was caught by Clang 3.6 using -Wthread-safety-analysis. Change-Id: If2f25331f111ba6c67570e5aece1fba38f714d05
|
41da59665556e8dd5601178185c68d48d645500b |
|
15-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix reference leaks in ToReflectedMethod and ToReflectedField Used ScopedLocalRef to fix, added regression tests. Bug: 18396311 (cherry picked from commit 8c41753e5eda8322b4d992fe88855058f4c0c2e1) Change-Id: I0ddfc20ac2384c90ff18586242c1f1d9a6d6eb6d
|
8c41753e5eda8322b4d992fe88855058f4c0c2e1 |
|
15-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix reference leaks in ToReflectedMethod and ToReflectedField Used ScopedLocalRef to fix, added regression tests. Bug: 18396311 Change-Id: I8ef447408f103c35389e76c14071a0f2e40de300
|
277ccbd200ea43590dfc06a93ae184a765327ad0 |
|
04-Nov-2014 |
Andreas Gampe <agampe@google.com> |
ART: More warnings Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
|
6a3c1fcb4ba42ad4d5d142c17a3712a6ddd3866f |
|
31-Oct-2014 |
Ian Rogers <irogers@google.com> |
Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags. Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
|
c7dd295a4e0cc1d15c0c96088e55a85389bade74 |
|
22-Oct-2014 |
Ian Rogers <irogers@google.com> |
Tidy up logging. Move gVerboseMethods to CompilerOptions. Now "--verbose-methods=" option to dex2oat rather than runtime argument "-verbose-methods:". Move ToStr and Dumpable out of logging.h, move LogMessageData into logging.cc except for a forward declaration. Remove ConstDumpable as Dump methods are all const (and make this so if not currently true). Make LogSeverity an enum and improve compile time assertions and type checking. Remove log_severity.h that's only used in logging.h. With system headers gone from logging.h, go add to .cc files missing system header includes. Also, make operator new in ValueObject private for compile time instantiation checking. Change-Id: I3228f614500ccc9b14b49c72b9821c8b0db3d641
|
677cd61ad05d993c4d3b22656675874f06d6aabc |
|
15-Oct-2014 |
Ian Rogers <irogers@google.com> |
Make ART compile with GCC -O0 again. Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on architecture. Add to instruction_set_test to warn when InstructionSetFeatures don't agree with ones from system properties, AT_HWCAP and /proc/cpuinfo. Clean-up class linker entry point logic to not return entry points but to test whether the passed code is the particular entrypoint. This works around image trampolines that replicate entrypoints. Bug: 17993736 (cherry picked from commit 6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3) Change-Id: I3e7595f437db4828072589d475a5453b7f31003e
|
6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3 |
|
15-Oct-2014 |
Ian Rogers <irogers@google.com> |
Make ART compile with GCC -O0 again. Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on architecture. Add to instruction_set_test to warn when InstructionSetFeatures don't agree with ones from system properties, AT_HWCAP and /proc/cpuinfo. Clean-up class linker entry point logic to not return entry points but to test whether the passed code is the particular entrypoint. This works around image trampolines that replicate entrypoints. Bug: 17993736 Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
|
d000480134b7b00895fbfd142f1d1e18d9cfa6e9 |
|
16-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add way to ensure we are at the front of the sigaction chain Calling this after jni_on_load fixes the unity apps. This is not exactly correct since we may already have the following chain. Start up: Us -> debuggerd After app goes in front: App -> us -> debuggerd After we put ourself back at the front: Us -> app -> us -> app -> .... stack overflow. Bug: 17620677 Change-Id: I9183997e3d5ebd51c320b5d51425be5142e938f3 (cherry picked from commit 1f24296c7c8a6501ee2388c0d20b48f471b48660)
|
1f24296c7c8a6501ee2388c0d20b48f471b48660 |
|
16-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add way to ensure we are at the front of the sigaction chain Calling this after jni_on_load fixes the unity apps. This is not exactly correct since we may already have the following chain. Start up: Us -> debuggerd After app goes in front: App -> us -> debuggerd After we put ourself back at the front: Us -> app -> us -> app -> .... stack overflow. Bug: 17620677 Change-Id: I9183997e3d5ebd51c320b5d51425be5142e938f3
|
24555ad5150e6ed31609a1f3c8c1a7e28a939301 |
|
06-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add way to warn about missing JNI_ABORT Bug: 16858794 Change-Id: I6794a14ee323ef95569cc7646619e6869771c7c6
|
6d031046eeb5e9f62b657df0695b752e1d0aa583 |
|
10-Sep-2014 |
jgu21 <jinghui.gu@intel.com> |
ART: Update for split native bridge initialization (cherry picked from commit a6da74e941d7cee498ac3880018a1d8dc953c6eb) (cherry picked from commit 7a536531791293441253cffb6e370ba1150eee96) Bug: 17671501 Change-Id: Id948e3ab22ac988d96f5d370bba8c3f86d08abff
|
7b078e8c04f3e1451dbdd18543c8b9692b5b067e |
|
10-Sep-2014 |
Ian Rogers <irogers@google.com> |
Compile time performance improvements focusing on interpret-only. Reduce virtual method dispatch in the method verifier and make more code inline-able. Add a StringPiece with const char* equality operator to avoid redundant StringPieces and strlens. Remove back link from register line to verifier and pass as argument to reduce size of RegisterLine. Remove instruction length from instruction flags and compute from the instruction, again to reduce size. Add suspend checks to resolve and verify to allow for more easy monitor inflation and reduce contention on Locks::thread_list_suspend_thread_lock_. Change ThrowEarlierClassFailure to throw pre-allocated exception. Avoid calls to Thread::Current() by passing self. Template specialize IsValidClassName. Make ANR reporting with SIGQUIT run using checkpoints rather than suspending all threads. This makes the stack/lock analysis less lock error prone. Extra Barrier assertions and condition variable time out is now returned as a boolean both from Barrier and ConditionVariable::Wait. 2 threaded host x86-64 interpret-only numbers from 341 samples: Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms After change: Avg 139.163% 99% CI 3.027ms to 838.257ms Reduction in average compile time after change is 20.9%. Slow-down without change is 26.5%. Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable could return unresolved type when class loading is disabled. Bug: 17398101 Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
|
2e158932354e5950eb59c79498ab46b0586885fd |
|
11-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Delete pin table The pin table was brought over from dalvik but not really needed since ART doesn't support pinning in movable spaces. The only thing it did was hold objects live for JNI functions. This shouldn't be necessary since people keep jni references to these objects or else they could never release the elements. Bug: 17456946 (cherry picked from commit a967c62e4e6675d3553445aa8e95a09e7a3381b0) Change-Id: Ibed0d029157ffb9e75ecd80d4d544d690986c090
|
a967c62e4e6675d3553445aa8e95a09e7a3381b0 |
|
11-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Delete pin table The pin table was brought over from dalvik but not really needed since ART doesn't support pinning in movable spaces. The only thing it did was hold objects live for JNI functions. This shouldn't be necessary since people keep jni references to these objects or else they could never release the elements. Bug: 17456946 Change-Id: Ibed0d029157ffb9e75ecd80d4d544d690986c090
|
c0542af3e2170143ba40d89136e284997e16bf64 |
|
04-Sep-2014 |
Ian Rogers <irogers@google.com> |
Remove abuse of mirror::Object* to reference special values. Remove kInvalidIndirectRefObject, kClearedJniWeakGlobal and ObjectRegistry::kInvalidObject. Handle error conditions by passing in or returning an error value. GetObjectRefType is simplified to be faster and not return invalid references that are not expected according to the spec. Adjust check JNI and jni_internal_test appropriately. Fix cases in the debugger/JDWP of out arguments being passed by reference. Bug: 17376993 Change-Id: I3ce8a28c01827e163f4dc288449959464da788b1
|
bad0267eaab9d6a522d05469ff90501deefdb88b |
|
25-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add native memory accounting through custom allocator. Added a custom allocator that lets you pass in a special tag which specifices where the allocation came from. This is used when dumping. The performance overhead is low since each allocation only does a atomic add/sub for each allocation/free. The measurements are dumped to traces.txt during SIGQUIT. Example output: I/art (27274): AllocatorTagHeap active=120 max=120 total=168 I/art (27274): AllocatorTagMonitorList active=1572 max=6240 total=11724 I/art (27274): AllocatorTagClassTable active=185208 max=185208 total=268608 I/art (27274): AllocatorTagInternTable active=430368 max=430368 total=436080 I/art (27274): AllocatorTagMaps active=5616 max=6168 total=34392 I/art (27274): AllocatorTagLOS active=1024 max=1536 total=2044 I/art (27274): AllocatorTagSafeMap active=0 max=51936 total=533688 I/art (27274): AllocatorTagLOSMaps active=144 max=1248 total=5760 I/art (27274): AllocatorTagReferenceTable active=10944 max=11840 total=19136 I/art (27274): AllocatorTagHeapBitmap active=32 max=40 total=56 I/art (27274): AllocatorTagHeapBitmapLOS active=8 max=8 total=8 I/art (27274): AllocatorTagVerifier active=0 max=18844 total=1073156 I/art (27274): AllocatorTagModUnionCardSet active=5300 max=5920 total=56020 I/art (27274): AllocatorTagModUnionReferenceArray active=24864 max=24864 total=24864 I/art (27274): AllocatorTagJNILibrarires active=320 max=320 total=320 I/art (27274): AllocatorTagOatFile active=1400 max=1400 total=5852 Change-Id: Ibb470ef2e9c9a24563bb46422d46a55799704d82 (cherry picked from commit 5369c40f75fdcb1be7a7c06db212ce965c83a164)
|
5369c40f75fdcb1be7a7c06db212ce965c83a164 |
|
25-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add native memory accounting through custom allocator. Added a custom allocator that lets you pass in a special tag which specifices where the allocation came from. This is used when dumping. The performance overhead is low since each allocation only does a atomic add/sub for each allocation/free. The measurements are dumped to traces.txt during SIGQUIT. Example output: I/art (27274): AllocatorTagHeap active=120 max=120 total=168 I/art (27274): AllocatorTagMonitorList active=1572 max=6240 total=11724 I/art (27274): AllocatorTagClassTable active=185208 max=185208 total=268608 I/art (27274): AllocatorTagInternTable active=430368 max=430368 total=436080 I/art (27274): AllocatorTagMaps active=5616 max=6168 total=34392 I/art (27274): AllocatorTagLOS active=1024 max=1536 total=2044 I/art (27274): AllocatorTagSafeMap active=0 max=51936 total=533688 I/art (27274): AllocatorTagLOSMaps active=144 max=1248 total=5760 I/art (27274): AllocatorTagReferenceTable active=10944 max=11840 total=19136 I/art (27274): AllocatorTagHeapBitmap active=32 max=40 total=56 I/art (27274): AllocatorTagHeapBitmapLOS active=8 max=8 total=8 I/art (27274): AllocatorTagVerifier active=0 max=18844 total=1073156 I/art (27274): AllocatorTagModUnionCardSet active=5300 max=5920 total=56020 I/art (27274): AllocatorTagModUnionReferenceArray active=24864 max=24864 total=24864 I/art (27274): AllocatorTagJNILibrarires active=320 max=320 total=320 I/art (27274): AllocatorTagOatFile active=1400 max=1400 total=5852 Bug: 16238192 Change-Id: Ibb470ef2e9c9a24563bb46422d46a55799704d82
|
93de4273d72a2558a7b3423547b5074cd76c5796 |
|
12-Aug-2014 |
Calin Juravle <calin@google.com> |
[ART] Move to system/core native bridge library Some cleanups on the way: - move NativeBridgeRuntimeCallbacks from a global to a field - rename native_bridge_library_string to the more suggestive navtive_bridge_library_path - clean up imports Bug: 16884833 (cherry picked from commit I73aab8e212860ba5aee9444d801806d3da326a41) Change-Id: I67f037ea81d2a4ede4294afd8b84b7640e534a13
|
c8423521c1d1136c70b153479b7df3bf4fd7fc2a |
|
12-Aug-2014 |
Calin Juravle <calin@google.com> |
[ART] Move to system/core native bridge library Some cleanups on the way: - move NativeBridgeRuntimeCallbacks from a global to a field - rename native_bridge_library_string to the more suggestive navtive_bridge_library_path - clean up imports Bug: 16884833 Change-Id: I73aab8e212860ba5aee9444d801806d3da326a41
|
20ae1d77463d1c3f206eac8d541124b4555464de |
|
17-Jul-2014 |
Ian Rogers <irogers@google.com> |
Clean up native bridge (partially cherry picked from commit 68d8b42ddec39ec0174162d90d4abaa004d1983e) Change-Id: I85813e97d73b1b331646dd0e880108dfbfe80f69
|
cb6b0f31ede2275e79e6199ec391147585a37a2a |
|
12-Aug-2014 |
Ian Rogers <irogers@google.com> |
Avoid use of std::string where we have const char*. Removing the ClassHelper caused std::string creation for all calls to Class::GetDescriptor and a significant performance regression. Make the std::string an out argument so the caller can maintain it and its life time while allowing GetDescriptor to return the common const char* case. Don't generate GC maps when compilation is disabled. Remove other uses of std::string that are occuring on critical paths. Use the cheaper SkipClass in CompileMethod in CompilerDriver. Specialize the utf8 as utf16 comparison code for the common shorter byte encoding. Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing code), add some LIKELYs. x86-64 host 1-thread interpret-only of 57 apks: Before: 29.539s After: 23.467s Regular compile: Before: 1m35.347s After: 1m20.056s Bug: 16853450 Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad Conflicts: runtime/utils.cc
|
1ff3c98775a4577cf053dba9a0c2d5c21c07b298 |
|
12-Aug-2014 |
Ian Rogers <irogers@google.com> |
Avoid use of std::string where we have const char*. Removing the ClassHelper caused std::string creation for all calls to Class::GetDescriptor and a significant performance regression. Make the std::string an out argument so the caller can maintain it and its life time while allowing GetDescriptor to return the common const char* case. Don't generate GC maps when compilation is disabled. Remove other uses of std::string that are occuring on critical paths. Use the cheaper SkipClass in CompileMethod in CompilerDriver. Specialize the utf8 as utf16 comparison code for the common shorter byte encoding. Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing code), add some LIKELYs. x86-64 host 1-thread interpret-only of 57 apks: Before: 29.539s After: 23.467s Regular compile: Before: 1m35.347s After: 1m20.056s Bug: 16853450 Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad
|
68d8b42ddec39ec0174162d90d4abaa004d1983e |
|
17-Jul-2014 |
Ian Rogers <irogers@google.com> |
Wire up check JNI force copy mode. Increase check JNI checks. Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h. Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case of VM routines. Make class loader override and shared library class loader JNI global references rather than mirror pointers. Clean-ups to native bridge. Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55
|
d4c3c62cc68296fbaf35e7b37108c2fde2278a3b |
|
11-Jul-2014 |
Narayan Kamath <narayan@google.com> |
Fix broken JNI IsAssignableFrom. The expected argument order was the opposite of what the spec dictated. Reported-By: Mikhail Naganov <mnaganov@google.com> bug: 16531674 (cherry picked from commit 1268b742c8cff7318dc0b5b283cbaeabfe0725ba) Change-Id: I2b6636998c4e15c1eb10dc96a57940aca56c4d0d
|
1268b742c8cff7318dc0b5b283cbaeabfe0725ba |
|
11-Jul-2014 |
Narayan Kamath <narayan@google.com> |
Fix broken JNI IsAssignableFrom. The expected argument order was the opposite of what the spec dictated. Reported-By: Mikhail Naganov <mnaganov@google.com> bug: 16531674 Change-Id: I1ebc6d5814ebb4feeb96f3ecdf1a4602da4ba7ce
|
94f7b49578b6aaa80de8ffed230648d601393905 |
|
23-Jul-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Add GcRoot to clean up and enforce read barriers. Introduce a value-type wrapper around Object* for GC roots so that 1) we won't have to directly add the read barrier code in many places and 2) we can avoid accidentally bypassing/missing read barriers on GC roots (the GcRoot interface ensures that the read barrier is executed on a read). The jdwp test passed. Bug: 12687968 Change-Id: Ib167c7c325b3c7e3900133578815f04d219972a1
|
355383f61d28f2dc8072fbde2639c80627adf16d |
|
24-Jul-2014 |
Yong WU <yong.wu@intel.com> |
Integrate ART with NativeBridge interfaces Native-bridge will provide the following interfaces to ART: struct NativeBridgeCallbacks { bool (*initialize )(NativeBridgeArtCallbacks* vm_itf); void* (*loadLibrary )(const char* libpath, int flag); void* (*getTrampoline)(void* handle, const char* name, const char* shorty, uint32_t len); bool (*isSupported )(const char* libpath); }; Native-bridge will expose a symbol NativeBridgeItf with the type of NativeBridgeCallbacks to ART. And ART will provide the interfaces below to native-bridge: struct NativeBridgeArtCallbacks { int (*logger )(int prio, const char* tag, const char* fmt, ...); const char* (*getMethodShorty)(JNIEnv* env, jmethodID mid); int (*getNativeMethodCount )(JNIEnv* env, jclass clazz); int (*getNativeMethods )(JNIEnv* env, jclass clazz, JNINativeMethod* methods, uint32_t method_count); }; Based on the interfaces, if an ART call to dlopen fails to open a native library, it queries the native bridge by using NativeBridgeCallbacks::isSupported(). If the native library is supported by native-bridge, ART can load the native library using NativeBridgeCallbacks::loadLibrary() and get a trampoline for a specific native method using NativeBridgeCallbacks::getTrampoline(). ART can then call the native method using the normal signature and the address of the trampoline. On the other side, in the case of a native method calling JNI native function CallXXXXMethodY(), native-bridge calls back to Art for the shorty of the method using NativeBridgeArtCallbacks::getMethodShorty() so that it can prepare based on host calling convention. In case of JNI function RegisterNatives()/UnregisterNatives(), native bridge can call back to NativeBridgeArtCallbacks::getNativeMethodCount() and NativeBridgeArtCallbacks ::getNativeMethods() to get all native methods of specified class so that all corresponding trampolines can be prepared/destroyed. Class NativeBridge is created to encapsulate the function pointers of NativeBridgeCallbacks and provides better abstraction to ART. Note: functionality is turned off in native_bridge.cc at the moment. Change-Id: I652755044957a7960254648652b538cce70dd011
|
22d5e735f403c57525fe868304c7123f0ce66399 |
|
16-Jul-2014 |
Ian Rogers <irogers@google.com> |
Remove object_utils.h. Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
|
e63db27db913f1a88e2095a1ee8239b2bb9124e8 |
|
16-Jul-2014 |
Ian Rogers <irogers@google.com> |
Break apart header files. Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
|
fa65e846362829d6e444bd88b12fe2496b3d5647 |
|
03-Jul-2014 |
Sebastien Hertz <shertz@google.com> |
More checks in JNI RegisterNatives Throws NoSuchMethodError (and returns JNI_ERR) when given method name, method signature or native function is null. Bug: https://code.google.com/p/android/issues/detail?id=72293 Bug: 15886341 Change-Id: I1c0582d54031eaa58a6025a2417d65090a2a622a
|
3a1444ccb92fb1b11d4943c3baa1f0a3abed4f10 |
|
25-Jun-2014 |
Alexei Zavjalov <alexei.zavjalov@intel.com> |
ART: JNI ExceptionDescribe crashes if no exception occurred Some tests are calling ExceptionDescribe without checking if we have an exception occurred. The most JVM's like Dalvik can handle this in a good way, but art crashes with JNI error. This adds a check in art::ExceptionDescribe for a case when it called without exception. Change-Id: Id9eddcc73e78b1197109be5a6340f9ff60940c74 Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
|
d3333767dc25566ad207c90c897adaefd813588d |
|
26-Jun-2014 |
Sebastien Hertz <shertz@google.com> |
Fix JNI ToReflectedMethod for constructor Returns java.lang.reflect.Constructor object for <init> and <clinit> methods. Bug: https://code.google.com/p/android/issues/detail?id=72312 Bug: 15885285 Change-Id: I2f4a266b2d9574659673dc6966104860578d709e
|
85a93364e5111dc56a73eed0130856e66cab0802 |
|
25-Jun-2014 |
Brian Carlstrom <bdc@google.com> |
Address comments on change 45d26c86b00580593067ca42091ad66cf7dc4f7c Change-Id: Ibb559ae41654660064f4a8df71274c4e4f16807a
|
45d26c86b00580593067ca42091ad66cf7dc4f7c |
|
25-Jun-2014 |
Brian Carlstrom <bdc@google.com> |
Treat larger than jint capacity in NewDirectByteBuffer as an error Bug: 15854028 Change-Id: If78921f4ba2b38a9d0bb421acf9c8bca962ed42a
|
ea2e1bd713ca8295ba4fcd01e77a3ce532ea61e4 |
|
18-Jun-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Add more read barriers for JNI roots. To make it possible to concurrently scan the JNI global roots (that is, the roots visited by JavaVMExt::VisitRoots()), add read barriers to the indirect reference table and the reference table. Also, add read barriers to the jmethodID/jfieldID decode routines (ScopedObjectAccessAlreadyRunnable::DecodeField/DecodeMethod) so that we can concurrently handle (encoded) fields and methods. Bug: 12687968 Change-Id: I3df4e4e622a572ff0ea8d44b2dc70a4d6b3ba058
|
6c5cb212fa7010ae7caf9dc765533aa967c95342 |
|
19-Jun-2014 |
Ian Rogers <irogers@google.com> |
Ensure classes are initialized rather than initializing. A class can be being initialized on a different thread, in that case other threads should block trying to access the class. The initializing state shows the class is being initialized but not that its safe for other threads to access. Change occurances of IsInitializing to IsInitialized primarily in slow-path code. Bug: 15347354 Change-Id: Ib586d0a385be6086a890dfbf8868d76f16767fac
|
004644fe87046b965442b1ee1008b7206817d187 |
|
18-Jun-2014 |
Brian Carlstrom <bdc@google.com> |
Fix GetMethodID to find an interface method from a super-interface Bug: 15651032 Change-Id: I5df113e9489a1615e901f03bed92ed2a1a42bd67
|
9f1020305292a21fd14a402b189c765a125226ab |
|
23-May-2014 |
Sebastien Hertz <shertz@google.com> |
Fix exception reporting from interpreter To comply with JDWP exception report rules, we must report an exception at the location of the throw (or the first instruction encountered after a native call). To do this, we use the CatchLocationFinder visitor to look for a catch handler until we reach a native frame or the top frame. Because interpreter handles pending exception on a method-by-method basis, we need a flag to remember we already reported the exception and avoid reporting it multiple times when unwinding methods. The drawback is we need to maintain the state of this flag. We clear it when the exception is cleared. In the case we temporarily clear the exception (when finding a catch handler for instance), we restore the flag to its previous value at the same time we restore the pending exception. Bump oat version to force recompilation because we modify Thread offsets. Bug: 14402770 Change-Id: Ic059c58f80b2023b118038301f8f0a24f1e18241
|
56890e2615ab3dd612f1f81c3cadab6299eceacb |
|
02-Jun-2014 |
Fred Shih <ffred@google.com> |
Modified functions to return pointers where appropriate GetStringChars will return a pointer to the underlying char array iff it is not movable. Otherwise, it will return a copy of the char array. For consistency, the null terminating character has been removed as the specification for a jchar strings are not null terminated: http://developer.android.com/training/articles/perf-jni.html GetStringCritical will now always return a pointer to the char array. The char array is pinned and moving gc is disabled until the pointer is released. Change-Id: I19c8cbaecc1f3f723d80acec074fb8c5e2d489c3
|
ffddfdf6fec0b9d98a692e27242eecb15af5ead2 |
|
03-Jun-2014 |
Tim Murray <timmurray@google.com> |
DO NOT MERGE Merge ART from AOSP to lmp-preview-dev. Change-Id: I0f578733a4b8756fd780d4a052ad69b746f687a9
|
a309d76d4c9f4e5564b09708004bf4b2e3401bb3 |
|
26-May-2014 |
Serguei Katkov <serguei.i.katkov@intel.com> |
Fix GC race condition in visit roots While GC visits roots other code can change the set pending exception due to lack of synchronization. Change-Id: If387944ac933a66fe176df066c3a0ea52131cad4 Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
|
b74cd29802f364b4cec88f4913fa38ade26b8fab |
|
29-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Compaction cleanup for FindArrayClass. We now pass double pointer in to signify that it can cause thread suspension, this double pointer gets wrapped by a handle if don't find the array class in the cache. Change-Id: I43436b6c35597c7252b65d1180baddb5ac4caabb
|
196851b634a5bfdd8ab3fb59a320e550b21b0f4d |
|
29-May-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Add read barriers for the weak roots in the JNI weak globals. Bug: 12687968 Change-Id: Ic265a0e162e8cc9edc4ab7fa34f8afd5ce968d08
|
0cd81352a7c06e381951cea1b104fd73516f4341 |
|
23-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Revert "Fix an outstanding compaction bug in interpreter."" Fixed the generic trampoline to not use ToJObject when unnecessary. Bug: 15167269 This reverts commit 3bdb873122964da7937eb070cbcf2ef638a8e459. Change-Id: I0525d0e0f3afb753c770e1572070a0fa22b02271
|
3bdb873122964da7937eb070cbcf2ef638a8e459 |
|
23-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Fix an outstanding compaction bug in interpreter." This reverts commit e09ae0920be57760fb390b6944bce420fa0b5582. Change-Id: I48036306130d5ccfec683d0dc3e9a642a02ee9c1
|
e09ae0920be57760fb390b6944bce420fa0b5582 |
|
15-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix an outstanding compaction bug in interpreter. Fixed a bug in DoFieldPut where the FieldHelper GetType could cause thread suspension which would result in a stale obj. Added more handles in the class linker to facilitate moving fiels and methods in the future. Removed un-necessarly passing handle references since these are value types and don't need to be passed by reference. Added a special NullHandle type which allows null handles without a handle scope. Change-Id: I1b51723920a2e4f4f8b2907066f578a3e879fd5b
|
35aef2ce9d9cbfb37e9b2f6776afce3caed37063 |
|
19-May-2014 |
Yevgeny Rouban <yevgeny.y.rouban@intel.com> |
Fix race condition between GCDaemon and DeleteLocalReference There is a race condition between the GCDaemon visiting thread local roots starting from the thread's indirect ref table (IRT) and another thread calling JNI::DeleteLocalReference, which is clearing one of the indirect references. To cope with the race condition the DeleteLocalReference used to transit from suspended to running state by creating a ScopedObjectReference(env). But this transition was removed with the following patch: https://android.googlesource.com/platform/art/+/ef28b14268ed0f9db0c7bbd571aa514354a360bd%5E!/#F0 If so the GCDaemon must be careful to work with IRT entries. This new patch: 1. calls the visitor only if the reference is not null. This if-null behavior of ART GC is consistent with what Dalvik GC does. 2. But this might be not enough for some future sophisticated GC algorithms. For example, if GC moves an object, then the IRT entry must be changed with CAS only if it has not been cleared. So, for the safety reasons the patch put backs the ScopedObjectReference soa(env) to DeleteLocalReference. Only one of those two changes would be enough. mathieuc note: I decided to delete the root null check but kept the ScopedObjectAccess in DeleteLocalRef and added missing annotations as well as more ScopedObjectAccess in jni internals. Bug: 14626564 Change-Id: I90d4b8494f61404579ecdd2918d1482093d99387 Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com> Signed-off-by: Yang Chang <yang.chang@intel.com>
|
700a402244a1a423da4f3ba8032459f4b65fa18f |
|
20-May-2014 |
Ian Rogers <irogers@google.com> |
Now we have a proper C++ library, use std::unique_ptr. Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
|
f832284dd847ff077577bb5712225430bbbb3b67 |
|
16-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Delete ClassHelper and fix compaction bug in GetDirectInterface Cleanup helps to prevent compaction bugs. Fixed a fairly serious compaction error caused by calling ClassHelper::GetDirectInterface without handling the case where it causes thread suspension due to ResolveType. Bug: 8981901 Change-Id: I82b3bb6dd48d21eb6ece7aae0733c4a23c2bc408
|
507dfdd147c97bfbadebfd63584d094b6a4e7b47 |
|
16-May-2014 |
Ian Rogers <irogers@google.com> |
Compatibility layer to transition from UniquePtr to std::unique_ptr. Use ART_WITH_STLPORT (enabled for the target) to cause the use of UniquePtr, for the host switch to std::unique_ptr. For now the type remains called UniquePtr. Make dalvik compile with clang on the host, move its build to C++11. Change-Id: I5ba8d2757904bc089ed62047ea03de3c0853fb12
|
2d10b206f9d0b97396b7dadb9a6415cd39efd341 |
|
13-May-2014 |
Ian Rogers <irogers@google.com> |
Ensure JNI primitive array type is appropriate. Check the primitive array type for GetPrimitiveArray, ReleasePrimitiveArray, GetPrimitiveArrayRegion and SetPrimitiveArrayRegion matches the given array type. Check the GetPrimitiveArrayCritical and ReleasePrimitiveArrayCritical are given a primitive array. Add unit tests that null parameters lead to fatal errors, not crashes. Fix issues where CheckJNI assumed non-null arguments. Tidy testing code via the use of nullptr. Add a few extra checks. Ensure arrays of void are not able to be created, use RI compatible NoClassDefError. Bug: 14817823 Change-Id: I9903bcd800d0da1988ced07f61fb97b783c5deab
|
eb8167a4f4d27fce0530f6724ab8032610cd146b |
|
08-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add Handle/HandleScope and delete SirtRef. Delete SirtRef and replaced it with Handle. Handles are value types which wrap around StackReference*. Renamed StackIndirectReferenceTable to HandleScope. Added a scoped handle wrapper which wraps around an Object** and restores it in its destructor. Renamed Handle::get -> Get. Bug: 8473721 Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
|
c56057e40938c587a74984651a510e320a8cb4fd |
|
04-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add lockless SynchronizedGet for indirect reference table. Used for decoding global references without holding locks. Results on JniCallback: Before: 615ms (3 samples). After: 585ms (3 samples). Change-Id: Ifcac8d0359cf658d87f695c6eb869d148af002e5
|
b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cf |
|
29-Apr-2014 |
Ian Rogers <irogers@google.com> |
Force inlining on trivial accessors. Make volatility for GetFieldObject a template parameter. Move some trivial mirror::String routines to a -inl.h. Bug: 14285442 Change-Id: Ie23b11d4f18cb15a62c3bbb42837a8aaf6b68f92
|
3b60fea8458f0bf65ef4530e1c4ee6fdd4b199e9 |
|
25-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Use __FUNCTION__ in CHECK_NON_NULL_*ARGUMENT. Prevents naming errors and reduces code maintenance requirements. Change-Id: I14aba05f0d5dab8009f472b3af0b698551ac2a7e
|
92b7889dfbfb44e875ba46c4e9ec3235c37b7709 |
|
25-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Clean up ScopedThreadStateChange + Get/SetPrimtiveArrayRegion Simplified code in ScopedThreadStateChange and fixed an incorrect name in Get/SetPrimitiveArrayRegion. Change-Id: Id71affec1d64911449d792911cd52104dd179840
|
35d5c3baf701ca3d1e2d5b0b3653a5ca16f21f7e |
|
23-Apr-2014 |
Colin Cross <ccross@android.com> |
art: fix dlopen error message detail is a std::string *, dereference it when logging the error message. Change-Id: If73a5806445df17d91ff1a7f4f3a6d31f0e9f54e
|
987560fee798e48fb725c44b796d8ca7a5872ad6 |
|
22-Apr-2014 |
Ian Rogers <irogers@google.com> |
Remove support for app JNI workarounds. Change-Id: I4396df7e93fcace4b5b19c2c387e5c30089182a6
|
dd7624d2b9e599d57762d12031b10b89defc9807 |
|
15-Mar-2014 |
Ian Rogers <irogers@google.com> |
Allow mixing of thread offsets between 32 and 64bit architectures. Begin a more full implementation x86-64 REX prefixes. Doesn't implement 64bit thread offset support for the JNI compiler. Change-Id: If9af2f08a1833c21ddb4b4077f9b03add1a05147
|
62f0512bf6d9bc6141358bf22e93afa70dc58b1a |
|
21-Mar-2014 |
Ian Rogers <irogers@google.com> |
Improvements to Field.get/set. Avoid unnecessary repeated computation in Field.get/set. Refactor FromReflectedField and FromReflectedMethod into common helpers in mirror::ArtField and mirror::ArtMethod, and make use of thereby avoiding transitions through JNI. Avoid JNI use from within FromReflectedField and FromReflectedMethod. Tidy up Field.get/set wrt moving collector support. Bug: 12189533 Change-Id: I643ab3474bade4abac3a3ae2b6e373b2bb0891c8
|
53b8b09fc80329539585dcf43657bc5f4ecefdff |
|
14-Mar-2014 |
Ian Rogers <irogers@google.com> |
Refactor reflective method invocation. Move invocation code out of JNI internal into reflection, including ArgArray code. Make reflective invocation use the ArgArray to build arguments rather than allocating a jvalue[] and unboxing arguments into that. Move reflection part of jni_internal_test into reflection_test. Make greater use of fast JNI. Change-Id: Ib381372df5f9a83679e30e7275de24fa0e6b1057
|
0c6afa40af7b9f097131126d084d5f19c2accaac |
|
19-Dec-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix NewLocalRef, NewGlobalRef to handle cleared weak globals. We were not checking for null after decoding the reference, this meant that we incorrectly created null weak global references instead of returning null. Issue: 63929 Bug: 13400455 (cherry-picked from e8c48db6bb507d7fa20c78481c58c23be0045f67) Change-Id: I9159682e6edad8f415ef8144fc13b9aedd2cceb4
|
5647d189c3ea5324e569d96cef67c87879d6cd05 |
|
08-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix tests to pass with VerifyObject. A SIRT ref with a null class was causing object verification problems in space_test. Change-Id: I95cfc3da5e0fec0155387f75612b0a3f26f6d3c9
|
c645f1ddb7c40bea6a38eda4b3f83f6b6dec405b |
|
07-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add more VerifyObject calls. Added verify object calls to SirtRef, IndirectReferenceTable, ReferenceTable. Removed un-needed verify object in ScopedObjectAccess / DecodeJObject since object sources are handled. Bug: 12934910 Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
|
719d1a33f6569864f529e5a3fff59e7bca97aad0 |
|
06-Mar-2014 |
Ian Rogers <irogers@google.com> |
Enable annotalysis on clang ART builds. Fix clang build errors aswell as restructure locking/mutex code for correct thread safety analysis support. Reorder make dependencies so that host builds build first as they should provide better compilation errors than target. Remove host's use of -fno-omit-frame-pointer as it has no value with correct use of CFI, which we should have. Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
|
491ca9e75fad381468dd7f5fdbff56d1a9738dd7 |
|
03-Mar-2014 |
Brian Carlstrom <bdc@google.com> |
Add ART -help and -showversion Bug: https://code.google.com/p/android/issues/detail?id=62149 Change-Id: I5c21c0433f5f341f94e7d977e8d2d69cc46d6fe3
|
a2806550cefb7c70781d8ee6279e6ad5769804cb |
|
27-Feb-2014 |
Brian Carlstrom <bdc@google.com> |
Remove some stray stringpiece.h includes Bug: 13186058 Change-Id: I2cb313425864a5d4e988fcf71a99c60ad63c63fb
|
a1ce1fef2d49d1d537776a5308ace7102a815fe5 |
|
25-Feb-2014 |
Brian Carlstrom <bdc@google.com> |
Split up CommonTest into CommonRuntimeTest and CommonCompilerTest Change-Id: I8dcf6b29a5aecd445f1a3ddb06386cf81dbc9c70
|
9837939678bb5dcba178e5fb00ed59b5d14c8d9b |
|
25-Feb-2014 |
Ian Rogers <irogers@google.com> |
Avoid std::string allocations for finding an array class. Introduce ClassLinker::FindArrayClass which performs an array class lookup given the element/component class. This has a 16 element cache of recently looked up arrays. Pass the current thread to ClassLinker Find .. Class routines to avoid calls to Thread::Current(). Avoid some uses of FindClass in the debugger where WellKnownClasses is a faster and more compacting GC friendly alternative. Change-Id: I60e231820b349543a7edb3ceb9cf1ce92db3c843
|
8151b8fe2987e01ed915ea2053ed42fac95ff3db |
|
11-Dec-2013 |
Jeff Hao <jeffhao@google.com> |
Fix FindFieldID to use class's classloader to find field type. Also includes a test case, though the test case does not recreate this exact issue because the attached native thread would need to have a null context classloader. Bug: 11737351 (cherry picked from 62509b662929175228bb0d0f014ef4ef4e33be10) Change-Id: I6f15aba990eaf84696c02c37d02e80f88aff59ed
|
936b37f3a7f224d990a36b2ec66782a4462180d6 |
|
14-Feb-2014 |
Ian Rogers <irogers@google.com> |
Upcall support for x86-64. Sufficient to pass jni_internal_test. Change-Id: Ia0d9b8241ab8450e04765b9c32eb6dc8fc1a8733
|
815873ecc312b1d231acce71e1a16f42cdaf09f2 |
|
14-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change root visitor to use Object**. Simplifies code and improves the performance of root visiting since we usually don't need to check to see if the object moved. Change-Id: Iba998f5a15ae1fa1b53ca5226dd2168a411196cf
|
d2fe10a3a34af171bf1631219cd2d6ff6b7778b5 |
|
15-Jan-2014 |
Sebastien Hertz <shertz@google.com> |
Remove blacklist Removes the class initialization blacklist and use transaction to detect and revert class initialization attempting to invoke native method. This only concerns class initialization happening at compilation time when generating an image (like boot.art for the system). In transactional mode, we log every object's field assignment and array update. Therefore we're able to abort a transaction to restore values of fields and array as they were before the transaction starts. We also log changes to the intern string table so we can restore its state prior to transaction start. Since transactional mode only happens at compilation time, we don't need to log all these changes at runtime. In order to reduce the overhead of testing if transactional mode is on/off, we templatize interfaces of mirror::Object and mirror::Array, respectively responsible for setting a field and setting an array element. For various reasons, we skip some specific fields from transaction: - Object's class and array's length must remain unchanged so garbage collector can compute object's size. - Immutable fields only set during class loading: list of fields, method, dex caches, vtables, ... as all classes have been loaded and verified before a transaction occurs. - Object's monitor for performance reason. Before generating the image, we browse the heap to collect objects that need to be written into it. Since the heap may still holds references to unreachable objects due to aborted transactions, we trigger one collection at the end of the class preinitialization phase. Since the transaction is held by the runtime and all compilation threads share the same runtime, we need to ensure only one compilation thread has exclusive access to the runtime. To workaround this issue, we force class initialization phase to run with only one thread. Note this is only done when generating image so application compilation is not impacted. This issue will be addressed in a separate CL. Bug: 9676614 Change-Id: I221910a9183a5ba6c2b99a277f5a5a68bc69b5f9
|
e7e8a5fea2d852cccc840fa046151a16627f26cd |
|
15-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Remove using mirror::* in jni internal. Cleans up the code since it helps make it easier to spot moving GC related bugs. Also fixed moving GC bugs in MonitorEnter, and FindFieldID. Change-Id: I794e4fbcc2010875fc6b299c6d4c9fb0f071b71a
|
8e611d32d8bb32681e94af896eb10d6ce6b8485b |
|
10-Feb-2014 |
Narayan Kamath <narayan@google.com> |
Fix function names in CHECK_NON_NULL_ARGUMENT. Fixes a copy paste error that leads to confusing JNI error logs. Change-Id: I27af4e1b206e84d28590c50e38d4f718af2405e9
|
0177e53ea521ad58b70c305700dab32f1ac773b7 |
|
12-Feb-2014 |
Ian Rogers <irogers@google.com> |
Work in the direction of hard float quick ABIs. Pass a shorty to ArtMethod::Invoke so that register setup can use it. Document x86-64 ABI. Add extra debug output for one JNI native method registration fails, namely a dump of the Class and its dex file's location. Add hack to get testing of OatMethod's without GC maps working in 64bit. Change-Id: Ic06b68e18eac33637df2caf5e7e775ff95ae70f3
|
d68ac700820f3e4253c8b4bcf718daf452f6da4c |
|
11-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add more checking to ReleasePrimitiveArray. When we ReleasePrimitiveArray, we now check that the elements pointer is not a heap address if it is not equal to the java array's data. Bug: 12845603 Change-Id: I458862f4dc586ba1c414647c7eb81b978c4ccb7e
|
83c8ee000d525017ead8753fce6bc1020249b96a |
|
28-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add root types and thread id to root visiting. Enables us to pass the root type and thread id to hprof. Bug: 12680863 Change-Id: I6a0f1f9e3aa8f9b4033d695818ae7ca3460d67cb
|
ef7d42fca18c16fbaf103822ad16f23246e2905d |
|
06-Jan-2014 |
Ian Rogers <irogers@google.com> |
Object model changes to support 64bit. Modify mirror objects so that references between them use an ObjectReference value type rather than an Object* so that functionality to compress larger references can be captured in the ObjectRefererence implementation. ObjectReferences are 32bit and all other aspects of object layout remain as they are currently. Expand fields in objects holding pointers so they can hold 64bit pointers. Its expected the size of these will come down by improving where we hold compiler meta-data. Stub out x86_64 architecture specific runtime implementation. Modify OutputStream so that reads and writes are of unsigned quantities. Make the use of portable or quick code more explicit. Templatize AtomicInteger to support more than just int32_t as a type. Add missing, and fix issues relating to, missing annotalysis information on the mutator lock. Refactor and share implementations for array copy between System and uses elsewhere in the runtime. Fix numerous 64bit build issues. Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
|
055d46c479369ea825712834353660b45215c195 |
|
06-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add missing SIRT to LoadNativeLibrary. When we transition to kWaitingForJniOnLoad, we are suspended and a GC can occur. This caused issues since classloaders are movable. Change-Id: Iae59019c22ac64322a82300107d06a4323ee602b
|
8f4be93c8260b84d706d91586aff572791edd9fe |
|
29-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Visit libraries roots in JavaVMExt::VisitRoots SharedLibrary holds a direct pointer to a class loader. Since class loaders can move we need to visit these as roots and update them during the GC. I believe this was causing UnsatisfiedLinkError with background compaction enabled. Bug: 8981901 Change-Id: I9e2a230c6dd3c25969abaf2121d8d473f6f8b601
|
1d27b34d3b18a5a0c832dae9768366dc08ef8d1c |
|
28-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change DisableGC to DisableMovingGC. Also removed the WaitForConcurrentGC in IncrementDisableMovingGC since we do not currently support any type of concurrent moving collectors. This fixes the performance regression introduced by waiting for the concurrent GC which manifested itself in framework perf benchmarks as a result of background compaction. Change-Id: I524f9ab52e1992419626a27649f232ca6967b03d
|
3e8b2e1f14176c6beb61a31a27af30bc35998e80 |
|
20-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix bugs in ReleasePrimitiveArray. JNI_COMMIT should not unpin the array or decrement the disable GC count. Change-Id: I8f6beef18c03cff93387a6967f32a8891348642c
|
1d99e4549309d05007d041d058b1878de88e9585 |
|
03-Jan-2014 |
Ian Rogers <irogers@google.com> |
Disallow JNI NewObjectArray of primitive types. Also, make jni_internal_test execute via the interpreter rather than compile methods. Add tests for passing negative array sizes to JNI routines new functions. Re-enable the tests NewStringNullCharsNonzeroLength and NewDirectBuffer_GetDirectBufferAddress_GetDirectBufferCapacity. Test and explicitly fail if the initial value argument to NewObjectArray isn't assignable to that type of array. Use unchecked ObjectArray::Set with NewObjectArray with an initial value. Change-Id: If3491cb5f974b42cf70c1b850819265f9963ee48
|
e8c48db6bb507d7fa20c78481c58c23be0045f67 |
|
19-Dec-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix NewLocalRef, NewGlobalRef to handle cleared weak globals. We were not checking for null after decoding the reference, this meant that we incorrectly created null weak global references instead of returning null. Issue: 63929 Change-Id: I9159682e6edad8f415ef8144fc13b9aedd2cceb4
|
62509b662929175228bb0d0f014ef4ef4e33be10 |
|
11-Dec-2013 |
Jeff Hao <jeffhao@google.com> |
Fix FindFieldID to use class's classloader to find field type. Also includes a test case, though the test case does not recreate this exact issue because the attached native thread would need to have a null context classloader. Bug: 11737351 Change-Id: Ieb7536702a556485d667361124cd7985b712b093
|
c528dba35b5faece51ca658fc008b688f8b690ad |
|
26-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Enable moving classes. Slight reduction in Zygote size, memory savings are in the noise. Before: Zygote size: 8739224 After: Zygote size: 8733568 Fixed a bug where we didn't set the concurrent start bytes after switching the allocator from bump pointer to ROSAlloc in the zygote. This caused excessive memory usage. Added the method verifiers as roots to fix an issue caused by RegTypes holding a Class*. Added logic to clear card table in the SemiSpace collector, this reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace collector. Added a missing lock to the timing loggers which caused a rare one time crash in std::set. Bug: 11771255 Bug: 8499494 Bug: 10802951 Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae
|
590fee9e8972f872301c2d16a575d579ee564bee |
|
13-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Compacting collector. The compacting collector is currently similar to semispace. It works by copying objects back and forth between two bump pointer spaces. There are types of objects which are "non-movable" due to current runtime limitations. These are Classes, Methods, and Fields. Bump pointer spaces are a new type of continuous alloc space which have no lock in the allocation code path. When you allocate from these it uses atomic operations to increase an index. Traversing the objects in the bump pointer space relies on Object::SizeOf matching the allocated size exactly. Runtime changes: JNI::GetArrayElements returns copies objects if you attempt to get the backing data of a movable array. For GetArrayElementsCritical, we return direct backing storage for any types of arrays, but temporarily disable the GC until the critical region is completed. Added a new runtime call called VisitObjects, this is used in place of the old pattern which was flushing the allocation stack and walking the bitmaps. Changed image writer to be compaction safe and use object monitor word for forwarding addresses. Added a bunch of added SIRTs to ClassLinker, MethodLinker, etc.. TODO: Enable switching allocators, compacting on background, etc.. Bug: 8981901 Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
|
1eb512d33f94d1dd7ea38263307ba0f7a0dfa653 |
|
19-Oct-2013 |
Ian Rogers <irogers@google.com> |
Fast JNI support. Use a modifier to signal a native method is a fast JNI method. If the modifier is set then don't perform runnable transitions. Change-Id: I7835b4d837bfdd1cb8e2d54b919c0d5e6cf90499
|
ce88853ab316c70ef7b598978a3609611db60552 |
|
10-Oct-2013 |
Brian Carlstrom <bdc@google.com> |
Have JNI FindClass fall back to system ClassLoader Bug: 10994325 Change-Id: Id0a46e78eecfe8a9eb91008765c4fff48697cc58
|
d9c4fc94fa618617f94e1de9af5f034549100753 |
|
02-Oct-2013 |
Ian Rogers <irogers@google.com> |
Inflate contended lock word by suspending owner. Bug 6961405. Don't inflate monitors for Notify and NotifyAll. Tidy lock word, handle recursive lock case alongside unlocked case and move assembly out of line (except for ARM quick). Also handle null in out-of-line assembly as the test is quick and the enter/exit code is already a safepoint. To gain ownership of a monitor on behalf of another thread, monitor contenders must not hold the monitor_lock_, so they wait on a condition variable. Reduce size of per mutex contention log. Be consistent in calling thin lock thread ids just thread ids. Fix potential thread death races caused by the use of FindThreadByThreadId, make it invariant that returned threads are either self or suspended now. Code size reduction on ARM boot.oat 0.2%. Old nexus 7 speedup 0.25%, new nexus 7 speedup 1.4%, nexus 10 speedup 2.24%, nexus 4 speedup 2.09% on DeltaBlue. Change-Id: Id52558b914f160d9c8578fdd7fc8199a9598576a
|
d91d6d6a80748f277fd938a412211e5af28913b1 |
|
26-Sep-2013 |
Ian Rogers <irogers@google.com> |
Introduce Signature type to avoid string comparisons. Method resolution currently creates strings to then compare with strings formed from methods in other dex files. The temporary strings are purely created for the sake of comparisons. This change creates a new Signature type that represents a method signature but not as a string. This type supports comparisons and so can be used when searching for methods in resolution. With this change malloc is no longer the hottest method during dex2oat (now its memset) and allocations during verification have been reduced. The verifier is commonly what is populating the dex cache for methods and fields not declared in the dex file itself. Change-Id: I5ef0542823fbcae868aaa4a2457e8da7df0e9dae
|
c11d9b8870de5f860b13c84003ade7b3f3125a52 |
|
19-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Re-enable concurrent system weak sweeping. Enabled by disallowing new system weaks during the pause and re-allowing it after the system weaks have been swept. Reduces GC pause by ~1ms. Fixes pause regression caused by fix for Bug: 10626133 Change-Id: If49d33e7ef19cb728ed3cef5187acfa53b9b05d8
|
6aa3df965395566ed6a4fec4af37c2b7577992e9 |
|
18-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Refactor system weak sweeping, add support for modification. Required for moving collectors. Change-Id: Ib97ba4a05af1139f8d388077a15e62bcb9534855
|
423d2a3dcbb260b020efb5da59f784c9f02accbf |
|
13-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add support for changing roots through the root visitor callback. Needed for copying collectors. Change-Id: Icc4a342a57e0cfb79587edb02ef8c85e08808877
|
3b7ffa1f4c466f4bf8032c328a47aea83a23868c |
|
07-Sep-2013 |
Elliott Hughes <enh@google.com> |
Support apps that pass JNI_VERSION_1_1 to GetEnv. Bug: 10649815 Change-Id: I73b9bef20f7f8fa96cdcb5afdab9592c35ea0f3e
|
8fcaca53648e72bfc08b2316d42d844dfd2cef41 |
|
22-Aug-2013 |
Ian Rogers <irogers@google.com> |
Allow NULL JNI arguments for length 0 memcpys. Bug 10393546. (cherry picked from commit 4ffdc6bd962c37bca407267c0858b37bb18a9857) Change-Id: I02058019be16c07da06cb88654556aac1d7964a8
|
4ffdc6bd962c37bca407267c0858b37bb18a9857 |
|
22-Aug-2013 |
Ian Rogers <irogers@google.com> |
Allow NULL JNI arguments for length 0 memcpys. Bug 10393546. Change-Id: Ifaba4481e5b356c3e85a32525e6007e35036fcd1
|
b8a0b94735f188bc739e4c55479c37699006b881 |
|
21-Aug-2013 |
Ian Rogers <irogers@google.com> |
Switch JNI globals lock to reader-writer. Also, verifier rejected classes lock. These locks show as contended during dex2oat, however, they're commonly only read access is required. Change-Id: If8bb834cc69cd8c26494c87fb7f7b20d4e41cdfd
|
aa836f7fa2ef359cf8ec1ef98d924f7971ba8352 |
|
21-Aug-2013 |
Elliott Hughes <enh@google.com> |
Fix PushLocalFrame(0). Bug: 10395422 Change-Id: Iafef3e496127bfd65db87419ba374a1e5745f148
|
abd7be989a7509d6dd7325d505fa9926ed502355 |
|
15-Aug-2013 |
Ian Rogers <irogers@google.com> |
Prevent segvs in JNI. A segv in JNI code (without CheckJNI) is hard to debug as we fail to see stacks, pending exceptions.. Make JNI code robust to null arguments, but don't go to the lengths that CheckJNI does in also sanity checking arguments, the priority here is just to stop the VM from crashing. Bug 10305723 Also, allow an unknown throw location not to crash exception dumping. Found/useful for debugging bug 10331039. (cherry picked from commit bc939663ccfbe0c648dd6a3670041510aca82420) Change-Id: Id0203db7d9e320d45ae5ba25d2b63939c79e5c16
|
02e25119b15a6f619f17db99f5d05124a5807ff3 |
|
15-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix up TODO: c++0x, update cpplint. Needed to update cpplint to handle const auto. Fixed a few cpplint errors that were being missed before. Replaced most of the TODO c++0x with ranged based loops. Loops which do not have a descriptive container name have a concrete type instead of auto. Change-Id: Id7cc0f27030f56057c544e94277300b3f298c9c5
|
bc939663ccfbe0c648dd6a3670041510aca82420 |
|
15-Aug-2013 |
Ian Rogers <irogers@google.com> |
Prevent segvs in JNI. A segv in JNI code (without CheckJNI) is hard to debug as we fail to see stacks, pending exceptions.. Make JNI code robust to null arguments, but don't go to the lengths that CheckJNI does in also sanity checking arguments, the priority here is just to stop the VM from crashing. Bug 10305723 Also, allow an unknown throw location not to crash exception dumping. Found/useful for debugging bug 10331039. Change-Id: Ib1e5540df87e2d9ce7570802d624baae7797611f
|
ea46f950e7a51585db293cd7f047de190a482414 |
|
30-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Refactor java.lang.reflect implementation Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1. Move to ArtMethod/Field instead of AbstractMethod/Field and have java.lang.reflect APIs delegate to ArtMethod/ArtField. Bug: 10014286. Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
|
672a4230348c88cfce3a6dd37593a9257cb5516d |
|
03-Aug-2013 |
Elliott Hughes <enh@google.com> |
Not all shared libraries have a JNI_OnLoad. Change-Id: I7b3b6a48ed5631db6659461072ed4aa735bfd033 (cherry picked from commit 85affca81271f573c75c32316aa6faa8e52448b1)
|
a4afbb8c46952567713df3534fa451d9bd08956e |
|
03-Aug-2013 |
Elliott Hughes <enh@google.com> |
Handle JNI_ERR results from JNI_OnLoad functions specially. Change-Id: I3042f87493361d8eddab8aeebb92c6252e999425 (cherry picked from commit 7935372ab784477db452d11112cd60d26be87093)
|
85affca81271f573c75c32316aa6faa8e52448b1 |
|
03-Aug-2013 |
Elliott Hughes <enh@google.com> |
Not all shared libraries have a JNI_OnLoad. Change-Id: I7b3b6a48ed5631db6659461072ed4aa735bfd033
|
7935372ab784477db452d11112cd60d26be87093 |
|
03-Aug-2013 |
Elliott Hughes <enh@google.com> |
Handle JNI_ERR results from JNI_OnLoad functions specially. Change-Id: I3042f87493361d8eddab8aeebb92c6252e999425
|
9dcd45c60c691524bd8ef7d6f65075d9ee3e5554 |
|
29-Jul-2013 |
Elliott Hughes <enh@google.com> |
Fix NewLocalRef to use AddLocalReference. Bug: 10026664 Change-Id: I06f8f75a92f73b3b58fa767c0d08d1b736f7d5b5
|
7934ac288acfb2552bb0b06ec1f61e5820d924a4 |
|
26-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fix cpplint whitespace/comments issues Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
|
3e3d591f781b771de89f3b989830da2b6ac6fac8 |
|
18-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fix cpplint build/namespaces issues Change-Id: I19c68703270c1482d6c6aad8cdf97d3d2924360a
|
7940e44f4517de5e2634a7e07d58d0fb26160513 |
|
12-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Create separate Android.mk for main build targets The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81
|