aboutsummaryrefslogtreecommitdiff
path: root/vm/Init.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix "dalvikvm -help".Elliott Hughes2013-12-181-3/+5
| | | | | | | | Showing the help because we were asked to isn't an error. Showing the help because the command line made no sense is. Bug: https://code.google.com/p/android/issues/detail?id=60009 Change-Id: I2d5097e7bcf47db833ea2e0e0f3b8164f6309272
* dalvik: dalvik device extension pack.Xin Qi2013-10-311-0/+8
| | | | | | | | | Add support for customer device extension Change-Id: I0402a630ba212d1c5e81cda110f61210f7b60384 (cherry picked from commit 11499df326462bfe25890a35c6abbf019ff7784e) (cherry picked from commit e03b8f8da9cf4eef64cedf39ce9ca90d26ce5124) (cherry picked from commit fb360be406f35b9591f12c61936657f03cc5880f)
* Allow traversal into /storage paths.Jeff Sharkey2013-09-171-1/+1
| | | | | | | | | Apps are no longer required to have sdcard_r or sdcard_rw to access some parts of external storage. Relax the mount parameters to allow everyone to traverse. Bug: 10577808 Change-Id: I620c8f02f08b149437dfa5705e05a27b6994d2db
* libdvm should block SIGPIPE like the RI does.Elliott Hughes2013-08-211-1/+1
| | | | | | | | | Normally AndroidRuntime.cpp patches over this lapse, but that means that tests run by vogar or any other kind of "bare" VM doesn't handle SIGPIPE correctly. I'll remove the workaround from AndroidRuntime.cpp. Bug: 10211309 Change-Id: I51380486867af011d58ddbefbdef8d120f736ad9
* am 58de514b: Merge "Fix Class.getDex."Elliott Hughes2013-07-311-0/+14
|\ | | | | | | | | * commit '58de514b160674a483bcb912d367072c7354cc1e': Fix Class.getDex.
| * Fix Class.getDex.Elliott Hughes2013-07-311-0/+14
| | | | | | | | | | | | | | | | Dalvik doesn't check its own .so when looking for JNI methods, so manually register Class.getDex. Also fix a bug in that native method's implementation. Change-Id: Ic87484fac888e9eea0e5d51a2d2447eee860ece5
* | Suppress warning if JIT disabledbuzbee2013-07-211-0/+3
| | | | | | | | | | | | | | | | Setting gDvmJit.code_cache_size=0 disables the JIT, but also causes a warning. This change disables the JIT earlier in the startup process, avoiding the warning. Change-Id: Id6acd32dc0067218d503add90119008c953c4ea5
* | Add low memory mode option.Mathieu Chartier2013-07-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a low memory mode option which can be enabled by passing the flag "-XX:LowMemoryMode" to the VM. Changed dvmHeapSourceAlloc to use mspace_malloc and madvise page aligned regions of allocations back to the kernel if low memory mode is enabled. No measurable performance penalty on a benchmark which does 4 million object allocations. This seems to reduce the Dalvik total PSS by 10 - 15% on devices with large bitmaps (such as manta or flo). Another change is that cards are madvised instead of memset when cleared if low memory mode is enabled. This saves a minor amount of memory at the cost of having slightly more page faults. Change-Id: I0c850bc370ebabf4393bff1c47d3257b2f1518d2
* | am f8696fa7: am 2115c7ed: am f8fe8731: Merge "Disable -Xjnigreflimit."Elliott Hughes2013-07-021-9/+1
|\| | | | | | | | | * commit 'f8696fa79b0bb1ecc9eea0229eb989f25feaa1c0': Disable -Xjnigreflimit.
| * am f8fe8731: Merge "Disable -Xjnigreflimit."Elliott Hughes2013-07-021-9/+1
| |\ | | | | | | | | | | | | * commit 'f8fe8731a5302105b285d549e4a0265a35db3e2e': Disable -Xjnigreflimit.
| | * Disable -Xjnigreflimit.Elliott Hughes2013-07-021-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was supposed to help find bugs, but in practice (unlike the locale reference limit and the pinned array limit) doesn't. What it does do is cause well-behaved code to fail if its allocation rate is high. This has caused trouble for both audio and graphics code running on eng builds. Bug: 7903975 Change-Id: If475cb51c9cab13270a83a60d6d0aecfab758e88
* | | am 70605c75: am a163f4a9: Merge "Now that abort(3) is fixed, dvmAbort can be ↵Elliott Hughes2013-06-111-11/+0
|\| | | | | | | | | | | | | | | | | | | | simplified." * commit '70605c75b9418a3ef0450ba37bcf29a0c61609b4': Now that abort(3) is fixed, dvmAbort can be simplified.
| * | am a163f4a9: Merge "Now that abort(3) is fixed, dvmAbort can be simplified."Elliott Hughes2013-06-111-11/+0
| |\| | | | | | | | | | | | | * commit 'a163f4a944cc040aaf25f92ae9c28c1e9cf981f8': Now that abort(3) is fixed, dvmAbort can be simplified.
| | * Now that abort(3) is fixed, dvmAbort can be simplified.Elliott Hughes2013-06-111-11/+0
| | | | | | | | | | | | | | | | | | | | | The fix to abort(3) has SHA 7e6ce1a3c52d8533fed92c143419fedb0c93988a. (https://android-review.googlesource.com/#/c/60341/) Change-Id: I89e7ed174cbd08ad9046a98e2fdd73af8ae3ee5c
* | | JIT tuning; set cache size on command linebuzbee2013-05-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tuning knobs for triggering trace compilation for the JIT had not been revisited for several years. In that time, the working set of some applications have significantly increased, leading to frequent cache overlows & flushes. This CL adds the ability to set the maximum size of the JIT's cache on the command line, and we expect to use different settings depending on device configuration (rule of thumb: 1K for each 1M for system RAM, with 2M limit). Additionally, the trace compilation trigger has been tightened to limit the compilation of cold traces. Change-Id: Ice22c5d9d46a93e465c57dd83f50ca3912f1672e
* | | am de33df54: am 130eebad: Merge "Adapt dalvik to new libnativehelper"Brian Carlstrom2013-05-101-0/+4
|\| | | | | | | | | | | | | | * commit 'de33df540b44d21678081c975ef74d4e8a8a7581': Adapt dalvik to new libnativehelper
| * | am 130eebad: Merge "Adapt dalvik to new libnativehelper"Brian Carlstrom2013-05-101-0/+4
| |\| | | | | | | | | | | | | * commit '130eebad44c24874fb940884bfd8d9cde58dc367': Adapt dalvik to new libnativehelper
| | * Adapt dalvik to new libnativehelperBrian Carlstrom2013-05-091-0/+4
| | | | | | | | | | | | Change-Id: Id4707ea30c77d3760f1224fd9063c8c3f87c1ea7
* | | Don't emit a warning message on missing PR_SET_NO_NEW_PRIVSNick Kralevich2013-05-071-7/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | If the kernel doesn't support PR_SET_NO_NEW_PRIVS, then don't print a warning message. The warning message only serves to confuse other people. This change assumes that, if EINVAL is returned, the kernel is an old kernel. Newer kernels have no option to disable PR_SET_NO_NEW_PRIVS, so IMHO, this is a fair assumption. Change-Id: I77b4769e1d93a9b2412ba5365227283761940fdc
* | Zygote: set PR_SET_NO_NEW_PRIVSNick Kralevich2013-03-041-0/+17
| | | | | | | | | | | | | | call prctl(PR_SET_NO_NEW_PRIVS, 1) to prevent Zygote and zygote spawned applications from aquiring new privileges. Change-Id: I69bbf6bb5b01b877de414ecad43d3dffbd5fcea0
* | Zygote: remount /system nosuid/nodevNick Kralevich2013-02-281-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | Android no longer has any setuid / setgid programs accessible to zygote. Make sure /system is remounted nosuid and nodev for zygote spawned processes. We use mount namespaces to make sure these changes are only visible to zygote spawned processes. We continue to need /system mounted with suid to support /system/bin/run-as. See also: b/8253345 Change-Id: Ib58a8d56b42e4b022b6b4e51932f0a415298c920
* | Revert "Zygote: remount /system nosuid/nodev"Nick Kralevich2013-02-271-47/+0
| | | | | | | | | | | | | | | | This is causing problems when people do development. Any "adb shell stop && adb shell start" will have the side effect of remounting /system read-only, breaking a subsequent "adb sync". This reverts commit 2d37f9a1eb7f5375e8cad9ccb59d96d650d18f6e.
* | Zygote: remount /system nosuid/nodevNick Kralevich2013-02-251-0/+47
|/ | | | | | | | | | | | | Android no longer has any setuid / setgid programs accessible to zygote. Make sure /system is remounted nosuid and nodev for zygote spawned processes. We use mount namespaces to make sure these changes are only visible to zygote spawned processes. We continue to need /system mounted with suid to support /system/bin/run-as. See also: b/8253345 Change-Id: I959512520461f22d1fd88c12a2785a362639f7ed
* am 0138866d: Merge "Don\'t disable inlining for ARM."Elliott Hughes2012-10-091-1/+0
|\ | | | | | | | | * commit '0138866d22a58269602a45adf30d69ec55910b43': Don't disable inlining for ARM.
| * Don't disable inlining for ARM.Elliott Hughes2012-10-091-1/+0
| | | | | | | | | | | | | | | | | | I think there was confusion here between method inlining and the method compiler. Just because the latter isn't yet functional doesn't mean we don't want the former for those targets that support it. Bug: 7179010 Change-Id: If0de856b93615f01dfc5e8977d5c97f550cec15f
* | Allow max free size of heap to be configured.Ian Rogers2012-09-241-0/+39
| | | | | | | | | | | | | | | | | | This allows the max free to be larger on devices with more memory and thereby avoid GCs (that may be more frequent due to larger bitmaps). b/6606849 Change-Id: I4063a303ea4be3c1f227259d699fb238a806451f
* | Missing EMULATED_STORAGE_TARGET isn't an error.Jeff Sharkey2012-09-111-8/+6
| | | | | | | | | | | | | | Devices without emulated storage should just skip the tmpfs. Bug: 7131382 Change-Id: I9c697e4faf7864ec3a2695cd3770fbf0c9a5cce3
* | Include user identifier in external storage paths.Jeff Sharkey2012-09-071-0/+31
|/ | | | | | | | | | | | | | | | | | | | | | | | | When building external storage paths, always include user in path to enable cross-user paths and aid debugging. Each Zygote process continues to only have access to the appropriate user-specific emulated storage through bind mounts. A second set of mounts continue supporting legacy /sdcard-style paths. For example, a process running as owner has these mount points: /storage/emulated_legacy /storage/emulated_legacy/Android/obb /storage/emulated/0 /storage/emulated/obb This change also creates two nested namespaces around zygote. The first namespace is created when the zygote starts, and it holds a single writable tmpfs, since rootfs is ro. The second namespace is created quickly after forking, and is used to hold the private user-specific bind mounts. (This design saves us from creating a tmpfs-per-process.) Bug: 7131382 Change-Id: Id80403ec956f0bff6997411cb1f82f273c76b85f
* [X86] X86 trace JIT compiler supportDong-Yuan Chen2012-07-201-17/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides a fully functional x86 trace JIT compiler for Dalvik VM. It is built on top of the existing x86 fast interpreter with bug fixes and needed extension to support trace JIT interface. The x86 trace JIT code generator was developed independent of the existing template-based code generator and thus does not share exactly the same infrastructure. Included in this patch are: * Deprecated and removed the x86-atom fast interpreter that is no longer functional since ICS. * Augmented x86 fast interpreter to provide interfaces for x86 trace JIT compiler. * Added x86 trace JIT code generator with full JDWP debugging support. * Method JIT and self-verification mode are not supported. The x86 code generator uses the x86 instruction encoder/decoder library from the Apache Harmony project. Additional wrapper extension and bug fixes were added to support the x86 trace JIT code generator. The x86 instruction encoder/decoder is embedded inside the x86 code generator under the libenc subdirectory. Change-Id: I241113681963a16c13a3562390813cbaaa6eedf0 Signed-off-by: Dong-Yuan Chen <dong-yuan.chen@intel.com> Signed-off-by: Yixin Shou <yixin.shou@intel.com> Signed-off-by: Johnnie Birch <johnnie.l.birch.jr@intel.com> Signed-off-by: Udayan <udayan.banerji@intel.com> Signed-off-by: Sushma Kyasaralli Thimmappa <sushma.kyasaralli.thimmappa@intel.com> Signed-off-by: Bijoy Jose <bijoy.a.jose@intel.com> Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com> Signed-off-by: Tim Hartley <timothy.d.hartley@intel.com>
* am 2b02fef4: Lose libnativehelper to its own project for the PDK.Elliott Hughes2012-05-041-10/+17
|\ | | | | | | | | * commit '2b02fef409ebf91d3a9e6a624ab4f60ef540dbc9': Lose libnativehelper to its own project for the PDK.
| * Lose libnativehelper to its own project for the PDK.Elliott Hughes2012-05-031-10/+17
| | | | | | | | | | Bug: 6369821 Change-Id: Iae06cf1570a14ddefad6b31eec904d9fa598d89f
* | resolved conflicts for merge of 323d9152 to jb-dev-plus-aospElliott Hughes2012-05-021-0/+3
|\ \ | |/ |/| | | Change-Id: Ie94542150dad725ca09ad2824cddd034cd6a149b
| * Simplify the quasi-atomic stuff and add MIPS support.Elliott Hughes2012-05-011-0/+3
| | | | | | | | Change-Id: Iac896c03ef707c998cc714628adea0255f21c035
* | Add a -XX:mainThreadStackSize= option.Elliott Hughes2012-04-121-0/+19
| | | | | | | | | | | | | | Similar to -Xss, but for the main thread only. Bug: 6315322 Change-Id: I84bd5974f830f348fd9a0486ae972520b4a02cc4
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-16/+16
| | | | | | | | | | | | | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Also fix an occurrence of LOGW missed in an earlier change. Bug: 5449033 Change-Id: I2e3b23839e6dcd09015d6402280e9300c75e3406
* | Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-6/+6
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: Ia5d301248024df26c2a29dabdfe738e39ec87c82
* | Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-051-3/+3
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ic558031c75b3702d90eb78bd730501ae5d3c077b
* | Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-5/+5
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: Ic663376d1ad6a6cb14bf81405ad9afd247cf2f60
* | Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-10/+10
|/ | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I8bd96961e369a08e86ff78b82d90f20f42787eb1
* Leave up to 512 chars of gDvm.lastMessage on dvmAbort's stack frame.Ben Cheng2011-10-101-1/+38
| | | | | Bug: 5372634 Change-Id: I019a059e5a989de3dfc9e2f5e78f7caa7168cf75
* Stop advertising the removed -Xdeadlockpredict option.Elliott Hughes2011-07-171-1/+0
| | | | | Bug: 5038293 Change-Id: Ibb4ee3f68a1e3abababc09a51424c5d1c7b1ea0c
* Merge "Make dual clock mode the default."Jeff Brown2011-06-281-1/+1
|\
| * Make dual clock mode the default.Jeff Brown2011-06-271-1/+1
| | | | | | | | Change-Id: Ic2f7cb8a8055319472d16be03c7ca242bf915af0
* | Improve -verbose:jni.Elliott Hughes2011-06-281-65/+103
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old output just told you what functions were being called and made no attempt to show you their arguments. The new output was sufficient to debug an actual problem with an app we don't have the source to. Still to do: 0. an easier way for third-party developers to enable this. 1. the primitive type arguments to SetIntField and so forth. 2. return values. A few examples of the new output... A decoded jclass: JNI: libcore.io.Posix.readBytes called IsInstanceOf((JNIEnv*)0x9618470, 0x28100015, java.lang.Class<byte[]>) A decoded jfieldID: JNI: libcore.io.Posix.ioctlInt called GetIntField((JNIEnv*)0x9618470, 0x5cb00011, java.io.FileDescriptor.descriptor) A decoded jmethodID (the FileDescriptor constructor): JNI: libcore.io.Posix.open called NewObject((JNIEnv*)0x9780480, java.lang.Class<java.io.FileDescriptor>, java.io.FileDescriptor.<init>()V, ...) A const char*: JNI: libcore.io.Posix.getsockoptLinger called NewStringUTF((JNIEnv*)0x9618470, "getsockopt") A jint release mode: JNI: libcore.io.Posix.writeBytes called ReleaseByteArrayElements((JNIEnv*)0x9780480, 0x2700009, (void*) 0xf5f623c4, JNI_ABORT) The -verbose:jni option now turns on a bit more output about JNI_OnLoad calls but no longer causes any logging of calls to JNIEnv or JavaVM functions. The old -Xjnitrace: option has been extended to enable this new tracing for the native methods that it covers. They go very well together for debugging purposes. I've also made us a bit more verbose if we fail to initialize. In the longer term I think we want to just abort if we hit any failure during startup, but my extra logging will save us a bit of time next time we have one of these failures (this one was caused for me by only having one half of the finalizer watchdog change; I was missing the libcore side). (Cherry pick of 6734b8224fb869c94e42e704ec03f2ce8483af2b from dalvik-dev.) Change-Id: I69b7620b20620e9f06576da244520d9d83f89ab8
* Add a dual clock profiler tracing mode.Jeff Brown2011-06-271-1/+10
| | | | | | | | | | | | | | | | | | | Dalvik previously supported using either the thread-cpu clock or the real time clock as the timebase for profiler traces. This change adds a dual clock mode where both thread-cpu time and real time timestamps are collected. Using dual clock mode significantly improves TraceView ability to accurately reconstruct the global timeline of events, particularly on SMP systems. For now, thread-cpu mode remains the default. Dual clock mode can be enabled by running the following command and restarting the system server. adb shell setprop dalvik.vm.extra-opts -Xprofile:dualclock Change-Id: I8c0d91a99aa6829dadea328e54dc1225d9827391
* Fix regular exit.Elliott Hughes2011-06-071-8/+11
| | | | Change-Id: I653658f3b6e533a235f1108d0b625b9bdff7630c
* Use std::string rather than malloc/free for saneDirName.Elliott Hughes2011-06-071-10/+1
| | | | | | Also use std::vector instead of the cutils/array cruft. Change-Id: I273147335cafbac5d336955f53b0b29d015f0589
* Further conservation of newlines.Dan Bornstein2011-05-261-36/+36
| | | | | | Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
* Fix a couple debugging issues involving JIT single-stepping mode.Ben Cheng2011-05-101-5/+4
| | | | | | | | 1) Declare the jitop mask array using a defined length. 2) Fix a spurious divergence when the first instruction in the trace is single-stepped. Change-Id: Ic7925acbda70ddd5591a4bb51d42a74d027674e5
* Eliminate the PROFILE_FIELD_ACCESS feature.Carl Shapiro2011-04-271-3/+0
| | | | Change-Id: I27bf2d18c4c0735913ea8698825b05e393b046b2