summaryrefslogtreecommitdiffstats
path: root/vm/interp
Commit message (Collapse)AuthorAgeFilesLines
* Dalvik is dead, long live Dalvik!Brian Carlstrom2014-08-059-5859/+0
| | | | | | | | | | | | | | | | | | | | | | | croot cd dalvik repo start dalvik-is-dead-long-live-dalvik . repo sync -c . git rm -r README.txt git rm -r dexopt git rm -r tools/deadcode.py git rm -r tools/dex-preopt git rm -r tools/dexcheck git rm -r tools/gdbjithelper git rm -r unit-tests git rm -r vm git checkout HEAD vm/Common.h (needed by libdex) git checkout HEAD vm/DalvikVersion.h (needed by libdex) git checkout HEAD vm/Profile.h (needed by dmtracedump) git add Android.mk (after removing vm, dexopt, and unit-tests references) git commit -a -m 'Dalvik is dead, long live Dalvik!' Bug: 14298175 Change-Id: I9dd13053677629d13496d4238af4374452cda415
* Merge commit 'b75a263239ff48c87b826f5d62a53c0efd22b507' into HEADThe Android Open Source Project2013-11-221-1/+1
|\ | | | | | | Change-Id: Ia37a6c18e09e6bbfab4beadc5ed86f92b766fe21
| * Change IsMethodTracingActive to GetMethodTracingMode.Jeff Hao2013-08-301-2/+3
| | | | | | | | | | | | | | | | | | | | This allows traceview to tell whether tracing is active, and whether it is sampling or method tracing. Bug: 9968521 Change-Id: I72100d1536ea3168998110ec1cfa5a183b55a67c (cherry picked from commit 9d3a0a2e253aecd07c4a053c19cf9b0ccaa2db49)
| * Add support for sample profiling in traceview.Jeff Hao2013-08-282-1/+6
| | | | | | | | | | | | | | | | | | | | Instead of method instrumentation, allow traceview to periodically sample stack traces of threads. Disabled by default until we add gui support for this new mode. (cherry picked from commit 676f8a527fb62abd39663d55c7d9208f5ca03093) Change-Id: Ia5d0d57012305a5830d042bcb903a429432b035b
| * JIT tuning; set cache size on command linebuzbee2013-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix JIT initialization racebuzbee2013-05-011-0/+3
| | | | | | | | | | | | | | | | | | | | See b/8767735 Slow thread in thread spin test A race exists in thread creation/JIT initialization that can leave the JIT permanantly disabled for a thread (typically the first interpreter thread). Change-Id: If6fcac93a229edf068eb02ceceb374e3dc284b78
* | Use defines for current process creation.Christopher Ferris2013-11-051-1/+1
| | | | | | | | Change-Id: I54b7a614e14d5ae1c69b9caf6e88610d45df026a
* | Switch dalvik to libbacktrace.Christopher Ferris2013-10-301-17/+9
| | | | | | | | | | Bug: 8410085 Change-Id: Ib846422a660d56451feb2a167ea83c9d8f96e8e1
* | Change IsMethodTracingActive to GetMethodTracingMode.Jeff Hao2013-08-301-2/+3
| | | | | | | | | | | | | | | | | | This allows traceview to tell whether tracing is active, and whether it is sampling or method tracing. (cherry picked from commit 9d3a0a2e253aecd07c4a053c19cf9b0ccaa2db49) Change-Id: I7e00f90f80de248f07dfa94d7d0f028931e1a716
* | Add support for sample profiling in traceview.Jeff Hao2013-08-272-1/+6
| | | | | | | | | | | | | | | | | | | | Instead of method instrumentation, allow traceview to periodically sample stack traces of threads. Disabled by default until we add gui support for this new mode. (cherry picked from commit 676f8a527fb62abd39663d55c7d9208f5ca03093) Change-Id: Id8942d4186fc628ee7bd8d809d7239dec310054b
* | Fix JIT initialization racebuzbee2013-05-011-0/+3
|/ | | | | | | | | | | | See b/8767735 Slow thread in thread spin test A race exists in thread creation/JIT initialization that can leave the JIT permanantly disabled for a thread (typically the first interpreter thread). (cherry-pick of 67985d960f5c877f86d0bba251d2d55c7a062b8d.) Change-Id: Ic7e3a1cde2833ac78455fa5d465156b5e0896fc1
* Print the locker thread when waiting on an objectPal Szasz2012-12-061-0/+3
| | | | | | | | | | | | | When dumping stacktraces, and if one thread is blocked due to a call to Object.wait, the dump will just tell us the object pointer it is waiting on, but not the thread which actually locked the object. This patch tries to extract that informatation as well. Note that this information is not always available, since maybe no other thread aquired the lock yet. Change-Id: Id0ae23e17c58fc3712251f00b0a741191b5a5aee
* remove duplicated call to dvmJitCalleeSave()Rocky Zhang2012-11-291-1/+0
| | | | | Change-Id: Ib7b5f637a22fd5ba60bdb45cd34ac8c1781c7bd3 Signed-off-by: Rocky Zhang <zhangyan.hit@gmail.com>
* Handle MAX_INT case in packed-switchChris Dearman2012-10-151-11/+9
| | | | | | | Allows regression 095-switch-MAX_INT to pass Change-Id: Iec97fb456d43dbb14ee096fe708c74aff5ba1f5a Signed-off-by: Chris Dearman <chris@mips.com>
* Log when the native trace is unavailableAndy McFadden2012-09-201-0/+2
| | | | | | | | | | | | This should allow us to differentiate between "couldn't get the stack" and "didn't try to get the stack". Also show the thread's state (e.g. 'R' for running, 'D' for uninterruptible syscall). Bug 7053953 (cherry-pick of b3667a19f5c573b7785876979af4781292d27327.) Change-Id: I0a40cb3d3cdd9aef8589a39586cccd9c229aa8cb
* RETURN_VOID_BARRIER is also a return.Elliott Hughes2012-08-061-2/+2
| | | | | Bug: http://code.google.com/p/android/issues/detail?id=36003 Change-Id: I7fb53b0898158a3ad7b0eb4f8385674ddaeffd60
* [X86] X86 trace JIT compiler supportDong-Yuan Chen2012-07-204-20/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix a small and unlikely memory leak.Elliott Hughes2012-07-171-1/+1
| | | | Change-Id: I131b9f2f8ae4a4b2bb3bb00bc2cd1e607d979bb5
* resolved conflicts for merge of 4c5f9711 to jb-dev-plus-aospElliott Hughes2012-04-301-0/+8
|\ | | | | | | Change-Id: I4c724c3df990a5abf42cec748bbbba25ee5bc112
| * Fix the portable interpreter buildChris Dearman2012-02-151-0/+8
| | | | | | | | | | Change-Id: Ibf08d50c7a01a4c30559dd2ee9511c28fb1365a5 Signed-off-by: Chris Dearman <chris@mips.com>
* | Remove stale assertbuzbee2012-01-181-1/+0
| | | | | | | | | | | | | | Delete a stale assert that can cause problems when running with the portable interpreter when debugging or profiling. Change-Id: I354a1fbe280e1baeb885cb51fed1f3e2c8eef159
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-083-20/+20
| | | | | | | | | | | | | | | | | | 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-062-13/+13
| | | | | | | | | | | | | | 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-053-7/+7
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ic558031c75b3702d90eb78bd730501ae5d3c077b
* | Remove unsupported experimental opcodes.Elliott Hughes2012-01-051-2/+1
| | | | | | | | | | | | | | External developers were starting to try to get themselves into trouble with this stuff... Change-Id: I2b03bfeaa8c98b6a994bc7924fc8dcf4e4d4f6cb
* | Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-033-74/+74
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: Ic663376d1ad6a6cb14bf81405ad9afd247cf2f60
* | Use libcorkscrew to format the stack trace.Jeff Brown2011-11-211-10/+4
| | | | | | | | Change-Id: I06ddbb7a8035971b6e1a164adcd00208fae89b1a
* | am 50e01501: Merge "Knock ::self() out of the ParseXml profile." into ics-mr1Elliott Hughes2011-11-051-4/+2
|\| | | | | | | | | * commit '50e015017f091118f0147d02d23140ff9f88daec': Knock ::self() out of the ParseXml profile.
| * Knock ::self() out of the ParseXml profile.Elliott Hughes2011-11-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New profile (>=0.6, which is where the original seems to have cut off): 47 11.0070 dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) 30 7.0258 dvmChangeStatus(Thread*, ThreadStatus) 29 6.7916 addLocalReference(Thread*, Object*) 26 6.0890 dexDecodeDebugInfo(DexFile const*, DexCode const*, char const*, unsigned int, unsigned int, int (*)(void*, unsigned int, unsigned int), void (*)(void*, unsigned short, unsigned int, unsigned int, char const*, char const*, char const*), void*) 22 5.1522 dalvik_inst 15 3.5129 lockMonitor(Thread*, Monitor*) 14 3.2787 dvmLineNumFromPC 13 3.0445 javaLangString_equals(unsigned int, unsigned int, unsigned int, unsigned int, JValue*) 13 3.0445 scanObject(Object const*, GcMarkContext*) 12 2.8103 ScopedJniThreadState::ScopedJniThreadState(_JNIEnv*) 12 2.8103 common_invokeMethodNoRange 12 2.8103 dvmDecodeIndirectRef(Thread*, _jobject*) 9 2.1077 IndirectRefTable::add(unsigned int, Object*) 9 2.1077 ReleasePrimitiveArrayCritical(_JNIEnv*, _jarray*, void*, int) 9 2.1077 markObjectNonNull(Object const*, GcMarkContext*, bool) 9 2.1077 unpinPrimitiveArray(ArrayObject*) 8 1.8735 getCodeAddrCommon(unsigned short const*, bool) 7 1.6393 dexStringByTypeIdx(DexFile const*, unsigned int) 7 1.6393 dvmHeapSourceAlloc(unsigned int) 6 1.4052 GetPrimitiveArrayCritical(_JNIEnv*, _jarray*, unsigned char*) 6 1.4052 dvmPlatformInvoke 6 1.4052 pinPrimitiveArray(ArrayObject*) 6 1.4052 readUnsignedLeb128(unsigned char const**) 6 1.4052 scanFields(Object const*, GcMarkContext*) 5 1.1710 IndirectRefTable::get(void*) const 5 1.1710 dvmFindInReferenceTable(ReferenceTable const*, Object**, Object*) 4 0.9368 common_returnFromMethod 4 0.9368 dvmAddToReferenceTable(ReferenceTable*, Object*) 4 0.9368 dvmHeapBitmapScanWalk(HeapBitmap*, void (*)(Object*, void*, void*), void*) 4 0.9368 dvmInterpret(Thread*, Method const*, JValue*) 4 0.9368 dvmLockObject 4 0.9368 dvmMalloc(unsigned int, int) 4 0.9368 findPackedSwitchIndex(unsigned short const*, int, int) 4 0.9368 readStringIdx(DexFile const*, unsigned char const**) 4 0.9368 unlockMonitor(Thread*, Monitor*) 3 0.7026 dvmSetFinalizable Change-Id: Ic5c36859f6810413bd0b48aad1d99da7daa6e8ba
* | Slight change to unwinder API.Jeff Brown2011-11-031-1/+1
| | | | | | | | Change-Id: If73f01fff9fb56ce9cba70a386d865957eaebe78
* | am f51d43f0: am e3d9cde4: Disable JIT single-stepping resume mode.Ben Cheng2011-11-021-0/+5
|\| | | | | | | | | * commit 'f51d43f0ebfa5739d1ee691d661097dbbad98041': Disable JIT single-stepping resume mode.
| * Disable JIT single-stepping resume mode.Ben Cheng2011-11-011-0/+5
| | | | | | | | | | BUG: 5551114 Change-Id: Id8ee75be5e71ee258994235952871ad181024e56
| * Fix single-stepping resume mode in the interpreter.Ben Cheng2011-10-282-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry-picked from master) When a resume attempt is cancelled due to other pending request make sure the old native resume PC is cleared. Otherwise the JIT code cache may be re-entered with mismatching Dalvik PC. Also fix a code bloat problem where single-step count is not set properly after executing a return instruction. BUG: 5208786 Change-Id: I54775215b11eae29ccdb6111dc0fdfa99e41e08d
* | Merge "Fix single-stepping resume mode in the interpreter."Ben Cheng2011-10-272-2/+8
|\ \
| * | Fix single-stepping resume mode in the interpreter.Ben Cheng2011-10-272-2/+8
| |/ | | | | | | | | | | | | | | | | | | | | When a resume attempt is cancelled due to other pending request make sure the old native resume PC is cleared. Otherwise the JIT code cache may be re-entered with mismatching Dalvik PC. Also fix a code bloat problem where single-step count is not set properly after executing a return instruction. Change-Id: Ia926bc3a87cae1296719a1069838060b181ce54d
* | Dump stacks for all native threads, not just those in JNI.Jeff Brown2011-10-272-6/+3
| | | | | | | | Change-Id: I276f5f448f22f8a926cdfc8c93935da687db5d9b
* | Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-11/+11
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I8bd96961e369a08e86ff78b82d90f20f42787eb1
* | Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGESteve Block2011-10-251-4/+4
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/#/c/141576 Bug: 5449033 Change-Id: Ie3bc0d5436218ea05f98cb0373ecf5924f78db05
* | Dump native stack of JNI methods when handling SIGQUIT.Jeff Brown2011-10-222-0/+38
|/ | | | Change-Id: I7da7259f1350e853153ba4dea96797fc86284068
* Attempt to fix dalvik heap corruption.Jesse Wilson2011-09-061-1/+1
| | | | | | | | This is bccheng's find, as reported here: http://b/5208786#ISSUE_HistoryHeader49 Bug: http://b/5208786 Change-Id: I1616bac1ef6c197f723656187a784fc6838975d4
* Don't wrap the actual type in parens if its null.Jesse Wilson2011-08-141-6/+1
| | | | | | | Otherwise the exception message has unnecessary parens: "expected receiver of type java.lang.String, but got (null)" Change-Id: Iacd806d018019784afa6e9f25f7c039d9ca18fae
* Don't use dvmIsValidObject outside the GC.Elliott Hughes2011-07-192-6/+6
| | | | | | | | Use dvmIsHeapPointer outside the GC. (This still isn't safe because there's no synchronization when dealing with the HeapSource.) Bug: 5049447 Change-Id: Ie0b325ef0a92687ea1eaf1491a4bb832298893c5
* Remove dead code/unused variables to avoid gcc-4.6 warnings.Doug Kwan2011-07-071-3/+0
| | | | Change-Id: I291fd42e91085c51772f560d424334874bef8add
* Improve -verbose:jni.Elliott Hughes2011-06-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 and use StringAppendF.Elliott Hughes2011-06-171-2/+2
| | | | | | I've also removed the dvm prefix from the existing StringPrintf. Change-Id: I3d01f676c876957b6c6e032c674e1a06c3670021
* Improve reference table dumping.Elliott Hughes2011-06-161-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Show the newest entry first; I always assume the top is the newest. 2. Use human-readable type names. 3. Improve the human-readable type name code to show _which_ Class (i.e. java.lang.Class<java.lang.String> rather than just java.lang.Class). 4. Make it clear when we're reporting the number of elements in an array. 5. Show the first few characters of a string. 6. Show the length of a string if we truncate it. (I've also removed some redundant casts and improved const-correctness.) Example: Last 10 entries in JNI local reference table: 16: 0x40f8ec70 java.lang.String "android.permissi... (41 chars) 15: 0x40f8d450 android.os.Parcel 14: 0x40f8eb90 java.lang.String "BlackSurface" 13: 0x408caca0 android.view.SurfaceSession 12: 0x40f8eb60 android.view.Surface 11: 0x406bc6f0 java.lang.Class<com.android.server.SystemServer> 10: 0x406c0278 java.lang.String "com/android/serv... (31 chars) 9: 0x4015d488 dalvik.system.PathClassLoader 8: 0x40148de8 java.lang.Class<java.lang.ClassLoader> 7: 0x406bc560 java.lang.String[] JNI local reference table summary (17 entries): 6 of java.lang.Class<com.android.server.SystemServer> (5 unique instances) 5 of java.lang.String (5 unique instances) 1 of java.lang.String[] 1 of java.lang.String[] (2 elements) 1 of dalvik.system.PathClassLoader 1 of android.os.Parcel 1 of android.view.SurfaceSession 1 of android.view.Surface Change-Id: I56494104cd0daada3ecc1e610f1c94df1e11c640
* Normalize the include guard style.Carl Shapiro2011-06-145-15/+15
| | | | | | | | | | An leading underscore followed by a capital letter is a reserved name space in C and C++. This change also moves any #include directives within the include guard in some of the compiler/codegen/arm header files. Change-Id: I9715e2c5301699d31886e61d0fe6e29483555a2a
* Improve "waiting on"/"waiting to lock" SIGQUIT dump info.Elliott Hughes2011-06-071-22/+25
| | | | | | | | | | | | | In particular, when we're waiting on a Class, say which class: I(16573) - waiting on <0xf5ed54f8> (java.lang.Class<java.lang.ref.ReferenceQueue>) versus: I(16573) - waiting on <0xf5feda38> (a java.util.LinkedList) Bug: http://code.google.com/p/android/issues/detail?id=17349 Change-Id: I844d02c008b1499adb02995ff3da25ba8cad0e0a
* Switch dvmHumanReadableDescriptor over to std::string.Elliott Hughes2011-06-072-100/+63
| | | | | | (Prep work before making a change to stack dumps.) Change-Id: I0af49b920f450fd2611e4b96e717a637483122d6
* More LOG newline cleanup.Dan Bornstein2011-05-261-3/+3
| | | | | | | This changes all the places I could find where the log string was on the line after its LOG call. Change-Id: Iac6a9fcc64f46631fb093824ab60237dce1a5241