Age | Commit message (Collapse) | Author |
|
Bug: 260881207
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: I017173510501982607b7688b55ee27a0389abb3d
|
|
This patch is part of the chain preparing for making kPageSize
non-constexpr in a future patch.
The following values aren't always constexpr anymore - in some
configurations these are global dynamically initialized constants.
Rename them accordingly:
- kPageSize to gPageSize;
- kPMDSize to gPMDSize;
- kPUDSize to gPUDSize;
- kNumLrtSlots to gNumLrtSlots;
- kStackOverflowProtectedSize to gStackOverflowProtectedSize.
Also fix the typo in the kMininumMapSize identifier.
Test: Same as for I5430741a8494b340ed7fd2d8692c41a59ad9c530.
The whole patches chain was tested as a whole.
Change-Id: Ic8502aa66d75d2bbba698282a1eaf1a029b02d3a
|
|
This patch is part of the chain preparing for making kPageSize
non-constexpr in a future patch.
Since kPageSize is going to be a non-constexpr value, it can't be a
template parameter anymore. Consequently CHECK_ALIGNED(..., kPageSize),
expressions implemented via a template function IsAligned<>, have to be
replaced with CHECK_ALIGNED_PARAM(..., kPageSize).
Same is done for DCHECK_ALIGNED.
Test: Same as for I5430741a8494b340ed7fd2d8692c41a59ad9c530.
The whole patches chain was tested as a whole.
Change-Id: I0e634dab62f2b44d078d7199d5b5feab945077b9
|
|
This reverts commit 7911b464894dbfc580e5a8920a4d98eddb832e9e.
Reason for revert: Reland with a fix and a regression test.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 172332525
Bug: 276210372
Change-Id: I8109c8f3d13735606999859b82339c3513b0da9f
|
|
This reverts commit db18e88d8a9e2a45639c6fd25e91341dd3f32f07.
Reason for revert: Crashes seen on virtual x86_64 devices.
Bug: 172332525
Bug: 276210372
Change-Id: I50e47f45f60253a31d246e9f38e65ebf82da7765
|
|
Change `jobject` for local references to a `GcRoot<>*` with
a `kLocal` tag, so that decoding can be done by clearing the
tag and dereferencing. Optimize operations with CheckJNI
disabled and small local reference table.
Results for the timeGetBytesAscii#EMPTY benchmark from the
libcore's StringToBytesBenchmark suite on blueline-userdebug
with the cpu frequencies fixed at 1420800 (cpus 0-3; little)
and 1459200 (cpus 4-7; big):
32-bit little: ~450 -> ~415
64-bit little: ~455 -> ~415
32-bit big: ~200 -> ~180
64-bit big: ~200 -> ~180
This CL also opens an opportunity for inlining a fast-path
for local reference decoding to compiled JNI stubs for
methods that return a reference.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 172332525
Change-Id: Id6f2955419b966fd1ad860bace9c23947080f8ed
|
|
In preparation for rewriting the representation of local JNI
references, split their implementation out of the shared
`IndirectReferenceTable` which shall be used only for global
and weak global references going forward. Make the new
`LocalReferenceTable` always resizable (remove the enum
`ResizableCapacity`) and rename the memory mappings for LRT
to "local ref table".
Remove `IndirectReferenceTable` code that was needed only
for local references, make these tables non-resizable.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 172332525
Change-Id: I87f02c93694577d1b577c4114fa86c2cd23b4c97
|
|
And remove `IndirectReferenceTable::SynchronizedGet()`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 172332525
Change-Id: Ice599b33f4d494fccc0efd3b3a3574e930088f89
|
|
Move weak global sweeping to the IRT class and clean up the
entry visiting to avoid the need for the `IrtIterator`.
Move `JNIEnvExt::UpdateLocal` to the `jni_env_ext-inl.h`
because it requires `indirect_reference_table-inl.h`.
Test: m test-art-host-gtest
Test: tesrunner.py --host --optimizing
Bug: 172332525
Change-Id: Ia96d31e0d8d701c93d7752bf76f633719a836f3f
|
|
Split the parts that can fail to a separate function.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 172332525
Change-Id: I95200a31cc757e4593d9cc7f956dd4d5ef624f92
|
|
This makes EnsureLocalCapacity(0) and PushLocalFrame(0) correct,
which we believe is the spec intent.
Also simplify test for ridiculously large argument.
Bug: 230854166
Test: Build and boot AOSP
Change-Id: Id4bb3b6bb2f52ff0c3e78f13326405dac06de730
|
|
It can be acquired after Class loader classes lock. Jvmti
GetLoadedClasses traverses classes with a visitor that may need
to allocate a LocalRef.
Bug: 184847225
Test: Build and boot AOSP
Change-Id: Ic19b2a3238321bc21440064f0d1b531ed254ea35
|
|
Introduce a separate small object allocator to allocate tables for
the initial local indirect reference tables, so they don't each
occupy a full page. This seemed to be easier than using linear_alloc,
since these allocations are done from multiple threads. This also
has the advantage that GC roots are concentrated on separate
pages, that could be protected as before, but there are many fewer of
then than before.
As discussed with Lokesh, it might eventually be better to allocate
these in the Java heap. But doing that cleanly seems to require a
major refactoring to split IrtEntrys into two separate components,
which complicates iteration, etc. And that has locality disadvantages
during lookup. Or we need to either drop the serial number of merge
it into the GcRoot, neither of which is ideal either.
Drive-by-fix: When trimming, don't call madvise on empty address ranges.
Test: Build and boot AOSP.
Test: art/test/testrunner/testrunner.py --host -b --64
Bug: 184847225
Change-Id: I297646acbdd9dbeab4af47461849fffa2fee23b1
|
|
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
|
|
Due to how we resized the IndirectReferenceTable it could end up being
an unaligned size. On some architectures, this could sometimes cause
issues we would try to madvise a negative length region, causing
crashes. To fix this we changed the IRT to avoid ever having non-page
aligned lengths and changed how we calculate what to madvise slightly.
Test: ./test.py --host
Test: ./test.py --host --debuggable --64 --with-agent $ANDROID_HOST_OUT/lib64/libtifastd.so=ClassFileLoadHook
Test: Manual checks on emulator
Bug: 152421535
Change-Id: I9eb99c750e6b6230998bf8ba314be426ad8c228c
|
|
Remove the address argument from the shortcut overload and
introduce one more shortcut overload. This makes it easier
to find all uses where we pass non-null address hint.
Remove `requested_begin` parameter from some constructors
where we were always passing null. Rewrite some tests to
use the reservation API.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 118408378
Change-Id: Ibbbb96667e7cc11cf7fea119892463d8dbc9a8b5
|
|
Handles runtime.
Bug: 116054210
Test: WITH_TIDY=1 mmma art
Change-Id: Ibc0d5086809d647f0ce4df5452eb84442d27ecf0
|
|
Address link-time failures when building libartd on macOS after
turning on Generational CC collection by default in ART.
Test: mmma art (on macOS and Linux)
Bug: 67628039
Change-Id: Id464459a8ce0d7276755750cf4c10feb54009704
|
|
Add an overload that does not take `reuse` or `use_ashmem`
parameters but uses default values (`reuse = false` and
`use_ashmem = true`) to simplify callers.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Iaa44f770dee7e043c3a1d6867dfb0416dec83b25
|
|
Avoid plain MemMap pointers being passed around by changing
the MemMap to moveable and return MemMap objects by value.
Previously we could have a valid zero-size MemMap but this
is now forbidden.
MemMap::RemapAtEnd() is changed to avoid the explicit call
to munmap(); mmap() with MAP_FIXED automatically removes
old mappings for overlapping regions.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: m test-art-target-gtest
Test: testrunner.py --target --optimizing
Change-Id: I12bd453c26a396edc20eb141bfd4dad20923f170
|
|
Test: Rely on TreeHugger.
Change-Id: I9cae11191ef1567ae9453be498882a7767285140
|
|
Move the remainder of the Arena stuff, plus dumpable and
runtime/*memory_region* to libartbase. More preparation to build
profiling library.
Bug: 22322814
Test: make -j 50 checkbuild
Change-Id: Iaf26d310c89bc58846553281576c18102f5e4122
|
|
Enforce the layering that code in runtime/base should not depend on
runtime by separating it into libartbase. Some of the code in
runtime/base depends on the Runtime class, so it cannot be moved yet.
Also, some of the tests depend on CommonRuntimeTest, which itself needs
to be factored (in a subsequent CL).
Bug: 22322814
Test: make -j 50 checkbuild
make -j 50 test-art-host
Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
|
|
Ensure critical lock isn't held when returning from a down-call.
Log a warning if the critical lock is held for a significant period of
time.
Refactor JNIEnvExt to be a class rather than a struct.
Test: mma test-art-host
Change-Id: I4d149cb04d3a7308a22b92b196e51e2f1ae17ede
|
|
Add allocation tracking to global references. When the reference
table's free capacity falls under an adjustable value, enable
tracking so as to help tracking down possibly-leaky allocations.
Bug: 67044702
Test: m test-art-host
Change-Id: Ic17d6ebbad895b54c5ac63558027e04aef2b14c1
|
|
Do not abort on overflow. Return null and an error message. The
caller is responsible for handling this, e.g., by aborting. In a
future CL, this may be used for driving additional GCs.
Additional side effect is the removal of a frame from an abortion
stack trace.
Test: m
Test: m test-art-host
Change-Id: I80b1e0ee396fc69906d051f1b661d7dba222fc6f
|
|
The local reference table is resizable. Allow arbitrary capacity
requests and only fail when the request cannot be satisfied.
Bug: 62223672
Test: m test-art-host
Change-Id: I05183098359c5a33473701e9a0d2a4d6c81bde58
|
|
Ensure that we don't waste too much space on tables (currently allow
128MB). Also be defensive and check for overflow when creating or
resizing.
Bug: 62223672
Test: m test-art-host
Change-Id: I60468a79d7d9dcb54767900323c2c50e79df35f3
|
|
Move some read-barrier code into a new header. This prunes the
include tree for the concurrent-copying collector. Clean up other
related includes.
Test: mmma art
Change-Id: I40ce4e74f2e5d4c692529ffb4df933230b6fd73e
|
|
Move the actual VerifyObject check into a new cc file, as we
commonly don't enable the check at all. This allows to cut the
-inl include from almost all current users.
This also exposes missing -inl includes. Also fix up some of our old
mess where .h defined functions require -inl.h defined functions.
Test: m
Change-Id: I3dd821bbe2015564a29bf1ed9be00f7a7276ad61
|
|
Initialize last known previous segment state.
Bug: 32125344
Test: m test-art-host
Test: m valgrind-test-art-host
Change-Id: I894f467a9f1dae8de55c1e113f0b00a127b13f33
|
|
Allow backing table to be resized. This can be used for the local
reference table, where synchronization is not an issue.
Bug: 32125344
Test: m test-art-host
Change-Id: Iae3a933e330026231b17fdde44bcdd99c235dff1
|
|
Change cookie structure to allow for more entries. Use a local
hole-count caching scheme. The design is driven by two
considerations. For one, the change is small and mostly local.
The other point is to still allow inlining of functions involved
with JNI transitions.
This change is in preparation for a resizable backing table for
"unlimite" local references.
micro_native tests show changes are in the noise.
Bug: 32125344
Test: m test-art-host
Change-Id: I08ff5d6eaed75d13ec88f469fb0d18328a0eeb70
|
|
Introduce constants and move some functions into the
IndirectReferenceTable class.
Slightly change IndirectRef encoding to be more obvious (and slighly
more optimized when decoding).
Bug: 32125344
Test: m test-art-host
Change-Id: I05819eccb733b611de582fb8d7151f1a110c305a
|
|
Previously if there was an error when constructing the
IndirectReferenceTable, the error message was lost. Now expose and
include the error message when throwing an exception related to
failures to construct the IndirectReferenceTable.
The error message is propagated through JVMEnvExt, JavaVMExt, and
Runtime::Init as well.
Bug: 32013594
Test: Added new 151-OpenFileLimit runtest.
Test: m test-art-host, m test-art-target
Change-Id: I3692f6928c9570358571bce634569d6f14cdeb05
|
|
Remove dead code for initial vs maximum table size.
Bug: 32125344
Test: m test-art-host
Change-Id: Ie5806da7f5f3238483da918deca5982f01764466
|
|
Deleted some unused object dumping code.
Test: test-art-host
Bug: 31113334
Change-Id: I747220caafe6679591fd4b361d7f50383a046164
|
|
Bug: 31113334
Test: test-art-host
Change-Id: I340fdf430897ebd790ea4e35f94bcee776e98445
|
|
Add an abort message parameter to Runtime::Abort. In case the message
is multiline (and will thus not be completely preserved in the
Android abort reason), reprint the message after all threads have
been dumped.
Bug: 31893081
Test: m test-art-host
Change-Id: I65bc77691fec79f7c868a90d6132805fcc91e473
|
|
Change AbortIfNoCheckJNI to take the abort message as a parameter.
This way it can be passed down.
Bug: 31893081
Test: m test-art-host
Change-Id: Ib24c7060f1b32c9613ab84e6c1966082c866bc14
|
|
Also fixed inclusion of -inl.h files in .h files by adding
scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h
Changed AddLocalReference / Decode to use ObjPtr.
Changed libartbenchmark to be debug to avoid linkage errors.
Bug: 31113334
Test: test-art-host
Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
|
|
Move most of our logging infrastructure over to system/core/base.
Retain VLOG.
Using unified Android infrastructure has two main advantages. First,
it reduces the complexity/maintenance burden in ART. Second, it
allows to detach logging for the cases where we do not want or need
a runtime, e.g., dexdump, the disassembler, etc. As a part of the
latter, libbase is also supported for all hosts (including Windows).
From a developer viewpoint, there are minor behavior changes for the
LOG statements (see above), but otherwise usage is the same. Explicit
severity enum items are in the android::base namespace now.
Bug: 31338270
Test: m test-art-host
Change-Id: I5abcb2f45f5b03d49951874c48544f72a283a91b
|
|
This coincides with the actual attribute name and upstream usage.
Preparation for deferring to libbase.
Test: m
Test: m test-art-host
Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
|
|
Added to:
JIT
DexFile functions
Oat file manager
Added helper ScopedTrace to prevent errors and reduce excess code.
Bug: 27502458
Change-Id: Ifaeff8913d79eefc797380987d13cc00456266f8
|
|
* commit '2ada67b3145d38b352297bdb9d0546f58882e208':
Don't dump stack when deleting an invalid local ref
|
|
Bug: 21724724
Change-Id: Ifa99df9ee9f3265038a0c0f7944e834e42c498d4
|
|
* commit '372e3beecafaaac5e2c063eb68beca9ab3684056':
Move to newer clang annotations
|
|
Also enable -Wthread-safety-negative.
Changes:
Switch to capabilities and negative capabilities.
Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.
Bug: 20072211
Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
|
|
Now we print the stack trace of the method which tried to remove the
non-JNI local reference.
Added test, example output:
Attempt to remove non-JNI local reference, dumping thread
"main" prio=5 tid=1 Runnable
| group="main" sCount=0 dsCount=0 obj=0x12c2b400 self=0xf878af28
| sysTid=32662 nice=0 cgrp=default sched=0/0 handle=0xf73df700
| state=R schedstat=( 154297228 636505 121 ) utm=5 stm=10 core=11 HZ=100
| stack=0xff6f2000-0xff6f4000 stackSize=7MB
| held mutexes= "mutator lock"(shared held)
native: #00 pc 00455a7f /out/host/linux-x86/lib/libartd.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+191)
native: #01 pc 00425d79 /out/host/linux-x86/lib/libartd.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+473)
native: #02 pc 0028c555 /out/host/linux-x86/lib/libartd.so (art::IndirectReferenceTable::Remove(unsigned int, void*)+421)
native: #03 pc 003319c8 /out/host/linux-x86/lib/libartd.so (art::JNI::DeleteLocalRef(_JNIEnv*, _jobject*)+56)
native: #04 pc 0012db14 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+292)
native: #05 pc 00122176 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteLocalRef(_JNIEnv*, _jobject*)+54)
native: #06 pc 00005724 /out/host/linux-x86/lib/libarttest.so (Java_Main_removeLocalObject+36)
native: #07 pc 00004d6e /tmp/test-32506/dalvik-cache/x86/tmp@mathieuc@test-32506@004-JniTest.jar@classes.dex (void Main.removeLocalObject(java.lang.Object)+130)
at Main.removeLocalObject(Native method)
at Main.testRemoveLocalObject(Main.java:118)
at Main.main(Main.java:37)
(cherry picked from commit ff6d8cffb7c14eee56df16d1422b1fcc180decde)
Bug: 20683465
Change-Id: I56b99c77ae7020cabf1aaeb1d5317b1d5ba940e5
|
|
Now we print the stack trace of the method which tried to remove the
non-JNI local reference.
Added test, example output:
Attempt to remove non-JNI local reference, dumping thread
"main" prio=5 tid=1 Runnable
| group="main" sCount=0 dsCount=0 obj=0x12c2b400 self=0xf878af28
| sysTid=32662 nice=0 cgrp=default sched=0/0 handle=0xf73df700
| state=R schedstat=( 154297228 636505 121 ) utm=5 stm=10 core=11 HZ=100
| stack=0xff6f2000-0xff6f4000 stackSize=7MB
| held mutexes= "mutator lock"(shared held)
native: #00 pc 00455a7f /out/host/linux-x86/lib/libartd.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+191)
native: #01 pc 00425d79 /out/host/linux-x86/lib/libartd.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+473)
native: #02 pc 0028c555 /out/host/linux-x86/lib/libartd.so (art::IndirectReferenceTable::Remove(unsigned int, void*)+421)
native: #03 pc 003319c8 /out/host/linux-x86/lib/libartd.so (art::JNI::DeleteLocalRef(_JNIEnv*, _jobject*)+56)
native: #04 pc 0012db14 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+292)
native: #05 pc 00122176 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteLocalRef(_JNIEnv*, _jobject*)+54)
native: #06 pc 00005724 /out/host/linux-x86/lib/libarttest.so (Java_Main_removeLocalObject+36)
native: #07 pc 00004d6e /tmp/test-32506/dalvik-cache/x86/tmp@mathieuc@test-32506@004-JniTest.jar@classes.dex (void Main.removeLocalObject(java.lang.Object)+130)
at Main.removeLocalObject(Native method)
at Main.testRemoveLocalObject(Main.java:118)
at Main.main(Main.java:37)
Bug: 20683465
Change-Id: I56b99c77ae7020cabf1aaeb1d5317b1d5ba940e5
|