summaryrefslogtreecommitdiffstats
path: root/vm/reflect
Commit message (Collapse)AuthorAgeFilesLines
* Dalvik is dead, long live Dalvik!Brian Carlstrom2014-08-054-4869/+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
* Don't implicitly cast NULL to a boolBernhard Rosenkränzer2013-12-291-3/+3
| | | | | | | | The code is wrong and causes an error when building with clang 3.4 (-Werror,-Wnull-conversion) Change-Id: If03aa782fa25337802ff906a0d06071fbda93e26 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
* Implement the dalvik side of libcore.reflect.Elliott Hughes2013-07-292-12/+19
| | | | | | (Cherry-pick of b4d5cf78d4731ffc6211d07a0d69c92c559ba792.) Change-Id: I5d1b41f029c9c49a2d60a066a5fb0ed0f52f4b52
* Simplify merges of the annotation code.Elliott Hughes2013-07-231-14/+11
| | | | Change-Id: I9fd3b53032b2e6053094500571775ed2fb5edf78
* Fix a Field.isAnnotationPresent crash.Elliott Hughes2013-03-191-7/+12
| | | | | | | | For instances of Proxy, generated at runtime, there is no corresponding .dex file. Bug: https://code.google.com/p/android/issues/detail?id=24846 Change-Id: I36da43d5279a61b8cb71cdf2bbc3065b6a979830
* Fix a tracked reference leak in dvmGenerateProxyClass.Elliott Hughes2013-02-051-5/+4
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=43919 Change-Id: Ib5c217368ba75f4422d0c932c2c67daaaeddea4b
* Fix handling of annotations whose classes are missing at runtime.Elliott Hughes2012-12-171-18/+39
| | | | | Bug: http://code.google.com/p/android/issues/detail?id=39854 Change-Id: I3089b693ff3084b093f991f991ac9273dea7356d
* am 505c1cad: am 37755063: Merge "Fix Method.getParameterAnnotations."Elliott Hughes2012-07-231-0/+6
|\ | | | | | | | | * commit '505c1cad45fe793d59842bfbf6bae1d9e195b427': Fix Method.getParameterAnnotations.
| * Fix Method.getParameterAnnotations.Elliott Hughes2012-07-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | The dex format represents parameter annotations using an annotation_set_ref_item for each parameter. According to the spec, the item's annotation_offset can be "0 if there are no annotations for this element". The Dalvik VM accepts 0 values in the verification step, but Method#getParameterAnnotations then crashes with a segmentation fault. Bug: http://code.google.com/p/android/issues/detail?id=35304 Change-Id: I0ac7336d369894520c8e17848ab6a91dbbd905e9
* | Fix for bug 6448650 by changing to dvmCreateReflectObjForMethodMathieu Chartier2012-05-171-1/+1
|/ | | | | | | | Bug: 6448650 Changing dvmCreateReflectMethodObject with dvmCreateReflectObjForMethod in createAnnotationMember fixes crash caused by accessing uninitialized gDvm.classJavaLangReflectMethod Change-Id: I3ce9b112a4afab2f972b80cbdb80f1ab1fb9678c
* am a14639df: Merge "Support architectures that require correctly aligned ↵Elliott Hughes2012-05-021-0/+9
|\ | | | | | | | | | | | | doubles" * commit 'a14639df65cc0aefafcddda5aae8b591204e45f9': Support architectures that require correctly aligned doubles
| * Support architectures that require correctly aligned doublesRaghu Gandham2012-02-141-0/+9
| | | | | | | | | | | | | | | | CTS: tests.api.java.lang.reflect.MethodTest#test_invokeLjava_lang_Object$Ljava_lang_Object Change-Id: I93c391884d802b8e69fe3e1ced55a2f2c7866d16 Signed-off-by: Nikola Kuzmanovic <nikola.kuzmanovic@rt-rk.com> Signed-off-by: Chris Dearman <chris@mips.com>
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-083-19/+19
| | | | | | | | | | | | | | | | | | 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-19/+19
| | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | 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-033-11/+11
| | | | | | | | | | | | | | 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-263-15/+15
|/ | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I8bd96961e369a08e86ff78b82d90f20f42787eb1
* Normalize the include guard style.Carl Shapiro2011-06-141-3/+3
| | | | | | | | | | 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
* More LOG newline cleanup.Dan Bornstein2011-05-261-1/+1
| | | | | | | This changes all the places I could find where the log string was on the line after its LOG call. Change-Id: Iac6a9fcc64f46631fb093824ab60237dce1a5241
* Further conservation of newlines.Dan Bornstein2011-05-263-73/+73
| | | | | | Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
* Establish a subclass relationships among the field types.Carl Shapiro2011-05-063-14/+14
| | | | Change-Id: Id349b359489bb6b1bbb4ab78d29d85c0e6b33799
* Establish a subclass relationship between ClassObject and Object.Carl Shapiro2011-05-061-3/+3
| | | | Change-Id: I9fb5d33f23ec7aeb2b9a3908d4125b34be0599ae
* Make interned strings non-movable.Carl Shapiro2011-05-051-1/+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 DataObject and Object.Carl Shapiro2011-05-021-5/+4
| | | | Change-Id: Ifd0e364f7789d9e13f769f8d6a65c3c573915fd3
* Merge "Add a non-moving option to dvmMalloc and make use of it." into dalvik-devCarl Shapiro2011-04-281-1/+1
|\
| * Add a non-moving option to dvmMalloc and make use of it.Carl Shapiro2011-04-271-1/+1
| | | | | | | | | | | | | | | | | | 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-272-14/+6
|/ | | | Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
* Remove unneeded void argument list declarations.Carl Shapiro2011-04-201-1/+1
| | | | Change-Id: Ica749f6defa890363ec531b29e25bc415dc2cbb9
* Replace public uses of dvmAllocArray with dvmAllocArrayByClass.Carl Shapiro2011-04-192-68/+46
| | | | Change-Id: Ica5d457566ebf1196af5c0ef260ddeb95f569b81
* Add a class flag CLASS_ISCLASS.Dan Bornstein2011-04-132-3/+3
| | | | | | | | | | | | This flag is only turned on for the unique class Class, and it is meant to make it possible to quickly test objects for "classiness" as well as trivially figure out if one is looking at the class Class itself. Bonus: Made a few places that directly set class->accessFlags use the prescribed macro for doing same. Change-Id: I89fce708c407b597f28ce610b778123f5dcaecf6
* Move the reflection code into C++.Carl Shapiro2011-04-133-122/+99
| | | | | | | Smart pointers would make dvmGenerateProxyClass cleaner. This code should be revisited once those interfaces come into existence. Change-Id: If25abb87e22d658ad88f997324c35703b23f623c
* Convert the internal and in-line natives to C++.Carl Shapiro2011-04-121-0/+8
| | | | Change-Id: I2ece682bc3b4d3b55ab27c60fd84a0b3243d7ca6
* Support reflective lookup of single fields.Jesse Wilson2011-03-282-0/+38
| | | | | Change-Id: Ie7058fa9de8212b0f52d5d9b0ec7d46242a851fc http://b/4087759
* Native code to fast path annotation lookups.Jesse Wilson2011-03-252-0/+66
| | | | | | | This also removes duplication between Method and Constructor. Change-Id: I19cdcfdfe5cc3ce28a9be401a1bc58a5a6e8ec81 http://code.google.com/p/android/issues/detail?id=7811
* Optimize annotations.Jesse Wilson2011-03-242-0/+100
| | | | | | | See libcore change I5912b526dfa87a61a95fbe7b7efc48d0dca3ad38 Change-Id: I89ed0be331eea3d9c0d02bebeaa719b686d532ca http://code.google.com/p/android/issues/detail?id=7811
* Clean up method reference/offset initialization.Dan Bornstein2011-03-151-0/+7
| | | | | | | | Similar to my previous few changes, all of the method lookups got pulled into one of two new table-driven functions, initDirectMethodReferences() and initVirtualMethodOffsets(). Change-Id: I382dce9e0b39c9a6f5c90ad49a4a859c5fb2cf42
* Clean up how primitive types are handled.Dan Bornstein2011-03-111-74/+102
| | | | | | | | | | | | | | | | | | | | | | | The PrimitiveType enum got "promoted" to libdex, and I added a few helper functions there. I also quashed the idea that there is some sort of canonical ordering of the enumerated values. In the vm (per se), I made PrimitiveType uses where it had assumed an ordering instead switch(). This mostly made things much simpler. I also split out the array of type classes in Globals.h into individual ClassObject*s. This mostly made things simpler, but the gc got a tiny bit of extra cruft because of it. Finally, I made it so that the type classes get created explicitly during vm startup, instead of happening implicitly the first time they're accessed. This both simplified the code and, in particular, made it so that the type classes didn't have to be declared volatile. There are still a couple of related items that could stand to be cleaned up, but I think what's here is enough for one patch. Change-Id: Id14a6dfdb200abce9f30911c330ba32d9c2a4c3f
* Collate more of the low-level class lookups.Dan Bornstein2011-03-074-242/+0
| | | | | | | | | | | | I pulled out all the initialization code that I could find that was merely looking up class and member names during early VM initialization, putting them all in a new file, InitRefs.c. I didn't do any real restructuring of the code, though. That will come in a follow-up. This was instigated by discussion surrounding bug #3500987, but it's not directly related to it. Change-Id: I59e93e552d29a5518f2cc4e1e30c4a8d51750d7b
* Set up a few more exceptions.Dan Bornstein2011-03-031-2/+1
| | | | | | | I'm starting to scrape the bottom of the barrel. Bug: 3500987 Change-Id: If9c0f922506a94e78c504ea8c58176effe5fe00c
* More exception cleanup.Dan Bornstein2011-02-251-2/+2
| | | | | | | | | | I added a few more exception class objects, and migrated existing uses of those exceptions away from naming the class as a string. I left one TODO in the x86-atom interp, as there is nobody actively maintaining that codebase. Change-Id: I9226a2d81b0389a14f7a3770d978a9bbe98c2898
* Add new comparator function.Dan Bornstein2011-02-231-9/+5
| | | | | | | | | | This one compares a DexProto with a list of method parameter types, and it is immediately useful in the new getMethod() reflection code, to avoid doing a bunch of extra string manipulation. While I was in the territory, I removed some comment redundancy. Change-Id: I1d3c8df534601890165b2e251c036579e4caccdc
* am 5945bc11: Merge "Optimize Class.getMethod() by loading only one method."Jesse Wilson2011-02-232-0/+106
|\ | | | | | | | | * commit '5945bc11f354083d24f952992dc579a1fd77dba8': Optimize Class.getMethod() by loading only one method.
| * Optimize Class.getMethod() by loading only one method.Jesse Wilson2011-02-232-0/+106
| | | | | | | | | | Change-Id: Ia2cd776c0a14914264e8d94e978d55854ed75623 http://b/3431686
* | Factor out class names from throw statements.Dan Bornstein2011-02-233-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most exception throwing now happens via purpose-built wrapper functions, each of which encapsulates the actual exception class name, reducing one source of error (examples of which I fixed during this exercise) and generally tidying things up. This change doesn't fix all uses of exception class names, nor even all throws, because (a) there were classes I didn't get to; (b) because I didn't make wrappers for all the possible throw function variants (e.g. the one that takes a cause, the one that takes varargs for string formatting, etc.); and (c) there are uses of exception classes in contexts other than throwing. But this change at least makes a dent in the problem. Change-Id: I6586ddd3e66ac0fc32c23181b17600ded0b914b2
* | Remove the HPROF stack trace collection feature.Carl Shapiro2011-01-311-3/+0
| | | | | | | | Change-Id: I0eab9c496b07212fb2c86fe122dc422e70af891e
* | Fix implicit conversions, rename reserved works, enable -Wc++-compat.Carl Shapiro2010-12-073-9/+9
|/ | | | Change-Id: I06292964a6882ea2d0c17c5c962db95e46b01543
* Rename wrap/unwrap --> box/unboxAndy McFadden2010-11-044-16/+16
| | | | | | | | | | Use the correct term when moving primitive values in and out of their parallel reference types. Also, turn off the verifyCount check in dvmInvokeMethod unless assertions are enabled. The verifier guarantees this. Change-Id: I47629835784b5e770089ab3ca5410ee1c42820d9
* HPROF is here to stay, make WITH_HPROF the default.Carl Shapiro2010-11-011-1/+1
| | | | Change-Id: Ic9947461daa21641fd9d34d52b6c7998716d8ab2
* Minor rename.Andy McFadden2010-10-121-2/+2
| | | | | | Rename two dummy-result variables to "unused". Change-Id: Ib3e49436904123c6ceebe9bfb6e461f654209b23
* Track result from dvmCallMethodAndy McFadden2010-10-081-0/+4
| | | | | | | | | | | | | | | | | | | When dvmCallMethod returns an object reference, we need to ensure that the GC doesn't release or relocate the storage. Unless we have a clear view of how the object is used, we need to explicitly track and release it. This adds additional tracking, or comments indicating that explicit tracking is not necessary. On a similar note, clearing/restoring a pending exception requires explicit tracking of that exception, since there's a fair chance that it's no longer in the root set. That needed fixing in a couple of places. Bug 3009076. Change-Id: I39def8c3a5a628f0ee86fc094e34d7c69248c28b