summaryrefslogtreecommitdiffstats
path: root/vm/oo
Commit message (Collapse)AuthorAgeFilesLines
* Dalvik is dead, long live Dalvik!Brian Carlstrom2014-08-0513-9153/+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
* Revert "Revert "Use libziparchive for dalvik zip processing.""Narayan Kamath2013-12-171-1/+3
| | | | This reverts commit 52dacd58ac8735ffdcd6bbe952586a38ad70e6a5.
* Merge "Dalvik: Ensure that the array length complies with the final specifier"Mathieu Chartier2013-11-271-0/+1
|\
| * Dalvik: Ensure that the array length complies with the final specifierSerban Constantinescu2013-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JSR-133, which Android 4 should comply with, "final" fields should be visible to all threads at the time the constructor exits, regardless of synchronization. This behaviour should also apply to the array lengths as they are regarded as equivalent in behaviour to "final" fields. Non-final fields require explicit synchronization in Java for them to be accessed correctly. The Dalvik VM in Android ensures constructors for ordinary object behave properly by inserting a memory barrier ("DMB") on their return if the object's class has a "final" field. The issue, however, is that while Dalivk inserts a barrier in constructors, it doesn't during array create. A barrier ought to be inserted in order to ensure an array's length is visible when the array itself can be observed by other threads. In order for Dalvik to be correct in respect to JSR-133 and the ARM memory model, it should be modified to have a memory barrier after an array is allocated and initialized, before it is visible to other threads. Change-Id: I329656139264552bbd7cacd8c743b694ee2e0bb8 Signed-off-by: Stuart Monteith <Stuart.Monteith@arm.com> Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
| * Implement the dalvik side of libcore.reflect.Elliott Hughes2013-07-291-0/+4
| | | | | | | | | | | | (Cherry-pick of b4d5cf78d4731ffc6211d07a0d69c92c559ba792.) Change-Id: I5d1b41f029c9c49a2d60a066a5fb0ed0f52f4b52
* | Ignore invalid access flags.Elliott Hughes2013-09-162-4/+3
| | | | | | | | | | Bug: 10134551 Change-Id: I9df8f7a2541e0c9bd2f9294a202fef2afce815f8
* | Implement the dalvik side of libcore.reflect.Elliott Hughes2013-07-251-0/+4
|/ | | | Change-Id: I9ef0da6f715e2727d8530aa7a8edee97b5bfa48d
* Fix inner class access flags and array modifiers.Elliott Hughes2013-06-141-11/+13
| | | | | | | | | Inner class access flags should come from the InnerClass attribute. Array classes should all have the ACC_ABSTRACT modifier set. Bug: https://code.google.com/p/android/issues/detail?id=56267 Change-Id: If4793ee6c7a6b24bf4d32ef05167d81b58011188
* Abstract methods aren't implementations.Elliott Hughes2013-02-221-1/+3
| | | | | | | | | We should only be checking the visibility of actual implementations of interface methods. Intervening abstract methods are allowed to be non-public. Bug: https://code.google.com/p/android/issues/detail?id=42991 Change-Id: I510d0cc6c1f89d161d4ebad7ef058c03fa09e9b0
* Don't cache failures in the interface cache.Elliott Hughes2012-12-061-0/+1
| | | | | | | | | | | If we try to reuse a failure, we'll be holding a NULL Method* without the current thread having the appropriate exception pending, which will lead to a SIGSEGV. I've added a corresponding vm-test to cts/. Bug: http://code.google.com/p/android/issues/detail?id=29358 Change-Id: I044e438c46fce256c8eff2dac5d86778734d5614
* Revert the fix for incorrect package-private overriding.Elliott Hughes2012-10-151-16/+20
| | | | | | | | | | | | | | This fixes FIFA 2012, the download portion of which relies on the old bug, without breaking instrumentation tests. The problem is that dexopt tries to quicken method calls, and gets confused by this case where the apparent static method resolution differs from the actual one at runtime, depending on the targetSdkVersion of the specific app. dexopt can't make an ahead-of-time decision in a world where the rules might change at runtime. Bug: 7301030 Bug: 7343420 Change-Id: Iaa15611f099546b7e54279cfd6abc9b4cdcb9812
* Revert "Don't enforce access checks for overloading for targetSdkVersion < 17."Elliott Hughes2012-10-121-15/+9
| | | | | | | | This reverts commit 0fe885202fc2d1e7f3d34c99ae3487a9a6387be1 May be causing http://b/7343420, though I can't reproduce that crash. Change-Id: Ia3d2a1507602d07699d1f9914e734cc813f97518
* Don't enforce access checks for overloading for targetSdkVersion < 17.Elliott Hughes2012-10-111-9/+15
| | | | | | | Still warn, and enforce the missing check for targetSdkVersion >= 17. Bug: 7301030 Change-Id: I8189fcbf222f331b1f80a156b01082d61f1f9362
* Revert "Ensure we fence the writing of clazz to an Object post allocation."Brian Carlstrom2012-08-221-1/+1
| | | | This reverts commit 821ab588af4566a800d4b5608092ccc1dd3764af.
* Ensure we fence the writing of clazz to an Object post allocation.Ian Rogers2012-08-211-1/+1
| | | | | | | | | | We hold the heap lock during the calloc of an object in the GCed heap. We do a non-volatile store following this for the clazz, this may lead to a race where an object is allocated but appears to have no clazz. Found investigating Bug: 7028104 Change-Id: I390ad4c7b9632127bd27393742be347b84d9269a
* Avoid sign extension in packed-switch.Elliott Hughes2012-07-171-4/+11
| | | | | | | | | | | This code (at least in the ARM version) is trying to assign to r0 and r1 from C by returning a 64-bit result. The mistaken use of signed integers for pointers can lead to sign extension if the JIT code cache is at a sufficiently high address. Bug: 6799823 Bug: 6703991 Change-Id: Ic3f587f453f0f3f520551383ef1ed29efa1ad551
* Warn if we see a class whose behavior has changed because of ↵Elliott Hughes2012-07-131-13/+19
| | | | | | https://android-review.googlesource.com/#/c/32480/. Change-Id: Ic7ca229a92c8d1bd666ecf64209d061301dcb0c9
* Avoid method overriding if its super method is inaccessible.Im Sooin2012-07-101-2/+2
| | | | | | | | | | | A call to package private method could be redirected to subclass which was not in the same package. Modified vtable to retain virtual super methods which cannot be accessed. This change affects vtable index in optimized dex. Change-Id: I9cc7e309c305bca12e5061009c4245fb70014681 Signed-off-by: Im Sooin <ciecet@gmail.com>
* Support building Dalvik with AddressSanitizer.Evgeniy Stepanov2012-04-111-1/+1
| | | | Change-Id: I007c5080081a4a66b39fa6b539afd8f00fd8ce0f
* am 9e8b05e4: am a669206d: Merge "cleanup redundant interfaces from iftable ↵Jean-Baptiste Queru2012-01-171-40/+35
|\ | | | | | | | | | | | | to avoid excessive LinearAlloc use" * commit '9e8b05e4529c4f9bf66d3db21ae79ccbbe97a1dc': cleanup redundant interfaces from iftable to avoid excessive LinearAlloc use
| * cleanup redundant interfaces from iftable to avoid excessive LinearAlloc useJohannes Rudolph2012-01-131-40/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In deep interface hierarchies super-interfaces are recursively concatenated to create the iftable. There was no checking for duplicated entries so that the iftable could get pretty large with just a few layers of interfaces up to the point where the LinearAlloc was exceeded completely. This change scans the iftable linearly for existing entries before it adds another one. Issue: http://code.google.com/p/android/issues/detail?id=22586 Change-Id: Idb4a13ca7a52f390661629cf2539930242526876 Signed-off-by: Johannes Rudolph <johannes.rudolph@gmail.com>
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-082-24/+24
| | | | | | | | | | | | | | | | | | 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-064-32/+32
| | | | | | | | | | | | | | 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-052-46/+46
| | | | | | | | | | | | | | 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-032-14/+14
| | | | | | | | | | | | | | 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-262-31/+31
| | | | | | | | | | | | | | 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-2/+2
|/ | | | | | | See https://android-git.corp.google.com/g/#/c/141576 Bug: 5449033 Change-Id: Ie3bc0d5436218ea05f98cb0373ecf5924f78db05
* Leave up to 512 chars of gDvm.lastMessage on dvmAbort's stack frame.Ben Cheng2011-10-101-0/+1
| | | | | Bug: 5372634 Change-Id: I019a059e5a989de3dfc9e2f5e78f7caa7168cf75
* Fix memory barriers (Issue 3338450)buzbee2011-09-271-6/+2
| | | | | | Add extra memory barrier on volatile stores. Change-Id: Id4a4750cdfc910eda2f0b44ead0af2a569b5735e
* Fix native method logging to show local references rather than direct pointers.Elliott Hughes2011-06-301-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary (but not sufficient) for debugging third-party JNI bugs. It's the second half of the logging story, but still doesn't address the question of "how does the developer turn on the logging?". This removes the variant JNI bridges at the cost of adding a couple of booleans to struct Method. Performance is about the same, except synchronized native methods are quite a bit faster after the change. Before: benchmark ns linear runtime _emptyJniMethod0 333 ========== _emptyJniMethod6 367 =========== _emptyJniMethod6L 921 ============================== _emptyJniStaticMethod0 259 ======== _emptyJniStaticMethod6 287 ========= _emptyJniStaticMethod6L 873 ============================ _emptyJniStaticSynchronizedMethod0 404 ============= _emptyJniSynchronizedMethod0 452 ============== After: benchmark ns linear runtime _emptyJniMethod0 344 ========== _emptyJniMethod6 348 ========== _emptyJniMethod6L 969 ============================== _emptyJniStaticMethod0 265 ======== _emptyJniStaticMethod6 293 ========= _emptyJniStaticMethod6L 968 ============================= _emptyJniStaticSynchronizedMethod0 265 ======== _emptyJniSynchronizedMethod0 323 ========== A better optimization for the case where there are reference arguments would be to keep a list of argument indexes in the struct Method, so we could iterate directly over those arguments that need converting to local references. That would also let us do something about the overhead of repeatedly looking up which local reference table and cookie to use. But now is not the time. Change-Id: Ie32daca1b31be057a44f1ed4b5d28d1634380e1d
* Fix native methods that weren't registered via RegisterNatives.Elliott Hughes2011-06-231-2/+6
| | | | | | Cherry pick of a64af4aabf261d34eac8b5a9d92992ee70051829. Change-Id: I43df4e33e39ccaf9e26c842f22da3391cfa17e2b
* Make some of the StringObject functions member functions.Elliott Hughes2011-06-171-0/+15
| | | | Change-Id: I72ed13c16f0cb24498772c453ba268a0f65f208a
* Normalize the include guard style.Carl Shapiro2011-06-147-21/+21
| | | | | | | | | | 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
* Allow native methods to declare they don't need a JNIEnv*.Elliott Hughes2011-06-141-0/+3
| | | | | Bug: 3069458 Change-Id: Ic9a6c562c5abf9607dd4c8a71b0d1e389e6d340b
* Switch dvmHumanReadableDescriptor over to std::string.Elliott Hughes2011-06-071-3/+2
| | | | | | (Prep work before making a change to stack dumps.) Change-Id: I0af49b920f450fd2611e4b96e717a637483122d6
* Add some error checking and clean out some cruft.Dan Bornstein2011-06-022-50/+45
| | | | | | | | | | | | | | | | Error checking #1: When a cached dex file can't be created, do extra analysis to figure out (and report) why. Error checking #2: When opening classpath entries, become sensitive to the file extension, only trying to open files with the right extensions and complaining explicitly if it's unrecognized. Cruft cleaning: We've never supported finding class files in directory hierarchies in Dalvik. Fix some related comments and clean out some code that tried (in vain) to implement a piece of that. Bug: 4523201 Change-Id: I05b7a8570f147955cd62229fca72b50d36703752
* More LOG newline cleanup.Dan Bornstein2011-05-262-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
* Prefer printf format "%#x" over "0x%x".Dan Bornstein2011-05-261-1/+1
| | | | | | I exist to serve. Change-Id: I8e2880b20eefd466da8515d5b6b0c5cb75d56169
* Further conservation of newlines.Dan Bornstein2011-05-265-180/+180
| | | | | | Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
* Dump the pending exception before aborting in FindClass.Elliott Hughes2011-05-131-2/+3
| | | | | | | | CheckJNI already does this, but since we're about to abort, we should do this even without CheckJNI. Bug: http://code.google.com/p/android/issues/detail?id=16758 Change-Id: Ief5e8d836ad16d342eead8db9e44ae5af7983c3a
* Fixes to allow the debug VM configuration to build.Carl Shapiro2011-05-101-1/+1
| | | | Change-Id: Ifbe6acf84beb75014303152d20153072e7e50c55
* Establish a subclass relationships among the field types.Carl Shapiro2011-05-065-60/+57
| | | | Change-Id: Id349b359489bb6b1bbb4ab78d29d85c0e6b33799
* Establish a subclass relationship between ClassObject and Object.Carl Shapiro2011-05-063-25/+20
| | | | Change-Id: I9fb5d33f23ec7aeb2b9a3908d4125b34be0599ae
* Make interned strings non-movable.Carl Shapiro2011-05-051-3/+1
| | | | | | | | | | | | | | At present objects referenced from dex files must have stable reference values. With this change, only non-moving strings are interned. If a user interns a movable string a non-moving copy is made and the copy is added to the intern table. As part of this change, the internal string hash code access routine will update the hash code slot of a string object. In addition, StringObject has been made a subclass of Object eliminating various down-casts that would otherwise be explicitly required. Change-Id: I6b015b972aac44948470c0034ad17e5eef456aeb
* Establish a subclass relationship between ArrayObject and Object.Carl Shapiro2011-05-033-14/+10
| | | | Change-Id: I9f9fe52bd4ceebb6dde48251a89190ba6bb00ce4
* Establish a subclass relationship between DataObject and Object.Carl Shapiro2011-05-022-4/+2
| | | | Change-Id: Ifd0e364f7789d9e13f769f8d6a65c3c573915fd3
* Type the reference member of JValue as an Object pointer.Carl Shapiro2011-04-291-4/+4
| | | | | | | | | | | Previously this had been a void pointer. To avoid adding lots of casts from the logical Object subtypes to Object the RETURN_PTR macro silently casts its argument to an Object* before performing an assignment to the JValue return value. After an inheritance relationship is established between Object and its subtypes this cast can be removed. Change-Id: Id05e5c11e57e2a9afd12bad0be095f1dfe9e1f51
* Merge "Add a non-moving option to dvmMalloc and make use of it." into dalvik-devCarl Shapiro2011-04-282-4/+4
|\
| * Add a non-moving option to dvmMalloc and make use of it.Carl Shapiro2011-04-272-4/+4
| | | | | | | | | | | | | | | | | | At present, class objects, non-moving arrays, and interned strings have location dependencies in native code. Allocating non-moving is a no-op for the present heap, but this option will have an effect after the copying collector is integrated. Change-Id: I674f83a086ac65db303baab0599831f80f52a4a5
* | Get rid of uneeded extern, enum, typedef and struct qualifiers.Carl Shapiro2011-04-278-100/+35
|/ | | | Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4