summaryrefslogtreecommitdiffstats
path: root/runtime/barrier.cc
Commit message (Collapse)AuthorAgeFilesLines
* ART: Clean up arm64 kNumberOfXRegisters usage.Vladimir Marko2015-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Avoid undefined behavior for arm64 stemming from 1u << 32 in loops with upper bound kNumberOfXRegisters. Create iterators for enumerating bits in an integer either from high to low or from low to high and use them for <arch>Context::FillCalleeSaves() on all architectures. Refactor runtime/utils.{h,cc} by moving all bit-fiddling functions to runtime/base/bit_utils.{h,cc} (together with the new bit iterators) and all time-related functions to runtime/base/time_utils.{h,cc}. Improve test coverage and fix some corner cases for the bit-fiddling functions. Bug: 13925192 (cherry picked from commit 80afd02024d20e60b197d3adfbb43cc303cf29e0) Change-Id: I905257a21de90b5860ebe1e39563758f721eab82
* Ensure inlined static calls perform clinit checks in Optimizing.Roland Levillain2015-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to static methods have implicit class initialization (clinit) checks of the method's declaring class in Optimizing. However, when such a static call is inlined, the implicit clinit check vanishes, possibly leading to an incorrect behavior. To ensure that inlining static methods does not change the behavior of a program, add explicit class initialization checks (art::HClinitCheck) as well as load class instructions (art::HLoadClass) as last input of static calls (art::HInvokeStaticOrDirect) in Optimizing' control flow graphs, when the declaring class is reachable and not known to be already initialized. Then when considering the inlining of a static method call, proceed only if the method has no implicit clinit check requirement. The added explicit clinit checks are already removed by the art::PrepareForRegisterAllocation visitor. This CL also extends this visitor to turn explicit clinit checks from static invokes into implicit ones after the inlining step, by removing the added art::HLoadClass nodes mentioned hereinbefore. Change-Id: I9ba452b8bd09ae1fdd9a3797ef556e3e7e19c651
* Make Barrier robust against spurious wakeupsHans Boehm2014-12-041-2/+13
| | | | | | | | | | | | | | | | | Fix Barrier implementation so that Wait cannot return prematurely due to a spurious condition variable wakeup or interrupted futex call. Document the resulting semantics of barrier.h, which are a bit surprising, but appear to be exactly what current clients need. Fix the test so that it actually passes with the fixed barrier.h, and no longer tests for properties that can't be correctly satisfied. Improve comment for InitTimeSpec, which we almost used. Bug:18509123 Change-Id: I0b25f33bcd22322ba04e3951cd484843788c2bf5
* Make thread dumping more tolerant of broken invariants during abort.Ian Rogers2014-11-041-1/+1
| | | | Change-Id: Ie1bc20debe72f2ea2bf4c1be50cd9877c823670a
* Compile time performance improvements focusing on interpret-only.Ian Rogers2014-09-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce virtual method dispatch in the method verifier and make more code inline-able. Add a StringPiece with const char* equality operator to avoid redundant StringPieces and strlens. Remove back link from register line to verifier and pass as argument to reduce size of RegisterLine. Remove instruction length from instruction flags and compute from the instruction, again to reduce size. Add suspend checks to resolve and verify to allow for more easy monitor inflation and reduce contention on Locks::thread_list_suspend_thread_lock_. Change ThrowEarlierClassFailure to throw pre-allocated exception. Avoid calls to Thread::Current() by passing self. Template specialize IsValidClassName. Make ANR reporting with SIGQUIT run using checkpoints rather than suspending all threads. This makes the stack/lock analysis less lock error prone. Extra Barrier assertions and condition variable time out is now returned as a boolean both from Barrier and ConditionVariable::Wait. 2 threaded host x86-64 interpret-only numbers from 341 samples: Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms After change: Avg 139.163% 99% CI 3.027ms to 838.257ms Reduction in average compile time after change is 20.9%. Slow-down without change is 26.5%. Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable could return unresolved type when class loading is disabled. Bug: 17398101 Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
* Add sampling profilerDave Allison2014-01-071-0/+16
| | | | | | | | | | This adds a sampling profiler thread that runs every so often, gathering profiling data and writing the results to a file in /data/data (specific to app running). The intention is to use these files as input to the compiler so that it can determine the best methods to compile. Bug: 11539952 Change-Id: I0bfbb4146fb7966673c792f017ffac8107b6272d
* Fix cpplint whitespace/blank_line issuesBrian Carlstrom2013-07-181-1/+1
| | | | Change-Id: Ice937e95e23dd622c17054551d4ae4cebd0ef8a2
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-0/+63
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