summaryrefslogtreecommitdiffstats
path: root/runtime/entrypoints/portable
Commit message (Collapse)AuthorAgeFilesLines
* Allow mixing of thread offsets between 32 and 64bit architectures.Ian Rogers2014-04-011-3/+2
| | | | | | | Begin a more full implementation x86-64 REX prefixes. Doesn't implement 64bit thread offset support for the JNI compiler. Change-Id: If9af2f08a1833c21ddb4b4077f9b03add1a05147
* AArch64: Add arm64 runtime support.Stuart Monteith2014-03-191-1/+2
| | | | | | | | | 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
* Enable annotalysis on clang ART builds.Ian Rogers2014-03-062-6/+8
| | | | | | | | | | | Fix clang build errors aswell as restructure locking/mutex code for correct thread safety analysis support. Reorder make dependencies so that host builds build first as they should provide better compilation errors than target. Remove host's use of -fno-omit-frame-pointer as it has no value with correct use of CFI, which we should have. Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
* Remove blacklistSebastien Hertz2014-02-171-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Object model changes to support 64bit.Ian Rogers2014-02-066-31/+35
| | | | | | | | | | | | | | | | | | | | | | | 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
* Background compaction support.Mathieu Chartier2014-01-081-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the process state changes to a state which does not perceives jank, we copy from the main free-list backed allocation space to the bump pointer space and enable the semispace allocator. When we transition back to foreground, we copy back to a free-list backed space. Create a seperate non-moving space which only holds non-movable objects. This enables us to quickly wipe the current alloc space (DlMalloc / RosAlloc) when we transition to background. Added multiple alloc space support to the sticky mark sweep GC. Added a -XX:BackgroundGC option which lets you specify which GC to use for background apps. Passing in -XX:BackgroundGC=SS makes the heap compact the heap for apps which do not perceive jank. Results: Simple background foreground test: 0. Reboot phone, unlock. 1. Open browser, click on home. 2. Open calculator, click on home. 3. Open calendar, click on home. 4. Open camera, click on home. 5. Open clock, click on home. 6. adb shell dumpsys meminfo PSS Normal ART: Sample 1: 88468 kB: Dalvik 3188 kB: Dalvik Other Sample 2: 81125 kB: Dalvik 3080 kB: Dalvik Other PSS Dalvik: Total PSS by category: Sample 1: 81033 kB: Dalvik 27787 kB: Dalvik Other Sample 2: 81901 kB: Dalvik 28869 kB: Dalvik Other PSS ART + Background Compaction: Sample 1: 71014 kB: Dalvik 1412 kB: Dalvik Other Sample 2: 73859 kB: Dalvik 1400 kB: Dalvik Other Dalvik other reduction can be explained by less deep allocation stacks / less live bitmaps / less dirty cards. TODO improvements: Recycle mem-maps which are unused in the current state. Not hardcode 64 MB capacity of non movable space (avoid returning linear alloc nightmares). Figure out ways to deal with low virtual address memory problems. Bug: 8981901 Change-Id: Ib235d03f45548ffc08a06b8ae57bf5bada49d6f3
* Don't rely on gcc extensionsBernhard Rosenkränzer2013-12-121-8/+8
| | | | | | | | | | | | | | Make the code more compatible with different compilers. clang doesn't allow extra static qualifiers on template specializations, const qualifiers on function types, or inline attributes on lambda functions, and is more picky about casting away constness with reinterpret_cast. These modifications are compatible with both gcc and clang. Change-Id: I739b10df2780bec537827a13679fd2bcc2cc7188 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
* 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
* Don't prefix GC map by length.Vladimir Marko2013-12-101-5/+1
| | | | | Bug: 11767815 Change-Id: I063917aefdf7674ee1a77736db059c9ee95ea075
* Fix a libartd.so boot crash in Heap::AllocObjectWithAllocator()Hiroshi Yamauchi2013-11-211-4/+4
| | | | | Bug: 11806947 Change-Id: I826875f23ee2233d4128e852ff6fe7e26ced378f
* Refactor allocation entrypoints.Mathieu Chartier2013-11-201-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for switching entrypoints during runtime. Enables addition of new allocators with out requiring significant copy paste. Slight speedup on ritzperf probably due to more inlining. TODO: Ensuring that the entire allocation path is inlined so that the switch statement in the allocation code is optimized out. Rosalloc measurements: 4583 4453 4439 4434 4751 After change: 4184 4287 4131 4335 4097 Change-Id: I1352a3cbcdf6dae93921582726324d91312df5c9
* Implement Interface Method Tables (IMT).Jeff Hao2013-10-291-0/+1
| | | | Change-Id: Idf7fe85e1293453a8ad862ff2380dcd5db4e3a39
* Inline field and method resolution.Sebastien Hertz2013-10-282-52/+56
| | | | | | | | | | | | | | | According to profiling results, field and method resolutions are hot points during interpreter execution. This CL attempts to speed up these resolutions. Forces aggressive inlining of FindFieldFromCode and FindMethodFromCode. This allows to reduce the overhead of access check code when the interpreter runs without these checks. Templatize these functions to optimize inlining and their callers. Also spread the use of C++11 "nullptr" in place of "NULL" in field access and invoke helpers. Change-Id: Ic1a69834d8975b2cddcddaae32f08a7de146a951
* Get PORTABLE + SMALL on x86.Dragos Sbirlea2013-08-151-2/+4
| | | | | | | | | 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-1310-75/+75
| | | | | | | | | | | 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
* Work on SMALL_ART and PORTABLE working at the same time.Dragos Sbirlea2013-08-134-390/+433
| | | | Change-Id: Iddedf63b6f9d908717a4d30f963e9b81a9604d49
* Entry point clean up.Ian Rogers2013-08-071-4/+4
| | | | | | | | | | | | | | | | | | 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
* Clear exception when no move-exception on portable.Ian Rogers2013-07-311-0/+6
| | | | Change-Id: I36c523e479c7dc6f752b7240f4334e1e5e417190
* Portable refactorings.Ian Rogers2013-07-3014-0/+1366
Separate quick from portable entrypoints. Move architectural dependencies into arch. Change-Id: I9adbc0a9782e2959fdc3308215f01e3107632b7c