summaryrefslogtreecommitdiff
path: root/runtime/barrier.cc
AgeCommit message (Collapse)Author
2024-01-17Add visibility attributes in runtime/b* Dmitrii Ishcheikin
Bug: 260881207 Test: presubmit Test: abtd app_compat_drm Test: abtd app_compat_top_100 Test: abtd app_compat_banking Change-Id: I7cdd5c1b67996e2cf365ae1f959c704d3486ba97
2022-12-05Make native GC-root updation concurrent with userfaultfd Lokesh Gidra
Additionally also uses userfaultfd's minor-fault feature for moving space. Bug: 160737021 Test: ART_USE_READ_BARRIER=false art/test/testrunner/testrunner.py and module install Change-Id: I98b0c69fba4aec1263b1f38cc9f31494fd5c8cf5
2019-03-28Address comments for aog/934603 Mathieu Chartier
Test: TH Change-Id: I6b54cfbaa49d320c3c9e97ebaeeb97e285f9bf43
2019-03-28Stop verifying barrier count for thread dumping Mathieu Chartier
For ANRs, some threads may not pass through the barrier. Prevent a crash for this case. This behavior is consistent with checks in the dump code. Bug: 128490284 Test: test-art-host Change-Id: I5dc681d00c29d20755020c35a18fb9912cc08d57
2018-12-06ART: Hide Mutex & ConditionVariable in Barrier Andreas Gampe
Ensure that barrier.h does not pull in mutex.h Bug: 119869270 Test: m test-art-host Change-Id: I54ea467c92562ec912ea5b1705049eb23cda380e
2018-03-23Remove unneeded ScopedGCCriticalSections from openjdkjvmti. Alex Light
We used ScopedGCCriticalSections in many parts of the openjdkjvmti often unnecessarily. We removed a totally unneeded GCCriticalSection that was acquired when modifying the instrumentation listeners. We also removed RequestGCSafeSynchronousCheckpoint and the change to use GcRoots instead. We added RequestGCSafeSynchronousCheckpoint as a way to prevent the GC from running when we are doing some JVMTI operations on other threads. This could interact with running GCs in non-trivial ways, potentially causing deadlocks in some situations. This changes the code to instead use read-barriers and GcRoots to ensure that we do not read data from the wrong gc space. In order for this to work correctly we need to make sure that we are only ever reading the GcRoots from the thread that eventually needs the reference. This required some re-writing of the checkpoint closures since they would often just call AddLocalReference on non-local Thread objects. Changes to Thread::RequestSynchronousCheckpoint and art::Barrier were needed in order to allow this all to work since we needed to ensure that the requesting thread did not suspend as the checkpoint was being run. This is a partial revert of commit 7585b91bfc77b8. Bug: 67838964 Bug: 76003243 Test: use gapid Test: ./test.py --host -j50 Test: ./art/tools/run-libjdwp-tests.sh --mode=host Change-Id: I26d871089829639eccb973cecc315194f7bcf681
2017-12-07ART: Factor out gAborting Andreas Gampe
Cut dependencies on base/logging.h by moving gAborting to its own header. Leave the static storage in logging.cc. Test: m Change-Id: Ib2ca880e15f9cb50cb9aab803784826bb46efb5e
2017-12-07ART: Replace base/logging with android-base/logging Andreas Gampe
Replace wherever possible. ART's base/logging is now mainly VLOG and initialization code that is unnecessary to pull in and makes changes to verbose logging more painful than they have to be. Test: m test-art-host Change-Id: I3e3a4672ba5b621e57590a526c7d1c8b749e4f6e
2016-12-02Dump more debug info for b/33006388. Hiroshi Yamauchi
Bug: 33006388 Bug: 12687968 Test: test-art-host with CC. Change-Id: Id9d67bc603c6ff7bc8e346e181e3e09ffbda43b3
2015-06-22ART: Avoid recursive abort in barrier Andreas Gampe
Try to avoid recursive abort in barrier. May lead to a segfault instead of a nested abort in bad cases. Change-Id: I0e7976b77c243956dbcf81142bd5df81d5927ce0
2015-05-26ART: Clean up arm64 kNumberOfXRegisters usage. Vladimir Marko
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 Change-Id: I704884dab15b41ecf7a1c47d397ab1c3fc7ee0f7
2015-04-24Ensure inlined static calls perform clinit checks in Optimizing. Roland Levillain
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
2014-12-04Make Barrier robust against spurious wakeups Hans Boehm
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
2014-11-04Make thread dumping more tolerant of broken invariants during abort. Ian Rogers
Change-Id: Ie1bc20debe72f2ea2bf4c1be50cd9877c823670a
2014-09-12Compile time performance improvements focusing on interpret-only. Ian Rogers
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
2014-01-07Add sampling profiler Dave Allison
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
2013-07-18Fix cpplint whitespace/blank_line issues Brian Carlstrom
Change-Id: Ice937e95e23dd622c17054551d4ae4cebd0ef8a2
2013-07-12Create separate Android.mk for main build targets Brian Carlstrom
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