summaryrefslogtreecommitdiffstats
path: root/runtime/check_jni.cc
Commit message (Collapse)AuthorAgeFilesLines
* Wire up check JNI force copy mode.Ian Rogers2014-08-081-1107/+2688
| | | | | | | | | | | | Increase check JNI checks. Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h. Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case of VM routines. Make class loader override and shared library class loader JNI global references rather than mirror pointers. Clean-ups to native bridge. Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55
* Merge "Disable adding main and non moving spaces to immune region in GSS"Mathieu Chartier2014-07-161-7/+7
|\
| * Disable adding main and non moving spaces to immune region in GSSMathieu Chartier2014-07-161-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabled adding the main and non moving space to the immune region. This will enable us to recycle bump pointer spaces for malloc space -> malloc space compaction as well as collector transitions. Also added logic for falling back to the non moving space, we may copy objects there. Refactored mod union table logic into MarkReachableObjects. No measurable performance benefit or regression. Bug: 14059466 Bug: 16291259 Change-Id: If663d9fdbde943b988173b7f6ac844e5f78a0327
* | Remove object_utils.h.Ian Rogers2014-07-161-1/+1
|/ | | | | | | | | Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
* Treat larger than jint capacity in NewDirectByteBuffer as an errorBrian Carlstrom2014-06-251-3/+1
| | | | | Bug: 15854028 Change-Id: If78921f4ba2b38a9d0bb421acf9c8bca962ed42a
* Change MethodHelper to use a Handle.Mathieu Chartier2014-06-091-2/+2
| | | | | | | | | | | Added ConstHandle to help prevent errors where you modify the value stored in the handle of the caller. Also fixed compaction bugs related to not knowing MethodHelper::GetReturnType can resolve types. This bug was present in interpreter RETURN_OBJECT. Bug: 13077697 Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3
* Change FieldHelper to use a handle.Mathieu Chartier2014-06-061-9/+11
| | | | | | | | | | | | | | | | Fixed compaction bugs related to FieldHelper::GetType in: artSet32InstanceFromCode SetFieldValueImpl CheckReceiver Field_set interpreter::DoFieldPut MethodVerifier::VerifyISGet MethodVerifier::VerifyISPut MethodVerifier::VerifyIGetQuick Bug: 13077697 Change-Id: I7de9ded2893b5568d43e4daa86fd135bf5508b72
* Merge "Ensure JNI primitive array type is appropriate."Ian Rogers2014-05-141-1/+1
|\
| * Ensure JNI primitive array type is appropriate.Ian Rogers2014-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check the primitive array type for GetPrimitiveArray, ReleasePrimitiveArray, GetPrimitiveArrayRegion and SetPrimitiveArrayRegion matches the given array type. Check the GetPrimitiveArrayCritical and ReleasePrimitiveArrayCritical are given a primitive array. Add unit tests that null parameters lead to fatal errors, not crashes. Fix issues where CheckJNI assumed non-null arguments. Tidy testing code via the use of nullptr. Add a few extra checks. Ensure arrays of void are not able to be created, use RI compatible NoClassDefError. Bug: 14817823 Change-Id: I9903bcd800d0da1988ced07f61fb97b783c5deab
* | Add Handle/HandleScope and delete SirtRef.Mathieu Chartier2014-05-131-4/+4
|/ | | | | | | | | | | | | | | | Delete SirtRef and replaced it with Handle. Handles are value types which wrap around StackReference*. Renamed StackIndirectReferenceTable to HandleScope. Added a scoped handle wrapper which wraps around an Object** and restores it in its destructor. Renamed Handle::get -> Get. Bug: 8473721 Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
* Force inlining on trivial accessors.Ian Rogers2014-04-291-0/+1
| | | | | | | | | Make volatility for GetFieldObject a template parameter. Move some trivial mirror::String routines to a -inl.h. Bug: 14285442 Change-Id: Ie23b11d4f18cb15a62c3bbb42837a8aaf6b68f92
* Remove support for app JNI workarounds.Ian Rogers2014-04-221-8/+3
| | | | Change-Id: I4396df7e93fcace4b5b19c2c387e5c30089182a6
* Object model changes to support 64bit.Ian Rogers2014-02-061-84/+90
| | | | | | | | | | | | | | | | | | | | | | | Modify mirror objects so that references between them use an ObjectReference value type rather than an Object* so that functionality to compress larger references can be captured in the ObjectRefererence implementation. ObjectReferences are 32bit and all other aspects of object layout remain as they are currently. Expand fields in objects holding pointers so they can hold 64bit pointers. Its expected the size of these will come down by improving where we hold compiler meta-data. Stub out x86_64 architecture specific runtime implementation. Modify OutputStream so that reads and writes are of unsigned quantities. Make the use of portable or quick code more explicit. Templatize AtomicInteger to support more than just int32_t as a type. Add missing, and fix issues relating to, missing annotalysis information on the mutator lock. Refactor and share implementations for array copy between System and uses elsewhere in the runtime. Fix numerous 64bit build issues. Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
* Fix a typo in a comment.Narayan Kamath2014-01-021-1/+1
| | | | Change-Id: I2579261f9ea2f8f9c64975fe6cb18c3c6102da39
* JNI: NewDirectByteBuffer should allow 0 length buffers.Narayan Kamath2013-12-201-2/+2
| | | | | | | | | | | | This makes the implementation symmetric with direct buffers allocated from java. - GetDirectBufferAddress returns the address of the buffer passed in to NewDirectByteBuffer (and not NULL). - GetDirectBufferCapaticy returns 0. bug: https://code.google.com/p/android/issues/detail?id=63055 Change-Id: I55b24623ec4f7670972fed898ea097934c6c0b5f
* Compacting collector.Mathieu Chartier2013-11-111-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compacting collector is currently similar to semispace. It works by copying objects back and forth between two bump pointer spaces. There are types of objects which are "non-movable" due to current runtime limitations. These are Classes, Methods, and Fields. Bump pointer spaces are a new type of continuous alloc space which have no lock in the allocation code path. When you allocate from these it uses atomic operations to increase an index. Traversing the objects in the bump pointer space relies on Object::SizeOf matching the allocated size exactly. Runtime changes: JNI::GetArrayElements returns copies objects if you attempt to get the backing data of a movable array. For GetArrayElementsCritical, we return direct backing storage for any types of arrays, but temporarily disable the GC until the critical region is completed. Added a new runtime call called VisitObjects, this is used in place of the old pattern which was flushing the allocation stack and walking the bitmaps. Changed image writer to be compaction safe and use object monitor word for forwarding addresses. Added a bunch of added SIRTs to ClassLinker, MethodLinker, etc.. TODO: Enable switching allocators, compacting on background, etc.. Bug: 8981901 Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
* Remove kNoCopyMagic.Mathieu Chartier2013-10-181-13/+1
| | | | | | Was needed by jniGetNonMovableArrayElements which is now removed. Change-Id: Ie71eda5c5c3643c12db07d249597dbb2df41e88e
* Fix backwards check in CheckStaticMethodBrian Carlstrom2013-10-161-1/+1
| | | | | Bug: 11243757 Change-Id: I559d1163ce72ab7831bd328c621519acb72975e0
* Remove redundant complexity from JNI aborts.Elliott Hughes2013-09-031-15/+2
| | | | Change-Id: I7aca6c661f0dc868e33fd354d0ed27bf17361b28
* Refactor java.lang.reflect implementationBrian Carlstrom2013-08-131-19/+19
| | | | | | | | | | | Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1. Move to ArtMethod/Field instead of AbstractMethod/Field and have java.lang.reflect APIs delegate to ArtMethod/ArtField. Bug: 10014286. Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
* C++11 support for ART.Mathieu Chartier2013-08-131-1/+1
| | | | | | | | | | We can now use auto, ranged based loops, etc.. This compiles, the phone boots, and the tests pass. Depends on: https://googleplex-android-review.googlesource.com/#/c/342487/ Change-Id: I8ba8ed47d2118e4711668c9c8f973a67beb261b2
* Fix cpplint whitespace/comments issuesBrian Carlstrom2013-07-261-28/+28
| | | | Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
* Fix cpplint whitespace/parens issuesBrian Carlstrom2013-07-181-1/+1
| | | | Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-0/+2098
The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81