summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
Commit message (Collapse)AuthorAgeFilesLines
* ART: Change the stack dump format to be in line with debuggerdAndreas Gampe2015-07-231-0/+2
| | | | | | | | | | Make offsets 16 digits on 64-bit platforms. Add the ability to provide the build fingerprint, and print it in the traces output. Bug: 22693991 Change-Id: Ibd3d3b3bd65dce84acfb97a487807d6f280a9508
* Add implicit null pointer and stack overflow checks for Mips.Douglas Leung2015-07-031-0/+2
| | | | | | | (cherry picked from commit 22bb5a2ebc1e2724179faf4660b2735dcb185f21) Bug: 21555893 Change-Id: I2a995be128a5603d08753c14956dd8c8240ac63c
* New experimental GC stress modeMathieu Chartier2015-06-221-1/+5
| | | | | | | | | | | | | | | Tries to do a GC for every unique call stack (up to 16 frames). The goal is to catch moving GC bugs and lock violations without being rediculously slow. Some tests fail on 64 bits, 32 bit host doesn't work. N5 is booting. Added runtime -Xgc options: gcstress and nogcstress. Bug: 21664466 (cherry picked from commit 310008008c90fea246efd00cb99ee7ded97c5209) Change-Id: Icb8e420f2048e8ee83bcca7937563166a2638f5c
* Reset GC performance stats at zygote fork.Hiroshi Yamauchi2015-06-101-0/+4
| | | | | | | So GCs before a zygote fork won't be attributed to an app. Bug: 21491908 Change-Id: Ib37bc587e0f039ef8faeabe63dec19de49501863
* Add atrace calls to runtime start and heap createRichard Uhler2015-06-041-0/+19
| | | | | | Bug: 20727525 Change-Id: I91a74b793fb9eda8ed580244a6a5fd313ef2eb27
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-021-67/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix debuggable compiler flag detection for secondary dex filesSebastien Hertz2015-05-191-4/+0
| | | | | | | | | | | | | | | | | | Compiles secondary dex files like the primary dex file: if it has been compiled with the --debuggable flag, compile secondary dex files with the --debuggable flag too. Therefore, dex files loaded at runtime are compiled the same way as dex files compiled at install time on the classpath (excluding the boot image that is not compiled debuggable). Also adds debuggable key in the oat header and bump the oat version. Bug: 20944228 (cherry picked from commit 0de1133ba600f299b3d67938f650720d9f859eb2) Change-Id: If6b2236e7fe547cc421f57b573043748018d3ae0
* Fix missing transaction abort error messageSebastien Hertz2015-04-291-2/+3
| | | | Change-Id: I5157def06d385c082f9fdd4714e20bead9e707e8
* Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-271-0/+4
| | | | | | | | | | | | 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
* Replace NULL with nullptrMathieu Chartier2015-04-221-21/+21
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Add AbstractMethod, Constructor, MethodMathieu Chartier2015-04-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ART: Streaming trace modeAndreas Gampe2015-04-151-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a streaming mode for tracing. Streaming uses a buffer of 16KB and writes to the output when that buffer gets full. Streaming mode can be enabled with -Xmethod-trace-stream and is currently not exposed otherwise. Add a python script that can parse the streaming format, which simply contains strings for newly encountered threads and methods inline, and create output that can be used with traceview. Add Trace::Pause and Trace::Abort, which can pause and abort tracing. Abort is different from Stop in that it does not write the data. Add code to the zygote hooks JNI implementation that pauses tracing before the fork, making sure that a child cannot clobber the parent's data. Add code to the zygote hooks JNI implementation that aborts old tracing and starts new tracing in the child after the fork. Currently base the output on the pid. This will not work on an unmodified device, as the profiles directory is not generally writable, but we do not have enough information at that point. Consider a scheme that restarts tracing later. Change-Id: I93c7bf87e35af582bdfdd3ecc7c52454514220dd
* ART: Clean up includes.Vladimir Marko2015-04-131-1/+1
| | | | | | | Reduce dependencies to improve incremental build times. Break up circular dependency involving class_linker-inl.h. Change-Id: I4be742c5c2b5cd9855beea86630fd68aab76b0db
* Move ArtField to nativeMathieu Chartier2015-04-101-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Refactor and improve GC root handlingMathieu Chartier2015-04-061-48/+48
| | | | | | | | | | | | | | | | | | | | | | Changed GcRoot to use compressed references. Changed root visiting to use virtual functions instead of function pointers. Changed root visting interface to be an array of roots instead of a single root at a time. Added buffered root marking helper to avoid dispatch overhead. Root marking seems a bit faster on EvaluateAndApplyChanges due to batch marking. Pause times unaffected. Mips64 is untested but might work, maybe. Before: MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us After: MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us Bug: 19264997 Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
* Merge "Fix the read barrier builds."Hiroshi Yamauchi2015-04-031-0/+4
|\
| * Fix the read barrier builds.Hiroshi Yamauchi2015-04-031-0/+4
| | | | | | | | | | | | | | | | | | | | 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
* | Merge "Use specific exception class to abort transaction"Sebastien Hertz2015-04-031-5/+4
|\ \
| * | Use specific exception class to abort transactionSebastien Hertz2015-04-031-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to throw a java.lang.InternalError when aborting a transaction (when preinitializing image classes at compilation time). We now use dedicated class dalvik.system.TransactionAbortError that is only thrown by the compiler to abort a transaction. This class has constructors taking a java.lang.Throwable "cause" so we can wrap exceptions causing the transaction to abort (for instance class java.lang.ClassNotFoundException) and give more information about the cause of the transaction abort. Bug: 20019689 Change-Id: I019a72a1c754d8bba6a7ad6bb0f02e4fd6668622
* | | ART: Move trace options to a structAndreas Gampe2015-04-021-10/+19
|/ / | | | | | | | | | | | | Bundles the different options and moves them to a struct in the implementation file. Will allow for easier change for streaming. Change-Id: I486e0942614e714964eb233e2d6b4e3e12aa704f
* | Visit image roots for hprofMathieu Chartier2015-03-311-1/+18
|/ | | | | | | | Bug: 19995360 (cherry picked from commit 0cab5e68f14ee403380664146db6dc7ddfc32064) Change-Id: I17868bff2a701dc25291d41b9732c6b86f92be08
* Merge "ART: Use enums in Trace"Andreas Gampe2015-03-301-2/+2
|\
| * ART: Use enums in TraceAndreas Gampe2015-03-291-2/+2
| | | | | | | | | | | | | | Move away from booleans. Will make introduction of streaming mode a bit easier / obvious. Change-Id: Id7ae92f6b97f627e848510d473931537d7db0db8
* | Add AccessibleObject and Field to mirrorMathieu Chartier2015-03-291-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ART: Some runtime cleanupAndreas Gampe2015-03-271-0/+10
| | | | | | | | Use an enum for the compiler-callback mode. Refactor and remove some unnecessary includes in runtime.h. Change-Id: If2245fa470171311b8e05b677cf6bb28f209585a
* ART: PathClassLoader for compilerAndreas Gampe2015-03-271-22/+4
| | | | | | | | | | | | | | | | | | | | 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
* Merge "Support relative encoded dex locations in oat files."Richard Uhler2015-03-251-1/+1
|\
| * Support relative encoded dex locations in oat files.Richard Uhler2015-03-241-1/+1
| | | | | | | | | | | | | | | | | | Now when opening an oat file, the caller can pass an absolute dex location used to resolve the absolute path for any relative encoded dex locations in the oat file. Bug: 19550105 Change-Id: I6e9559afe4d86ac12cf0b90176b5ea696a83d0e7
* | Add paths to apk!lib/<abi> to LD_LIBRARY_PATHDmitriy Ivanov2015-03-231-0/+2
| | | | | | | | | | | | | | | | Add paths to .apk to LD_LIBRARY_PATH to enable bionic linker's "open from zip-file" feature. Bug: 8076853 Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
* | Fix JIT options with late initMathieu Chartier2015-03-181-15/+13
| | | | | | | | | | | | | | | | | | Previously we couldn't create the JIT since we didn't have any JITOptions. Bug: 19735273 Change-Id: I24b8ed131ed8b18f75ec94291e135d8a1c089ebd
* | Change method verifiers to be thread local rootsMathieu Chartier2015-03-131-26/+0
| | | | | | | | | | | | Bug: 10921004 Change-Id: I3a1425d76cd380587ba67ef6d5ec1227564e55bf
* | ART: Add entries_ lock for race conditionbowen_lai2015-03-131-4/+3
|/ | | | | | | | | | GCDaemon thread would visit incorrect RegType content when there is another thread initializing classes. Add a lock to protect entries_. https://code.google.com/p/android/issues/detail?id=159849 Change-Id: Iabaa1c7f5cc5106b60a6e3856152e0797e8a5d6d
* Add way to select arena type at runtimeMathieu Chartier2015-03-121-1/+5
| | | | | | | We now use MemMap for JIT, and malloc for everything else. This should help fix the allegedly regressed compile times. Change-Id: I6a6552738933f9d7ee3bd23f45e310818b19b70d
* Remove ThrowLocation.Nicolas Geoffray2015-03-101-2/+2
| | | | | | | Note that this is a cleanup change, and has no functionality change. The ThrowLocation had no use anymore. Change-Id: I3d2126af1dc673cec3a0453ff3d56a172663a5f6
* Trim arenas for JITMathieu Chartier2015-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Moved arena pool into the runtime. Added arena trimming to arena pool. When called, this madvises the used memory. Changed the JIT compiler to trim arenas after compilation. Changed the arena mmap name to dalvik-LinearAlloc. Native PSS before: 80353 kB: Native 80775 kB: Native 78116 kB: Native After: 73357 kB: Native 70181 kB: Native 70306 kB: Native Bug: 17950037 Bug: 17643507 Bug: 19264997 Change-Id: I63e7a898fd6e909c2c677fa57b5917a7b1398930
* Merge "Compute the right catch location for the debugger."Nicolas Geoffray2015-03-091-7/+4
|\
| * Compute the right catch location for the debugger.Nicolas Geoffray2015-03-091-7/+4
| | | | | | | | | | | | Also remove tls ThrowLocation, it is not needed anymore. Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
* | Fix some incorrect IsCompiler instead of IsAotCompilerMathieu Chartier2015-03-051-8/+8
| | | | | | | | | | | | | | Fixes jdwp related issues (DDMS) when JIT is enabled. Bug: 19623297 Change-Id: I36139c70a97b529135febcf01b227e7ab9affacc
* | ART: Add debuggable compiler flagAndreas Gampe2015-03-041-0/+4
|/ | | | | | Add a flag to compiler options that shows debuggability. Change-Id: Id17ec72babe2ee88713a0d274eff86508de30666
* Merge "Follow-up 128393"Sebastien Hertz2015-03-031-3/+5
|\
| * Follow-up 128393Sebastien Hertz2015-03-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Avoids false warning when initializing the exception's class by marking the transaction aborted after throwing the InternalError exception. Also uses VLOG(compiler) to print the warning since it's only useful when investigating ahead-of-time class initialization. Bug: 19202032 Change-Id: I3c53639cbb888086ad345d668d1e5b73c5aaf861
* | Fix AddCurrentRuntimeFeaturesAsDex2OatArguments jit handlingMathieu Chartier2015-03-021-1/+1
|/ | | | | | | Now jit passes interpret filter to dex2oat. Bug: 19550422 Change-Id: I932c7d1084acbb9d356ad0f5534a270e2ca2d6ec
* Revert "Revert "Add JIT""Mathieu Chartier2015-02-241-23/+78
| | | | | | | | Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
* Merge "Revert "Add JIT""Nicolas Geoffray2015-02-241-78/+23
|\
| * Revert "Add JIT"Nicolas Geoffray2015-02-241-78/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
* | Merge "Add JIT"Mathieu Chartier2015-02-241-23/+78
|\ \ | |/
| * Add JITMathieu Chartier2015-02-231-23/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
* | Merge "Only detach shutdown thread if we attached it"Mathieu Chartier2015-02-241-3/+6
|\ \
| * | Only detach shutdown thread if we attached itMathieu Chartier2015-02-231-3/+6
| |/ | | | | | | | | | | | | | | Speculative fix to: "Request to unregister unattached thread" bug. Bug: 18713034 Change-Id: I6e69088dd66970c704010397a11e3758cf107ff9
* | ART: Allow the execution to stop if the compilation fails via an optionJean Christophe Beyler2015-02-231-1/+10
|/ | | | | | | | | | | | | | | | | | | | | The current implementation continues the execution of the application if dex2oat fails by relying on the interpreter. This patch adds a -Xno-dex-file-fallback option to stop the default behavior. This can be used two-fold. First, one can enforce that a runtime only starts with a boot image. A follow-up patch will ensure that dex2oat (for apps) and patchoat in general request that mode and close gracefully otherwise. Second, this can be used for testing and debugging purposes, as it ensures that compiler failures & aborts are not silently ignored. Add testing. Bug: 19100590 Change-Id: Iaf07b5ccf00942ca8a8ec8687599320a3ddbc089 Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>