summaryrefslogtreecommitdiff
path: root/runtime/managed_stack.h
Commit message (Collapse)AuthorAgeFilesLines
* Do not create HandleScope for JNI transitions.Vladimir Marko2021-02-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously crated a HandleScope in the JNI transition frame to hold references passed as jobject (jclass, etc.) to the native function and these references were actually spilled twice during the transition. We now construct the jobject as a pointer to the reference spilled in the reserved out vreg area in the caller's frame. And the jclass for static methods is just a pointer to the method's declaring class. This reduces the amount of work required in the JNI transition, both on entry (in compiled stubs) and exit (in JniMethodEnd*). Some additional work is required when GC visits references of a native method as we need to walk over the method's shorty which was unnecessary for a HandleScope. Also fix Thread::InitStackHwm() to calculate correct stack size needed by the new Thread::IsJniTransitionReference(). The results for StringToBytesBenchmark on blueline little cores running at fixed frequency 1420800 are approximately arm64 (medians from 3 runs) before after timeGetBytesAscii EMPTY 447.33 436.86 timeGetBytesIso88591 EMPTY 440.52 431.13 timeGetBytesUtf8 EMPTY 432.31 409.82 arm (medians from 3 runs) before after timeGetBytesAscii EMPTY 500.53 490.87 timeGetBytesIso88591 EMPTY 496.45 495.30 timeGetBytesUtf8 EMPTY 488.84 472.68 Test: m test-art-host-gtest Test: testrunner.py --host Test: testrunner.py --host --gcstress Test: testrunner.py --host --jit-on-first-use Test: testrunner.py --host --jit-on-first-use --gcstress Test: run-gtests.sh Test: testrunner.py --target --optimizing Test: boots. Bug: 172332525 Change-Id: I658f9d87071587b3e89f31c65feca976a11e9cc2
* ART: Move to using locks.h instead of mutex.hAndreas Gampe2018-12-061-1/+1
| | | | | | | | When only annotating lock requirements, use locks.h. Bug: 119869270 Test: mmma art Change-Id: I1608b03254712feff0072ebad012c3af0cc3dda4
* Mark most *Offset helper functions as constexpr.David Srbecky2018-10-031-1/+1
| | | | | | | | Making the values compile-time constants will help to clean up the cpp-define-generator. Test: test.py -b -g Change-Id: I612a19a54062784b501bfe4f41c6642d48e0dd21
* ART: Replace base/logging with android-base/loggingAndreas Gampe2017-12-071-1/+2
| | | | | | | | | 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
* Revert^4 "JIT JNI stubs."Vladimir Marko2017-11-301-7/+73
| | | | | | | | | | | | | | | | | | | | The original CL, https://android-review.googlesource.com/513417 , has a bug fixed in the Revert^2, https://android-review.googlesource.com/550579 , and this Revert^4 adds two more fixes: - fix obsolete native method getting interpreter entrypoint in 980-redefine-object, - fix random JIT GC flakiness in 667-jit-jni-stub. Test: testrunner.py --host --prebuild --no-relocate \ --no-image --jit -t 980-redefine-object Bug: 65574695 Bug: 69843562 This reverts commit 056d7756152bb3ced81dd57781be5028428ce2bd. Change-Id: Ic778686168b90e29816fd526e23141dcbe5ea880
* Revert "Revert "Revert "JIT JNI stubs."""Nicolas Geoffray2017-11-301-73/+7
| | | | | | | | | | | Still seeing occasional failures on 667-jit-jni-stub Bug: 65574695 Bug: 69843562 This reverts commit e7441631a11e2e07ce863255a59ee4de29c6a56f. Change-Id: I3db751679ef7bdf31c933208aaffe4fac749a14b
* Revert "Revert "JIT JNI stubs.""Vladimir Marko2017-11-291-7/+73
| | | | | | | | | | | | | | | | | | | | | | | | The original CL, https://android-review.googlesource.com/513417 , had a bug for class unloading where a read barrier was executed at the wrong time from ConcurrentCopying::MarkingPhase() -> ClassLinker::CleanupClassLoaders() -> ClassLinker::DeleteClassLoader() -> JitCodeCache::RemoveMethodsIn() -> JitCodeCache::JniStubKey::UpdateShorty() -> ArtMethod::GetShorty(). This has been fixed by removing sources of the read barrier from ArtMethod::GetShorty(). Test: testrunner.py --host --prebuild --jit --no-relocate \ --no-image -t 998-redefine-use-after-free Bug: 65574695 Bug: 69843562 This reverts commit 47d31853e16a95393d760e6be2ffeeb0193f94a1. Change-Id: I06e7a15b09d9ff11cde15a7d1529644bfeca15e0
* Revert "JIT JNI stubs."Vladimir Marko2017-11-281-73/+7
| | | | | | | | | | | | Seems to break 998-redefine-use-after-free in some --no-image configuration. Bug: 65574695 Bug: 69843562 This reverts commit 3417eaefe4e714c489a6fb0cb89b4810d81bdf4d. Change-Id: I2dd157b931c17c791522ea2544c1982ed3519b86
* JIT JNI stubs.Vladimir Marko2017-11-281-7/+73
| | | | | | | | | | | | | Allow the JIT compiler to compile JNI stubs and make sure they can be collected once they are not in use anymore. Test: 667-jit-jni-stub Test: Pixel 2 XL boots. Test: m test-art-host-gtest Test: testrunner.py --host --jit Test: testrunner.py --target --jit Bug: 65574695 Change-Id: Idf81f50bcfa68c0c403ad2b49058be62b21b7b1f
* ART: Include cleanupAndreas Gampe2017-07-241-1/+1
| | | | | | | | | | | | | | | | | | | Let clang-format reorder the header includes. Derived with: * .clang-format: BasedOnStyle: Google IncludeIsMainRegex: '(_test|-inl)?$' * Steps: find . -name '*.cc' -o -name '*.h' | xargs sed -i.bak -e 's/^#include/ #include/' ; git commit -a -m 'ART: Include cleanup' git-clang-format -style=file HEAD^ manual inspection git commit -a --amend Test: mmma art Change-Id: Ia963a8ce3ce5f96b5e78acd587e26908c7a70d02
* ART: Clean up thread.h and thread_list.hAndreas Gampe2017-06-011-0/+107
Remove dependency on stack.h and gc_root.h. Remove unused object callbacks include. Factor out ManagedStack into its own set of files. Fix up users of transitive includes. Test: m test-art-host Change-Id: I01286c43d8c7710948c161b1348faabb05922e59