| Age | Commit message (Collapse) | Author |
|
... and a few other places in `runtime/`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 325430813
Change-Id: Ied837bffed78b1fe4c4d381772b8c1933b76f6c0
|
|
Make it easier to calculate the IMT index without an actual
`ArtMethod` in preparation for a significant refactoring of
`ClassLinker::LoadClass()`.
Update documentation of `ArtMethod::imt_index_` which is
actually unused for abstract non-interface methods.
Also reorder code in `ClassLinker` without any modification
to make it easier to compare the differences in the upcoming
refactoring.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 329196666
Change-Id: Ic71ff323ea92325958d59536e83ab70d057b94df
|
|
In one case a hiddenapi access check was done with
hiddenapi::AccessMethod::kNone for an app access, with the intention of
following it up with another "real" check that does log and applies the
enforcement policy.
However, hiddenapi::AccessMethod::kNone applied the current enforcement
policy, so the second check would always get skipped if the policy
isn't hiddenapi::EnforcementPolicy::kEnabled. That's a problem when
it's kJustWarn, because the first check won't log, and the second -
which would - is skipped.
Fix that by returning an access failure for the first check, regardless
of the policy, so that the second doesn't get skipped. The behaviour
doesn't change if the policy is kEnabled, and the second check won't do
anything if it's kDisabled, so this change only has effect when it's
kJustWarn.
Also rename kNone to the more apt kCheck.
For compatibility in other places where access checks with kNone aren't
used like above, introduce a new access method kCheckWithPolicy, which
keeps the behaviour of kNone (but with a more descriptive name). Some
of those code paths should perhaps be changed to kCheck as well, but
that's for another time.
Test: Boot and check logcat with planted API violations in system_server.
Test: 674-hiddenapi 690-hiddenapi-same-name-methods 691-hiddenapi-proxy
817-hiddenapi 822-hiddenapi-future 999-redefine-hiddenapi
2038-hiddenapi-jvmti-ext 2270-mh-internal-hiddenapi-use
on host and target
Bug: 377676642
Change-Id: I4ca70c229bd6261a78dcd68990708a318b0e7588
|
|
Test: test.py
Change-Id: I3a065dd5582269792032df0c6446c3c4b6cd72be
|
|
Test: test.py
Change-Id: Ib97fca637a8866a41a4389b150c6000d9fb6d99b
|
|
Also fixes some logic and a DCHECK in the presence of duplicate
fields.
Bug: 364876321
Test: 734-duplicate-fields
Change-Id: Ice510db35853e6a3383e30393f616c839faca75d
|
|
`DexFileVerifier::CheckClassDataItemMethod()` rejects method
names starting with '<' other than "<init>" and "<clinit>".
Therefore `ClassLinker::LoadMethod()` does not need to check
the whole method name when checking for constructors without
the `kAccConstructor` flag.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I41dbedc1b6dd2e26444a2198a82ab65b6ab4a43e
|
|
Introduce ResolveMethodId and ResolveMethodWithChecks to make it more
explicit at the call site. This also simplifies the implementation of
ResolveMethodWithChecks.
Also avoid creating handles in ResolveField when the dex cache already
contains the field.
Test: test.py
Change-Id: Ie722c6d7ecadf7c6dbd780f0fc58dfae89140a01
|
|
This reverts commit 1f9c184392020cb5c4bdf453f4c8847ca389614b.
Reason for revert: Memory regressions.
Change-Id: I85357603c31aa7dbde92aea5958167ea8f0fd481
|
|
This increases the number of intrinsics from 255 to 511.
Bug: 370367478
Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing
Change-Id: I9104dab59b06f4fb72c44ec9e004566cc28e668f
|
|
... and related functions in most cases.
Note that the `CompilerDriver` previously resolved the
`ClassLoader` and `TransactionAbortError` using the provided
class loaders. We're now using the `ClassLoader` from the
class roots and resolving the `TransactionAbortError` in the
BCP class loader.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Bug: 338123769
Change-Id: I38e480cdcdb8bf02c958e4d0773437f5766f6be0
|
|
Use `std::string_view` instead of `const char*` descriptor.
This uses faster `memcmp` instead of the slower`strcmp` for
descriptor comparison.
Note that the `ScopedTrace` passes `const char*` across the
`libartpalette` boundary, so we cannot easily replace the
`const char* descriptor` with `std::string_view descriptor`
in certain `ClassLinker` functions because we actually need
to pass a null-terminated string and the `string_view` API
does not technically guarantee null-terminated data.
Therefore we resort to explicitly passing around the
descriptor and its length as separate arguments.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Bug: 338123769
Change-Id: Ie3fa251390acc582c54b4686d18696eb89b32361
|
|
Rename it to ResolveMethodId as a more precise name, and use it in
places where that's the thing we need.
Test: test.py
Change-Id: I906371585e9fa208093eed9affba552fd135a184
|
|
This has been dead code since
https://android-review.googlesource.com/1216803 .
Test: m
Change-Id: I1bc84b8c85f88a50071e50b58ed2efb2177633d3
|
|
The lookup success rate is too low (<1%) during app startup where the
cache is most stressed. So always use an array for them.
To avoid memory regression, madvise away the arrays at every GC.
go/art-benchmark-service reports ~3% improvement in app startup with no
statistically significant memory regression.
Test: test.py
Change-Id: Id13612054943ed7770c9e96756f391eed2352d79
|
|
Currently ART has an implicit assumption that the ISA of the quick
code (e.g.: app code) that is targeted to be run by ART will be the
same as the machine that runs ART itself (e.g.: runtime code). This
assumption is made by having a single value (kRuntimeISA)
representing both of these types of code.
Instead kRuntimeISA is split into two values so that it is possible
to target the case where these two ISAs don't match, for example: in
simulator mode. The two values are as follows.
- kRuntimeISA:
- Must match the ISA of the machine that ART will be
run on. This ISA will be used for the native context,
native stack frame and native ABI.
- kRuntimeQuickCodeISA:
- The ISA that ART will generate quick code for, i.e.:
that java code will be compiled to. This ISA will be
used for the quick context, quick stack frame and
quick ABI.
Therefore replace kRuntimeISA with kRuntimeQuickCodeISA where the
semantics of quick code ISA is expected, not the ISA of the machine
the code is running on. Also hardcode ISA for ISA specific
QuickArgumentFrameInfo classes.
Authors: Artem Serov <artem.serov@linaro.org>
Artem Serov <artem.serov@arm.com>
Chris Jones <christopher.jones@arm.com>
Test: test.py --host --target
Change-Id: Ibe6f3e27179f3baa49a8de89686341df0dcf16f5
|
|
Since
https://android-review.googlesource.com/2236075
the `OatWriter` has been using a null `VerificationResults`
because `CreateOatWriters()` is called before initializing
the `verification_results_` in `Dex2Oat`. As the `OatWriter`
is using it only to select between two `ClassStatus` values
that currently lead to the very same behavior in the
`ClassLinker::VerifyClassUsingOatFile()` (but with different
comments and therefore prone to diverging), this did not
yet lead to any observable difference in behavior.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing.
Change-Id: I3f0b67497358ac98b4980691f80044a5b0f0fc17
|
|
It used to print things like `: 0( NotReady)` and now it
will print them, like `: 0 (NotReady)` which is more readable.
Change-Id: I81773bd64d56444be4efd984ce3eb752bdd2df84
|
|
Making it closer to JVMS 4.4.8 and 5.4.3.5. The RI rejects certain
constructions at the class verification stage, hence there are
separate classes for MethodHandle-s targeting <init> and <clinit>
methods. In these cases The RI throws ClassFormatError during class
load, but currently we do validations only when actual MethodHandle
object is constructed, that's is the reason why test code has
ICCE | CFE in catch blocks. That will be addressed in the
upcoming CLs.
This should not cause any compat issues as even if some of these
MethodHandle were constructed successfully, their invocation
leads to runtime crashes.
Bug: 297147201
Test: ./art/test/testrunner/testrunner.py --host --64 --jvm -b
Change-Id: I551b04e3c00ffc8bcdeac4760d9ac4b3bb7b2aff
|
|
These annotations are possible (due to the DEX spec) but
unexpected in this scenario.
Update dexdump to dump those annotations too.
Update the gtest to not dereference h_klass until we know
it's safe.
Bug: 365807384
Fixes: 365807384
Test: m test-art-host-gtest-art_runtime_tests64
Change-Id: I7fc8ff2bc60f0b7e6af3047ab721b18427ee5f96
|
|
Bug: 304325190
Test: art/test/testrunner/testrunner.py --host
Change-Id: I6e25143b827acaa12ff5bd94e6196faaed461f4a
|
|
This helps by eliminating the need to dereference component_type_
reference in Class each time we need to compute the array's size.
Bug: 304325190
Test: art/test/testrunner/testrunner.py --host
Change-Id: I745b794066fa24787800f0e0baaf5c4188842bc1
|
|
find_array_class_cache_ is used to cache the array classes. This is
accessed concurrently by mutator threads that are looking for an array
class. These threads both read entries and update the cache with the new
array class if it wasn't found in the cache. GC also accesses this cache
to clear it when visiting the roots of class linker. GC uses std::fill_n
to clear the cache. Under ideal circumstances these operations could
work as expected and the updates to each entry could be atomic. Though
some valid compiler optimizations could break this and it is possible we
see a partially initialized / cleared entry. To prevent these we use
atomics to make it safe to access concurrently.
Bug: 330843930
Test: art/test.py
Change-Id: I493e0b0d47bf03603a4970855608cbe82a87c1a4
|
|
Also address some other late comments on
https://android-review.googlesource.com/2146626 .
Test: m test-art-host-gtest
Test: testrunnerpy.py --host --optimizing
Change-Id: Ib43ff9b959431e74a6ada6213780b400bbf265a2
|
|
Move the transactional interpreter, `AotClassLinker`,
`Transaction` and `SdkChecker`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: If001e06711ee345ce5b937ed764e66b26a0abcd6
|
|
... with `ScopedAssertNoTransactionChecks`. The new check
is stronger than the old one but does not work during early
setup when we do not have a `Thread` object yet.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Iba5a5cda0d97993ff324b4d11de02cb07f770699
|
|
The test is using `Compiler`, so it belongs to `compiler/`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 288983053
Change-Id: Id1d5aef67a694a8b610d390c4e40e74d9d788ca9
|
|
Remove the header file `string_view_cpp20.h` and update
all source files that previously used this header file.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Iafcdfc838a97deed7fb3a37cc8afe1f7ee78306b
|
|
Calculate the access flags in a local variable to avoid
unnecessary atomic operations. Clean up the code to avoid
some unnecessary branching. Avoid nterp flag recalculation
when the target ISA is the same as `kRuntimeISA`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: I2486d54f4b4cf73f9b8e94b366ee9db3085e5fa7
|
|
Reverse the relationship between `ActiveTransactionChecker`
and `AotClassLinker` by moving the checks to the latter.
Move `{Active,Inactive}TransactionChecker` and functions
`DoField{Get,Put}()` to the `interpreter_switch_impl*`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --interp-ac
Change-Id: I509083b4ee77a69a3ba7e0d277b0e9e5fb7e32c8
|
|
Keep a simple flag for active transaction in `Runtime` but
move all other transaction data to `AotClassLinker`.
Make `IsActiveTransaction()` a pre-requisite for calling
`IsTransactionAborted()`.
Eliminate `AbortTransactionAndThrowAbortError()` by inlining
into `AbortTransactionV()` and rewriting other callers to
use `AbortTransactionF()` instead.
Separate transaction-related test code to its own files.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Ie6ee421fcfed1599049ab50ca692f19c71f395ce
|
|
Work with `std::string_view::compare()` instead of slower
`CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues()`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 338123769
Change-Id: I4c3cc131da457c0a73f83fa2f864491eb2bc7a03
|
|
In the `ClassTable::UpdateClass()`, both the old and the new
`Class` objects reference the same dex file and type index.
Therefore it's better to do the lookup with the new `Class`
object as the `Class:DescriptorEquals(ObjPtr<Class>)` can
avoid the string comparison for the descriptor match in this
case and we compare descriptors only for hash conflicts.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 338123769
Change-Id: I23960c9c3b34b7f7fdd2fce6b191fd9c4efe7320
|
|
Prepare for moving the transactional interpreter from
`runtime/` to `dex2oat/` by moving transaction checking code
to a new file `active_transaction_checker.h`, and breaking
unstarted runtime dependency on transaction code by adding
an indirection with a virtual call through `ClassLinker`.
Consistently return the same value from contraint checks.
Previously we were returning the negated result from the
`CheckWrite{,Value}Constraint()` compared to the value we
received from `Transaction::Write{,Value}Constraint()`.
Test: m test-art-host-gtest
Test: testrunner.py --host --interp-ac
Change-Id: I88a168b6c770932d014e3a40486480590cef0401
|
|
Abstract classes don't have an IMT and therefore cannot own one.
Test: 141-class-unload
Bug: 322253629
Change-Id: Ic6bb498d83ec66252710af384c24963be2287055
|
|
Prepare for adding app image patches to the same section.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 38313278
Change-Id: Ib552f005b3a2859152d0de9fa6b2fcd48a0f3feb
|
|
The `*ByIdx()` and `*ByTypeIdx()` functions were doing
validity checks that were needed only for processing the
debug data, so move the checks to these callers. Replace
these functions with new overloads of other functions to
provide consistent naming.
In a few cases, rewrite calls to these functions to fetch
and work with a `string_view` instead.
Rename `GetStringLength()` to `GetStringUtf16Length()` and
change its return type to `uint32_t`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I561899606f6e5ec5f23aa4be617349dacdb376e3
|
|
Otherwise, we could be looking at ArtMethods whose class loader is being
deleted.
Test: test.py
Bug: 331427447
Change-Id: I3a1d052216c7691d98576ab912e8af96de65a77b
|
|
Make `LinkCode()` a member of `ClassLinker` and speed it up
by avoiding a linear (but fast) method code lookup using the
`BitVector::NumSetBits()`, avoiding related function call
overhead as well as pulling some invariant checks out of the
calling loops and eliminating redundant checks.
For a test class with 1000 unannotated static methods and
400 @NeverCompile static methods, this change reduces the
time needed by `ClassLinker::LoadClass()` by roughly 25%.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 329196666
Change-Id: Ifeae520113594acae2e5c19ba746f11ede2dfac2
|
|
Iterate annotations alongside other method data, using the
fact that both are ordered by method index. We use separate
iterators for loading direct and virtual methods.
For a test class with 500 unannotated static methods and
200 @NeverCompile static methods, this change reduces the
time needed by `ClassLinker::LoadClass` approximately 2x.
For a test class with twice that many methods, the time
without this change increases by ~3x but with this change
the time increases by ~2x, showing nice linear scaling.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 329196666
Change-Id: I800b8e8e9f9e5a4fbfbda1361f99feb8c43ff1d5
|
|
Move the special handling for `Object` and `Enum` to the
`ClassLinker::InitWithoutImage()` to simplify the function
used for loading methods for all classes.
Test: test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 329196666
Change-Id: I81057802dfa6406045deea53c8029de3622a9ef8
|
|
It was the only enum in the file
Bug: 329378408
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: If0e385324afa3685f648135ba9b60e6bc79ba0ed
|
|
Different native methods can share the same JNI stub as long as they
have the same flag and shorty. Boot images loaded by zygote contain lots
of JNI stubs that already compiled, so we can reuse them for native
methods loaded later. For those methods having a matching JNI stub, we
no longer need the GenericJNI and following JIT/AOT, which will bring an
increase in program speed.
Since there are many optimizations in JniCompile, we can also optimize
the "shorty equals" criteria for some archs to let more methods find
their matching stubs.
Test performance improvement: run a simple addOne(Object, int) native
method for multiple times at startup (microsecond, lower is better):
Number of runs before after
5000 398.70 124.94
10000 792.21 234.23
50000 3919.20 1065.30
Test feature coverage: start and run the app for 30 seconds (top 10 apps
in Chinese market, the closer to 100% the better):
(count of native methods that reuse boot JNI stub / total count of app
native methods = percentage)
app1: 1055/1206 = 87.48%
app2: 765/884 = 86.54%
app3: 1267/1414 = 89.60%
app4: 1577/1759 = 89.65%
app5: 1698/1860 = 91.29%
app6: 2528/2787 = 90.71%
app7: 1058/1218 = 86.86%
app8: 952/1092 = 87.18%
app9: 1343/1483 = 90.56%
app10: 2990/3492 = 85.62%
This relands commit c8b6e26aa56bb6761bb781d1095b36f84c4c65d4.
Reason for reland:
- Fix the stack unwind issue of Thumb2.
- We never use AOT code in debuggable. So restrict this optimization
only to non-debuggable.
- The original CL has conflict with aosp/2988923. That other CL is
relanded so we can reland after resolving the conflict.
Test: m test-art-host-gtest
Test: run-gtest.sh
Test: testrunner.py --host --all-debuggable
Test: testrunner.py --target --all-debuggable
Bug: 288983053
Change-Id: If7ba92d8a5f4bb9903b407d4f625e085de80cad7
|
|
We were saving it as a raw uint32 which meant that we were having
unnecessary conversion and checks.
Bug: 329379384
Bug: 329378408
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: m test-art-host-gtest
Change-Id: Ib6d9a9abfec7588dad4ff345cc6b569df7144782
|
|
Either remove them, or add a LOG(FATAL) before them.
Bug: 328756212
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: m test-art-host-gtest
Change-Id: Ibf2bddb0a4add5a844a515a040b3751acc7faf84
|
|
This reverts commit c8b6e26aa56bb6761bb781d1095b36f84c4c65d4.
Bug: 288983053
Reason for revert: Failure on luci bots.
Change-Id: Ieae0f47f2114efbfcb0bc4d8ffb0868001c22653
|
|
Different native methods can share the same JNI stub as long as they
have the same flag and shorty. Boot images loaded by zygote contain lots
of JNI stubs that already compiled, so we can reuse them for native
methods loaded later. For those methods having a matching JNI stub, we
no longer need the GenericJNI and following JIT/AOT, which will bring an
increase in program speed.
Since there are many optimizations in JniCompile, we also optimize the
"shorty equals" criteria for some archs to let more methods find their
matching stubs.
Test performance improvement: run a simple addOne(Object, int) native
method for multiple times at startup (microsecond, lower is better):
Number of runs before after
5000 398.70 124.94
10000 792.21 234.23
50000 3919.20 1065.30
Test feature coverage: start and run the app for 30 seconds (top 10 apps
in Chinese market, higher percentage is better):
(count of native methods that reuse boot JNI stub / total count of app
native methods = percentage)
app1: 1055/1206 = 87.48%
app2: 765/884 = 86.54%
app3: 1267/1414 = 89.60%
app4: 1577/1759 = 89.65%
app5: 1698/1860 = 91.29%
app6: 2528/2787 = 90.71%
app7: 1058/1218 = 86.86%
app8: 952/1092 = 87.18%
app9: 1343/1483 = 90.56%
app10: 2990/3492 = 85.62%
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: run-gtest.sh
Test: testrunner.py --target
Bug: 288983053
Change-Id: I72f27bcfcd4d4a360bd5d9478b8f7687f087e431
|
|
Bug: 260881207
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: Id729aca1d8b6d003ff3e9755112f3283e9f2b507
|
|
Test: art/test.py -b --host
Change-Id: Icedd3a82c6bca5147c3bc9dc50de5a729003d66f
|
|
art/runtime/class_linker.cc:2090:31: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'PointerSize' [-Wformat]
Test: presubmit
Bug: 315250603
Change-Id: I2724a8564207bde57c2596b0e9f6b1dc340f93f0
|