summaryrefslogtreecommitdiffstats
path: root/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
Commit message (Collapse)AuthorAgeFilesLines
* Revert "64bit changes to the stack walker for the Quick ABI."Nicolas Geoffray2014-04-221-0/+11
| | | | | | This reverts commit 5cb328362a633302ca0fcdbaa0da7d94069df051. Change-Id: Icc0ec1a9f15c2e4e9103e732d7ba75a4feb853b1
* 64bit changes to the stack walker for the Quick ABI.Nicolas Geoffray2014-04-181-11/+0
| | | | | | | - Spill registers have different sizes. - The ArtMethod at the bottom of the stack is always of kWordSize. Change-Id: I92f67ff928477970c393c7146980255d08e8e6af
* ART: A workaround for a wrongly-read caller's frameVladimir Kostyukov2014-04-071-75/+32
| | | | | | | | | | | | The quick-trampoline treats caller's frame in a different way then it was formed by quck-invoke stub for hard float ABI targets such as x86_64 and aarch64. The patch workarounds the issue of wrongly-read stack arguments due to no contract between quick-invoke stub and quick-trampoline/shadow-frame-builder regarding the reg- spill area. Change-Id: I302f212b4ea5e38632527a5ace03f136b21ef806 Signed-off-by: Vladimir Kostyukov <vladimir.kostyukov@intel.com>
* Fix wrong handling of Generic JNI not finding native method.Andreas Gampe2014-04-041-22/+35
| | | | | | | | | Code did not properly call JNIMethodEnd, such that locks etc where not correctly handled. Add a test case to jni_compiler_test. Change-Id: If2d5c628517d65a56dd6bb5c4cabdff77c7664a1
* Please clang by making explicit instantiations non-static.Nicolas Geoffray2014-04-041-4/+4
| | | | Change-Id: I4112bf62c69b4f28ca369c4bf3c626be43692afd
* Explicitly instantiate artInvokeCommon to please analysis tool.Nicolas Geoffray2014-04-041-7/+26
| | | | Change-Id: I5c078a197c5026e9bd886d0ba1e188054b5ffa75
* Restore the args in the invoke trampoline slow paths.Mathieu Chartier2014-04-031-0/+229
| | | | | | | | | | | | | | | | | | Previously, there were errors caused by not restoring the args for the slow path in artInvokeInterfaceTrampoline and artInvokeCommon. The slow path in artInvokeInterfaceTrampoline occurs when you attempt to do an interface dispatch of a method in another dex file. The slow path in artInvokeCommon occurs when the method in dex cache is not already resolved. Since FindMethodFromCode may resolve a method, it can occasionally cause thread suspension/GC. If a moving GC occurred at this point it resulted in this_object being invalid after the trampoline returned the code pointer. This caused a native crash in one of the money runs since there was an unbundeled app which did a List.iterator call. Bug: 12934910 Change-Id: Ib454faad14bef0d7732a6d7f1ca5803472d502a6
* AArch64: Add arm64 runtime support.Stuart Monteith2014-03-191-0/+43
| | | | | | | | | Adds support for arm64 to ART. Assembler stubs are sufficient for down calls into interpreter. JNI compiler and generics are not finished. Basic Generic JNI functionality. Change-Id: I4a07c79d1e037b9f5746673480e32cf456867b82
* Refactor reflective method invocation.Ian Rogers2014-03-141-1/+1
| | | | | | | | | | Move invocation code out of JNI internal into reflection, including ArgArray code. Make reflective invocation use the ArgArray to build arguments rather than allocating a jvalue[] and unboxing arguments into that. Move reflection part of jni_internal_test into reflection_test. Make greater use of fast JNI. Change-Id: Ib381372df5f9a83679e30e7275de24fa0e6b1057
* Remove small duplicate code in Generic JNI handling, add commentsAndreas Gampe2014-03-141-1/+5
| | | | Change-Id: Ib276fa63b6a00480eaaff6c352d37917c61e966c
* Fixes for Generic JNIAndreas Gampe2014-03-131-9/+17
| | | | | | | | | | | | | | | | This fixes some linking issues and native code retrieval errors. All host tests are functional with this change. Make ArtMethod::GetFrameSizeInBytes() templated to bypass the embedded sanity check. Necessary for fix-up decision. Add ArtMethod metadata fix-up code to ClassLinker::LinkCode. Necessitates new parameters to access the shorty and compute the frame size. Fix handling the JNI dlsym lookup stub in the generic JNI code. Change-Id: I4173b0fbb1ba5b1bcbee1bb340cfdd08a54767e5
* Implement FINAL/OVERRIDE for clang.Ian Rogers2014-03-131-147/+163
| | | | | | | | | | Separate declaration from definition in certain places to work-around issues with clang. Remove bogus lock annotation at definition in compilers.cc that is already present at the declaration. Remove duplicate definition of ClassReference. Change-Id: I5368057bb36319a259110b2198610d9d2b2e5041
* Fixing structure of native frame for Generic JNIAndreas Gampe2014-03-121-67/+78
| | | | | | | | | This changes the layout of the callee-save frame used in generic JNI to be consistent with the JNI compiler, that is, the SIRT is inline (above the method reference). Now the location of the "this" object is consistent. Change-Id: Ibad0882680712cb640b4c70ada0229ef7cf4e62c
* More JNI compiler tests and small fixAndreas Gampe2014-03-101-1/+1
| | | | | | | Add checks for alignment, floats, and maximum number of parameters Fixed x86_64 ABI wrong interpretation (floats not widened in registers) Change-Id: I6c09af4914b7675ac0275ce21003e317ca44a403
* JNI down call fixes.Ian Rogers2014-03-091-6/+8
| | | | | | | Ensure SIRT isn't accessed via quick callee save frame. Some tidying of code. Change-Id: I8fec3e89aa6d2e86789c60a07550db2e92478ca7
* Release unused parts of a JNI frame before calling native codeAndreas Gampe2014-03-071-166/+521
| | | | | | | Two-pass process for setting up the JNI frame so we can put Sirt and native call stack as close together as possible. Change-Id: I827167a55fafc4eba7d4eaf14a35fc69fd5f85ce
* Generic JNI implementation for x86_64Andreas Gampe2014-03-051-56/+418
| | | | | | | | Starting implementation for generic JNI on x86_64. Frames are of large static size (>4K) right now, should be compacted later. Passes the whole of jni_compiler_test. Change-Id: I88ac3e13a534afe7568d62a1ef97cb766e8260e4
* Support compiler filters for boot classpathBrian Carlstrom2014-03-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | image_writer.cc Remove assumption that all methods in the boot classpath are compiled oat_writer.cc Don't skip writing ArtMethod::quick_code_offset_ for methods that need resolution, leave that to ImageWriter dex2oat.cc Allow dex2dex compilation of image dex files by making the in memory pages writable in all cases, not just app case. oatdump.cc dump new OatHeader fields use ImageSpace.GetImageFilename, not command line image filename, since location may be in dalvik-cache remove inaccurate check about non-null GC map quick_trampoline_entrypoints.cc add and improve some DCHECKS that were useful while debugging class_linker.cc image_space.cc fix double facepalm parsed_options.cc fix zygote logging to not skip values to two part options like -classpath <foo> runtime.cc wireup parsed compiler options to runtime Change-Id: Iad314df0b80623c0663d61713d5098297ab9ac87
* Initial changes towards Generic JNI optionAndreas Gampe2014-03-031-0/+9
| | | | | | | | Some initial changes that lead to an UNIMPLEMENTED. Works by not compiling for JNI right now and tracking native methods which have neither quick nor portable code. Uses new trampoline. Change-Id: I5448654044eb2717752fd7359f4ef8bd5c17be6e
* Add null check in artQuickResolutionTrampolineMathieu Chartier2014-02-271-7/+11
| | | | | | | Also fix possible compaction bug around ResolveMethod. Bug: 13221223 Change-Id: I0495eaee8d5f9ae5da0a87c4800a66cd04dc4aa7
* Restore refs in artQuickProxyInvokeHandler.Mathieu Chartier2014-02-211-14/+30
| | | | | | | | | | Fixes a compaction related bug which could be caused by moving args in artQuickProxyInvokeHandler and not updating them before returning back into compiled code. Also changed some Object** to StackReferences. Change-Id: I0779c8fd5f10f142d3c6149ddc531c99ff8ee4c2
* Upcall support for x86-64.Ian Rogers2014-02-201-98/+298
| | | | | | Sufficient to pass jni_internal_test. Change-Id: Ia0d9b8241ab8450e04765b9c32eb6dc8fc1a8733
* Remove blacklistSebastien Hertz2014-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the class initialization blacklist and use transaction to detect and revert class initialization attempting to invoke native method. This only concerns class initialization happening at compilation time when generating an image (like boot.art for the system). In transactional mode, we log every object's field assignment and array update. Therefore we're able to abort a transaction to restore values of fields and array as they were before the transaction starts. We also log changes to the intern string table so we can restore its state prior to transaction start. Since transactional mode only happens at compilation time, we don't need to log all these changes at runtime. In order to reduce the overhead of testing if transactional mode is on/off, we templatize interfaces of mirror::Object and mirror::Array, respectively responsible for setting a field and setting an array element. For various reasons, we skip some specific fields from transaction: - Object's class and array's length must remain unchanged so garbage collector can compute object's size. - Immutable fields only set during class loading: list of fields, method, dex caches, vtables, ... as all classes have been loaded and verified before a transaction occurs. - Object's monitor for performance reason. Before generating the image, we browse the heap to collect objects that need to be written into it. Since the heap may still holds references to unreachable objects due to aborted transactions, we trigger one collection at the end of the class preinitialization phase. Since the transaction is held by the runtime and all compilation threads share the same runtime, we need to ensure only one compilation thread has exclusive access to the runtime. To workaround this issue, we force class initialization phase to run with only one thread. Note this is only done when generating image so application compilation is not impacted. This issue will be addressed in a separate CL. Bug: 9676614 Change-Id: I221910a9183a5ba6c2b99a277f5a5a68bc69b5f9
* Speed up method lookup in a different dex file.Vladimir Marko2014-02-111-2/+4
| | | | | | Use already known name and proto. Change-Id: I4505b81724bd6a0f3cf21ee6fed44774d38c4e15
* Object model changes to support 64bit.Ian Rogers2014-02-061-3/+9
| | | | | | | | | | | | | | | | | | | | | | | 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
* Enable moving classes.Mathieu Chartier2013-12-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Slight reduction in Zygote size, memory savings are in the noise. Before: Zygote size: 8739224 After: Zygote size: 8733568 Fixed a bug where we didn't set the concurrent start bytes after switching the allocator from bump pointer to ROSAlloc in the zygote. This caused excessive memory usage. Added the method verifiers as roots to fix an issue caused by RegTypes holding a Class*. Added logic to clear card table in the SemiSpace collector, this reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace collector. Added a missing lock to the timing loggers which caused a rare one time crash in std::set. Bug: 11771255 Bug: 8499494 Bug: 10802951 Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae
* Compacting collector.Mathieu Chartier2013-11-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Populate dex cache for sharpened calls.Ian Rogers2013-10-251-0/+16
| | | | | | | | | | | We ensured the resolved method was in the dex cache, but for a sharpened call this is abstract. Ensure that the concrete method is also resolved. Limit the use of direct dex cache based dispatch to cases where we know how to patch the dex cache. Bug 11389002 Change-Id: I08252686a53b5948650632837c74bcd5cbf8a862
* Make artQuickResolutionTrampoline fix up references after GC points.Mathieu Chartier2013-09-261-7/+14
| | | | | | | Required for compaction. Bug: 8981901 Change-Id: I53a5f942af2a4428fe3548ba1856967632c2df9f
* Add some extra DCHECKS for debugging artQuickProxyInvokeHandlerBrian Carlstrom2013-08-201-3/+9
| | | | | Bug: 10094803 Change-Id: I8cc08cd54dbe67781a8264cf2ceb5dab24b78799
* Get PORTABLE + SMALL on x86.Dragos Sbirlea2013-08-151-5/+10
| | | | | | | | | Implemented the portable resolution trampoline and the portable to interpreter bridge. Also work on integrating SEA_IR in the PORTABLE+SMALL framework. Refactor some naming and correct indenting. Change-Id: Ibd97da5e5b6f5148274c9bff368e3654b661ef51
* Refactor java.lang.reflect implementationBrian Carlstrom2013-08-131-16/+16
| | | | | | | | | | | 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
* Entry point clean up.Ian Rogers2013-08-071-0/+558
Create set of entry points needed for image methods to avoid fix-up at load time: - interpreter - bridge to interpreter, bridge to compiled code - jni - dlsym lookup - quick - resolution and bridge to interpreter - portable - resolution and bridge to interpreter Fix JNI work around to use JNI work around argument rewriting code that'd been accidentally disabled. Remove abstact method error stub, use interpreter bridge instead. Consolidate trampoline (previously stub) generation in generic helper. Simplify trampolines to jump directly into assembly code, keeps stack crawlable. Dex: replace use of int with ThreadOffset for values that are thread offsets. Tidy entry point routines between interpreter, jni, quick and portable. Change-Id: I52a7c2bbb1b7e0ff8a3c3100b774212309d0828e