summaryrefslogtreecommitdiffstats
path: root/runtime/stack.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "64bit changes to the stack walker for the Quick ABI."Nicolas Geoffray2014-04-221-6/+5
| | | | | | This reverts commit 5cb328362a633302ca0fcdbaa0da7d94069df051. Change-Id: Icc0ec1a9f15c2e4e9103e732d7ba75a4feb853b1
* 64bit changes to the stack walker for the Quick ABI.Nicolas Geoffray2014-04-181-5/+6
| | | | | | | - Spill registers have different sizes. - The ArtMethod at the bottom of the stack is always of kWordSize. Change-Id: I92f67ff928477970c393c7146980255d08e8e6af
* Implement implicit stack overflow checksDave Allison2014-03-311-0/+8
| | | | | | | | | | | | | This also fixes some failing run tests due to missing null pointer markers. The implementation of the implicit stack overflow checks introduces the ability to have a gap in the stack that is skipped during stack walk backs. This gap is protected against read/write and is used to trigger a SIGSEGV at function entry if the stack will overflow. Change-Id: I0c3e214c8b87dc250cf886472c6d327b5d58653e
* Implicit null/suspend checks (oat version bump)Dave Allison2014-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ability to use SEGV signals to throw NullPointerException exceptions from Java code rather than having the compiler generate explicit comparisons and branches. It does this by using sigaction to trap SIGSEGV and when triggered makes sure it's in compiled code and if so, sets the return address to the entry point to throw the exception. It also uses this signal mechanism to determine whether to check for thread suspension. Instead of the compiler generating calls to a function to check for threads being suspended, the compiler will now load indirect via an address in the TLS area. To trigger a suspend, the contents of this address are changed from something valid to 0. A SIGSEGV will occur and the handler will check for a valid instruction pattern before invoking the thread suspension check code. If a user program taps SIGSEGV it will prevent our signal handler working. This will cause a failure in the runtime. There are two signal handlers at present. You can control them individually using the flags -implicit-checks: on the runtime command line. This takes a string parameter, a comma separated set of strings. Each can be one of: none switch off null null pointer checks suspend suspend checks all all checks So to switch only suspend checks on, pass: -implicit-checks:suspend There is also -explicit-checks to provide the reverse once we change the default. For dalvikvm, pass --runtime-arg -implicit-checks:foo,bar The default is -implicit-checks:none There is also a property 'dalvik.vm.implicit_checks' whose value is the same string as the command option. The default is 'none'. For example to switch on null checks using the option: setprop dalvik.vm.implicit_checks null It only works for ARM right now. Bumps OAT version number due to change to Thread offsets. Bug: 13121132 Change-Id: If743849138162f3c7c44a523247e413785677370
* Generic JNI implementation for x86_64Andreas Gampe2014-03-051-1/+1
| | | | | | | | 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
* Fix and optimize verify object.Mathieu Chartier2014-02-211-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VerifyObject no longer resides in heap. You can now enable VerifyObject for non-debug builds. VerifyStack is still slow, so it is now guarded by its own flag. Fixed the image writer to not use verification at places where verification fails due to invalid reads. Fixed RosAlloc to use SizeOf which doesn't call verify object. Added a flag paremeter to some of the mirror getters / setters to be able to selectively disable VerifyObject on certain calls. Optimized the GC to not verify each object multiple times during object scanning if verify object is enabled. Added 3 verification options: verify reads, verify this, and verify writes so that you can select how much verification you want for mirror getters and setters. Removed some useless DCHECKs which would slow debug builds without providing any benefits. TODO: RosAlloc verification doesn't currently work with verify objects. Bug: 12934910 Bug: 12879358 Change-Id: Ic61033104dfc334543f89b0fc0ad8cd4f4015d69
* Change root visitor to use Object**.Mathieu Chartier2014-02-181-0/+1
| | | | | | | Simplifies code and improves the performance of root visiting since we usually don't need to check to see if the object moved. Change-Id: Iba998f5a15ae1fa1b53ca5226dd2168a411196cf
* GenSpecialCase support for x86Razvan A Lupusoru2014-02-131-1/+7
| | | | | | | | Moved GenSpecialCase from being ARM specific to common code to allow it to be used by x86 quick as well. Change-Id: I728733e8f4c4da99af6091ef77e5c76ae0fee850 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
* Object model changes to support 64bit.Ian Rogers2014-02-061-41/+58
| | | | | | | | | | | | | | | | | | | | | | | 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 compiler temporariesRazvan A Lupusoru2014-01-311-12/+75
| | | | | | | | | | | | | | | | | | | | | | | Compiler temporaries are a facility for having virtual register sized space for dealing with intermediate values during MIR transformations. They receive explicit space in managed frames so they can have a home location in case they need to be spilled. The facility also supports "special" temporaries which have specific semantic purpose and their location in frame must be tracked. The compiler temporaries are treated in the same way as virtual registers so that the MIR level transformations do not need to have special logic. However, generated code needs to know stack layout so that it can distinguish between home locations. MIRGraph has received an interface for dealing with compiler temporaries. This interface allows allocation of wide and non-wide virtual register temporaries. The information about how temporaries are kept on stack has been moved to stack.h. This is was necessary because stack layout is dependent on where the temporaries are placed. Change-Id: Iba5cf095b32feb00d3f648db112a00209c8e5f55 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
* Cleanup invoke's receiver handling in interpreter.Sebastien Hertz2013-12-171-1/+1
| | | | | | | | | | | | | | | | | | To comply with a moving collector, we used to load invoke's receiver (for non static methods only) from the caller shadow frame after resolving the method itself (in case the garbage collector is triggered inside) but before passing invoke arguments, including loading receiver from the caller's shadow frame into the callee's shadow frame. Therefore, we used to load the receiver 3 times in the fast path but only twice in the slow path. The slow path is rarely used (only in method requiring extra runtime checks) so we now move this extra reload to the slow path. Therefore an invoke using the fast path loads the receiver twice while the slow path loads it 3 times. I don't expect much improvement here. The main reason is to keep extra code in the slow path. Change-Id: I10e96b10de4b8c2992e276bd564bc3e2f191779c
* Compacting collector.Mathieu Chartier2013-11-111-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing references.Sebastien Hertz2013-10-091-1/+1
| | | | | | This mainly avoids implicit copies when extracting an object from a container. Change-Id: If4d0e6153e8c2b48345fde5bb546b4c65649fcf3
* Cleanup invoke in interpreter.Sebastien Hertz2013-09-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | Some cleanup in invocation stuff: - Get the number of invoke arguments from instruction (vA) rather than get it from its code item. This benefits to native invoke since we no longer need to parse the method's shorty. Also pass the low 16 bits of instructions to avoid fetching it twice when reading vA. - Remove "is_static" tests by taking advantage of invoke type template argument rather than testing method's access flags. - Ensure Instruction::GetArgs is inlined. - Check exception when initializing method's class when transitioning from interpreter to compiled code (artInterpreterToCompiledCodeBridge). - Move UnstartedRuntimeInvoke function to interpreter_common.cc and make it static as it's only used by DoInvoke and DoInvokeVirtualQuick functions. - Avoid duplicating code in ShadowFrame::Create. Performance remains the same according to benchmarks. Hopefully, this should be addressed in next CLs, especially by improving new shadow frame initialization. Bug: 10668955 Change-Id: I514b8f098d0ef3e35921ceb770383aac1a9c7902
* am e47637cc: 4-byte align 64-bit values in Get/Set Double/Long for GCC 4.8.Jeff Hao2013-09-191-4/+12
|\ | | | | | | | | * commit 'e47637cc7c96e654d2c340e6006c232c8078673b': 4-byte align 64-bit values in Get/Set Double/Long for GCC 4.8.
| * 4-byte align 64-bit values in Get/Set Double/Long for GCC 4.8.Jeff Hao2013-09-191-4/+12
| | | | | | | | | | Bug: 10837416 Change-Id: Ibb562407d81c2085666ae8824e7570f22e56eaa7
* | Add support for changing roots through the root visitor callback.Mathieu Chartier2013-09-131-3/+9
|/ | | | | | Needed for copying collectors. Change-Id: Icc4a342a57e0cfb79587edb02ef8c85e08808877
* 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
* Uleb128 compression of vmap and mapping table.Ian Rogers2013-08-091-72/+0
| | | | | | Bug 9437697. Change-Id: I30bcb97d12cd8b46d3b2cdcbdd358f08fbb9947a
* Move assembler out of runtime into compiler/utils.Ian Rogers2013-07-291-1/+1
| | | | | | | Other directory layout bits of clean up. There is still work to separate quick and portable in some files (e.g. argument visitor, proxy..). Change-Id: If8fecffda8ba5c4c47a035f0c622c538c6b58351
* Fix cpplint whitespace/comments issuesBrian Carlstrom2013-07-261-3/+3
| | | | Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
* Fix cpplint whitespace/blank_line issuesBrian Carlstrom2013-07-181-1/+2
| | | | Change-Id: Ice937e95e23dd622c17054551d4ae4cebd0ef8a2
* Fix multiple inclusion guards to match new pathnamesBrian Carlstrom2013-07-171-3/+3
| | | | Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-0/+647
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