summaryrefslogtreecommitdiffstats
path: root/runtime/asm_support.h
Commit message (Collapse)AuthorAgeFilesLines
* ART: Refactor Thread::InitAndreas Gampe2015-06-031-2/+2
| | | | | | | | | | This refactor allows the parent thread to allocate the JNIEnvExt for the child (with a fallback in place in Init). This allows to throw an OOME in CreateNativeThread instead of aborting in the child. Bug: 21291279 Change-Id: Iccc1a5c202999f5bfacec706d9833e53135ba2fa
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-021-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 (cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33) Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d Fix some ArtMethod related bugs Added root visiting for runtime methods, not currently required since the GcRoots in these methods are null. Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes --trace run-tests 005, 044. Fixed optimizing compiler bug where we used a normal stack location instead of double on ARM64, this fixes the debuggable tests. TODO: Fix JDWP tests. Bug: 19264997 Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3 ART: Fix casts for 64-bit pointers on 32-bit compiler. Bug: 19264997 Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457 Fix JDWP tests after ArtMethod change Fixes Throwable::GetStackDepth for exception event detection after internal stack trace representation change. Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of proxy method. Bug: 19264997 Change-Id: I363e293796848c3ec491c963813f62d868da44d2 Fix accidental IMT and root marking regression Was always using the conflict trampoline. Also included fix for regression in GC time caused by extra roots. Most of the regression was IMT. Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to detached thread. EvaluateAndApplyChanges: From ~2500 -> ~1980 GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots Bug: 19264997 Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0 Fix bogus image test assert Previously we were comparing the size of the non moving space to size of the image file. Now we properly compare the size of the image space against the size of the image file. Bug: 19264997 Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a [MIPS64] Fix art_quick_invoke_stub argument offsets. ArtMethod reference's size got bigger, so we need to move other args and leave enough space for ArtMethod* and 'this' pointer. This fixes mips64 boot. Bug: 19264997 Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
* Merge "Insert a read barrier in the JNI bridge."Hiroshi Yamauchi2015-05-111-1/+1
|\
| * Insert a read barrier in the JNI bridge.Hiroshi Yamauchi2015-05-071-1/+1
| | | | | | | | | | | | Bug: 20720510 Bug: 12687968 Change-Id: Ia9edb614853bad45ec25d6e2142361a8bda1eccf
* | JDWP: properly combine location eventsSebastien Hertz2015-04-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL properly groups JDWP events at the same location: Breakpoint, Single-step, Method Entry and Method Exit. This is necessary if the debugger is not the only instrumentation listener. This matches the behavior of Dalvik, especially for methods with a single return instruction. The interpreter was tuned so the instrumentation callbacks were called to satisfy the debugger with the idea the debugger was the only instrumentation listener. This is not true when method tracing is enabled at the same time. When tracing is enabled, there is always a listener for MethodEntry and MethodExit events (art::Trace class). However, if the debugger is only listening to DexPcMoved event (to manage JDWP Breakpoint event), it will not be notified of this event. We now properly call all the instrumentation callbacks in the interpreter and move the logic specific to debugging into the class DebugInstrumentationListener. This allows to properly group JDWP location events together depending on the sequence of instrumentation callbacks. We add Thread::tls_32bit_sized_values::debug_method_entry_ flag to remember we just entered a method. It replaces the local variable notified_method_entry_event in the interpreter and simplifies the code. Bump oat version to force recompilation because the layout of the Thread class is modified. Bug: 19829329 Change-Id: I204af9112e37d2eebc86661fb7c961a41c74e598
* Merge "Replace String CharArray with internal uint16_t array."Jeff Hao2015-04-281-7/+4
|\
| * Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-271-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
* | Use the lock word bits for Baker-style read barrier.Hiroshi Yamauchi2015-04-231-1/+1
|/ | | | | | | | | | This enables the standard object header to be used with the Baker-style read barrier. Bug: 19355854 Bug: 12687968 Change-Id: Ie552b6e1dfe30e96cb1d0895bd0dff25f9d7d015
* ARM64: Remove suspend register.Zheng Xu2015-04-141-2/+2
| | | | | | | | It also clean up build/remove frame used by JNI compiler and generates stp/ldp instead of str/ldr. Also x19 has been unblocked in both quick and optimizing compiler. Change-Id: Idbeac0942265f493266b2ef9b7a65bb4054f0e2d
* Move ArtField to nativeMathieu Chartier2015-04-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
* Refactor and improve GC root handlingMathieu Chartier2015-04-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | Changed GcRoot to use compressed references. Changed root visiting to use virtual functions instead of function pointers. Changed root visting interface to be an array of roots instead of a single root at a time. Added buffered root marking helper to avoid dispatch overhead. Root marking seems a bit faster on EvaluateAndApplyChanges due to batch marking. Pause times unaffected. Mips64 is untested but might work, maybe. Before: MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us After: MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us Bug: 19264997 Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
* Revert "Revert "Deoptimization-based bce.""Mingyao Yang2015-04-011-1/+1
| | | | | | This reverts commit 0ba627337274ccfb8c9cb9bf23fffb1e1b9d1430. Change-Id: I1ca10d15bbb49897a0cf541ab160431ec180a006
* Revert "Deoptimization-based bce."Andreas Gampe2015-03-241-1/+1
| | | | | | | | | | This breaks compiling the core image: Error after BCE: art::SSAChecker: Instruction 219 in block 1 does not dominate use 221 in block 1. This reverts commit e295e6ec5beaea31be5d7d3c996cd8cfa2053129. Change-Id: Ieeb48797d451836ed506ccb940872f1443942e4e
* Deoptimization-based bce.Mingyao Yang2015-03-231-1/+1
| | | | | | | | | | | | | | | | | | | A mechanism is introduced that a runtime method can be called from code compiled with optimizing compiler to deoptimize into interpreter. This can be used to establish invariants in the managed code If the invariant does not hold at runtime, we will deoptimize and continue execution in the interpreter. This allows to optimize the managed code as if the invariant was proven during compile time. However, the exception will be thrown according to the semantics demanded by the spec. The invariant and optimization included in this patch are based on the length of an array. Given a set of array accesses with constant indices {c1, ..., cn}, we can optimize away all bounds checks iff all 0 <= min(ci) and max(ci) < array-length. The first can be proven statically. The second can be established with a deoptimization-based invariant. This replaces n bounds checks with one invariant check (plus slow-path code). Change-Id: I8c6e34b56c85d25b91074832d13dba1db0a81569
* Assembly TLAB allocation fast path for x86_64.Hiroshi Yamauchi2015-03-201-0/+41
| | | | | | | TODO: resolved/initialized cases, other architectures. Bug: 9986565 Change-Id: If6df3449a3b2f5074d11babdda0fd2791fd54946
* am ff3ef43f: Merge "Reserve bits in the lock word for read barriers."Hiroshi Yamauchi2015-03-041-0/+22
|\ | | | | | | | | * commit 'ff3ef43f3d0f0986fe23286af028b352277b6e1e': Reserve bits in the lock word for read barriers.
| * Reserve bits in the lock word for read barriers.Hiroshi Yamauchi2015-03-031-0/+22
| | | | | | | | | | | | | | | | | | This prepares for the CC collector to use the standard object header model by storing the read barrier state in the lock word. Bug: 19355854 Bug: 12687968 Change-Id: Ia7585662dd2cebf0479a3e74f734afe5059fb70f
* | am caea3fe2: am 55037f18: Merge "Remove portable."Elliott Hughes2014-12-121-8/+0
|\ \ | |/ | | | | | | * commit 'caea3fe21a47e20247bb3ba232fae525b530fc63': Remove portable.
| * Remove portable.Elliott Hughes2014-12-121-8/+0
| | | | | | | | Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
* | am e5fc7729: am 220526b0: Merge "Move dexCacheStrings from ArtMethod to Class"Mathieu Chartier2014-11-261-2/+2
|\ \ | |/ | | | | | | * commit 'e5fc77292c860984cb19d0155dfa3820b0177f3e': Move dexCacheStrings from ArtMethod to Class
| * Move dexCacheStrings from ArtMethod to ClassMathieu Chartier2014-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Adds one load for const strings which are not direct. Saves >= 60KB of memory avg per app. Image size: -350KB. Bug: 17643507 Change-Id: I2d1a3253d9de09682be9bc6b420a29513d592cc8 (cherry picked from commit f521f423b66e952f746885dd9f6cf8ef2788955d)
* | am d3ff02e6: am 385f00f8: Merge "Delete ArtMethod gc_map_ field"Mathieu Chartier2014-11-251-2/+2
|\ \ | |/ | | | | | | * commit 'd3ff02e6083a81ae3d119853b13369371a10d4cf': Delete ArtMethod gc_map_ field
| * Delete ArtMethod gc_map_ fieldMathieu Chartier2014-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | Moved the gc_map field from OatMethod to OatQuickMethodHeader. Deleted the ArtMethod gc_map_ field. Bug: 17643507 Change-Id: Ifa0470c3e4c2f8a319744464d94c6838b76b3d48 (cherry picked from commit 807140048f82a2b87ee5bcf337f23b6a3d1d5269)
* | am bcc68d93: am f90866a4: Merge "Change 64 bit ArtMethod fields to be ↵Mathieu Chartier2014-11-181-6/+14
|\ \ | |/ | | | | | | | | | | pointer sized" * commit 'bcc68d932e70941c1f6ef9a6dab344ba08ecd044': Change 64 bit ArtMethod fields to be pointer sized
| * Change 64 bit ArtMethod fields to be pointer sizedMathieu Chartier2014-11-181-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the 64 bit entrypoint and gc map fields in ArtMethod to be pointer sized. This saves a large amount of memory on 32 bit systems. Reduces ArtMethod size by 16 bytes on 32 bit. Total number of ArtMethod on low memory mako: 169957 Image size: 49203 methods -> 787248 image size reduction. Zygote space size: 1070 methods -> 17120 size reduction. App methods: ~120k -> 2 MB savings. Savings per app on low memory mako: 125K+ per app (less active apps -> more image methods per app). Savings depend on how often the shared methods are on dirty pages vs shared. TODO in another CL, delete gc map field from ArtMethod since we should be able to get it from the Oat method header. Bug: 17643507 Change-Id: Ie9508f05907a9f693882d4d32a564460bf273ee8 (cherry picked from commit e832e64a7e82d7f72aedbd7d798fb929d458ee8f)
* | resolved conflicts for merge of 9f2a2259 to lmp-mr1-dev-plus-aospbuzbee2014-11-111-1/+1
|\ \ | |/ |/| | | Change-Id: I1aa72203e0a24250b78e7af866d1961ecd272472
| * Reduce suspend check thresholdbuzbee2014-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | The Quick compiler uses a dedicated count-down register (r4) to reduce the cost of checking for suspend requests. In order to reduce suspend latency, this CL reduces the countdown value from 1000 to 96. See bug 17953517 for more discussion. Change-Id: I88b92016b869f57be83e9bded88dbe42e2ee760d
| * DO NOT MERGE. Only have a portable entrypoint in portable builds.Ian Rogers2014-09-181-2/+7
| | | | | | | | | | | | Bug: 16214885 Change-Id: Iff7b7415efdbdabd7e6020e221a540f6a774c852
* | Refactor quick entrypointsIan Rogers2014-10-201-33/+124
| | | | | | | | | | | | | | | | | | | | | | Remove FinishCalleeSaveFrameSetup. Assembly routines write down anchor into TLS as well as placing runtime method in callee save frame. Simplify artSet64InstanceFromCode by not computing the referrer from the stack in the C++ code. Move assembly offset tests next to constant declaration and tidy arch_test. Change-Id: Iededeebc05e54a1e2bb7bb3572b8ba012cffa1c8
* | Revert "Adjust the suspend check interval to 16."Ian Rogers2014-10-131-1/+1
| | | | | | | | | | | | This reverts commit dc0f40e484dc4bf72032f6d9f1c5db694c6fad55. Change-Id: I4dd1acf2adfc49b03bac9c9fbd0ea3deebbd054e
* | Adjust the suspend check interval to 16.Hiroshi Yamauchi2014-10-131-1/+1
|/ | | | | Bug: 17953517 Change-Id: I4145f65a79f382f9f807df071f996ffdb60ac4a5
* Insert an empty read barrier call.Hiroshi Yamauchi2014-04-031-1/+1
| | | | | Bug: 12687968 Change-Id: Ie1d28658e16e09f6a983cb5c1f0d5b375b7ae069
* Make the support code for read barriers a bit more general.Hiroshi Yamauchi2014-03-311-2/+2
| | | | | | | Add an option for Baker in addition to Brooks. Bug: 12687968 Change-Id: I8a31db817ff6686c72951b6534f588228e270b11
* (Experimental) Add Brooks pointers.Hiroshi Yamauchi2014-02-251-0/+26
| | | | | | | | | This feature is disabled by default. Verified that the Brooks pointers are installed correctly by using the CMS/SS collectors. Change-Id: Ia9be9814ab6e29169ac85edc4792ce8c81d552a9
* Object model changes to support 64bit.Ian Rogers2014-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* Remove intialized static storage from dex cache.Ian Rogers2014-01-081-2/+2
| | | | | | | | | The initialized static storage array is used by compiled code to determine if for a sget/sput class initialization is necessary. The compiled code typically doesn't require this test as the class is pre-initialized or the class being accessed is the same as the current method. Change-Id: Icbc45e692b3d0ac61e559e69edb6c9b29439e571
* Implement Interface Method Tables (IMT).Jeff Hao2013-10-291-1/+2
| | | | Change-Id: Idf7fe85e1293453a8ad862ff2380dcd5db4e3a39
* Improve quick codegen for aput-object.Ian Rogers2013-10-081-0/+8
| | | | | | | | | | | | | | | 1) don't type check known null. 2) if we know types in verify don't check at runtime. 3) if we're runtime checking then move all the code out-of-line. Also, don't set up a callee-save frame for check-cast, do an instance-of test then throw an exception if that fails. Tidy quick entry point of Ldivmod to Lmod which it is on x86 and mips. Fix monitor-enter/exit NPE for MIPS. Fix benign bug in mirror::Class::CannotBeAssignedFromOtherTypes, a byte[] cannot be assigned to from other types. Change-Id: I9cb3859ec70cca71ed79331ec8df5bec969d6745
* Inflate contended lock word by suspending owner.Ian Rogers2013-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | Bug 6961405. Don't inflate monitors for Notify and NotifyAll. Tidy lock word, handle recursive lock case alongside unlocked case and move assembly out of line (except for ARM quick). Also handle null in out-of-line assembly as the test is quick and the enter/exit code is already a safepoint. To gain ownership of a monitor on behalf of another thread, monitor contenders must not hold the monitor_lock_, so they wait on a condition variable. Reduce size of per mutex contention log. Be consistent in calling thin lock thread ids just thread ids. Fix potential thread death races caused by the use of FindThreadByThreadId, make it invariant that returned threads are either self or suspended now. Code size reduction on ARM boot.oat 0.2%. Old nexus 7 speedup 0.25%, new nexus 7 speedup 1.4%, nexus 10 speedup 2.24%, nexus 4 speedup 2.09% on DeltaBlue. Change-Id: Id52558b914f160d9c8578fdd7fc8199a9598576a
* Portable refactorings.Ian Rogers2013-07-301-25/+0
| | | | | | | Separate quick from portable entrypoints. Move architectural dependencies into arch. Change-Id: I9adbc0a9782e2959fdc3308215f01e3107632b7c
* 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/+58
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