Age | Commit message (Collapse) | Author |
|
This is a minor cleanup after
https://android-review.googlesource.com/3048514 .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --speed-profile
Bug: 38313278
Change-Id: Ic47063231fd48656b612ede3ec100ceb8a379050
|
|
Treat app image objects similar to boot image objects and
avoid unnecessary read barriers for app image `HLoadClass`
and `HInstanceOf` checks with app image `HLoadClass` input.
Extend other optimizations to treat app image classes the
same way as boot image classes even though this remains
mostly dormant because we currently do not initialize app
image classes with class initializers; the experimental
flag `--initialize-app-image-classes` is false by default.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --speed-profile
Bug: 38313278
Change-Id: I359dd8897f6d128213602f5731d40edace298ab8
|
|
During the inliner phase if we recognize an intrinsic, we insert it.
This is problematic since there are some intrinsics which we only
expect during the instruction builder phase. This CL skips
inlining those intrinsics.
Potentially, we could generate the graphs for those intrinsics and
inline it, but it needs refactoring of inliner.cc.
Bug: 319045458
Fixes: 319045458
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: Locally compiling the app in the bug
Change-Id: Ied3ec87e5655cec3bdfd978eb5c7411ddb102360
|
|
Split the intrinsics list to differentiate intrinsics with
and without HIR. Eliminate unreachable intrinsic functions
for intrinsics with HIR.
Test: m test-art-host-gtest
Test: restrunner.py --host --optimizing
Bug: 319045458
Change-Id: I6144ef6b6ec547c30f2911c41125a1f07f6f6d50
|
|
Define a new optimization flag for source and destination
position match. Use it to avoid the forward-copy check
(where the assembler optimized away a BLT instruction,
so we had just a useless BNE to the next instruction) and
one position sign check.
Avoid checking that the position is inside the array. The
subsequent subtraction cannot underflow an `int32_t` and
the following BLT shall go to the slow path for negative
values anyway.
Rewrite the array type check to avoid unnecessary checks
and read barriers.
Use an allocated temporary instead of scratch register
for the marking in the read barrier slow path. Simplify
the gray bit check and the fake dependency.
Use constant position and length locations for small
constant values. (It was probably an oversight that we
used it only for large constant values.)
Emit threshold check when the length equals source or
destination length. The old code allowed the intrinsic
to process array copy of an arbirary length.
Use `ShNAdd()` for faster array address calculations.
Use helper functions and lambdas to simplify the code.
Pass registers and locations by value. Prefer load/store
macro instructions over raw load/store instructions. Use
a bare conditional branch to assert the `TMP` shall not
be clobbered.
Test: testrunner.py --target --64 --ndebug --optimizing
Bug: 283082089
Change-Id: I3f697b4a74497d6d712a92450a6a45e772430662
|
|
For https://android-review.googlesource.com/2835572
Test: test.py
Change-Id: Ia1584de58fe945a46b8f49548e062ce212be0a23
|
|
Also remove now obsolete IntegerCache checks - we can rely on the checks
done when generating the boot image.
Test: test.py
Change-Id: Ia8dfa97498e7aaefd4493e8ed67fa62874fe78c3
|
|
Let JIT assume these ranges. They are checked at AOT time when
generating the boot image and when compiling applications.
Test: test.py
Change-Id: Ib2240d150bab366a3c17e0015503f728a98ae2ea
|
|
Leave a few `gUseReadBarrier` uses in JNI macro assemblers.
We shall deaal with these later.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 289805127
Change-Id: I9d2aa245cee4c650129f169a82beda7dc0dd6a35
|
|
And pass integral stack args sign-extended to 64 bits for
direct @CriticalNative calls. Enable direct @CriticalNative
call codegen unconditionally and also enable `HClinitCheck`
codegen and extend the 178-app-image-native-method run-test
to properly test these use cases.
Test: # Edit `run-test` to disable checker, then
testrunner.py --target --64 --ndebug --optimizing
# Ignore 6 pre-existing failures (down from 7).
Bug: 283082089
Change-Id: Ia514c62006c7079b04182cc39e413eb2deb089c1
|
|
Change `intrinsics_list.h` to a normal include file instead
of the weird include-use-and-undef pattern. Prefix macros
defined in that file with `ART_`.
And also remove blank lines at end of some files and address
some comments on merged changes.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 283082089
Change-Id: I9c462f973c0c4bb53eff39fbe191014f6321d7c5
|
|
Bug: 169680875
Test: mmm art
Change-Id: Ic0cc320891c42b07a2b5520a584d2b62052e7235
|
|
After the old implementation was renamed in
https://android-review.googlesource.com/2526708 ,
we introduce a new function with the old name but new
behavior, just `DCHECK()`-ing the instruction kind before
casting down the pointer. We change appropriate calls from
`As##type##OrNull()` to `As##type()` to avoid unncessary
run-time checks and reduce the size of libart-compiler.so.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 181943478
Change-Id: I025681612a77ca2157fed4886ca47f2053975d4e
|
|
The null type check in the current implementation of
`HInstruction::As##type()` often cannot be optimized away
by clang++. It is therefore beneficial to have two functions
HInstruction::As##type()
HInstruction::As##type##OrNull()
where the first function never returns null but the second
one can return null. The additional text "OrNull" shall also
flag the possibility of yielding null to the developer which
may help avoid bugs similar to what we have seen previously.
This requires renaming the existing function that can return
null and introducing new function that cannot. However,
defining the new function `HInstruction::As##type()` in the
same change as renaming the old one would risk introducing
bugs by missing a rename. Therefore we simply rename the old
function here and the new function shall be introduced in a
separate change with all behavioral changes being explicit.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: buildbot-build.sh --target
Bug: 181943478
Change-Id: I4defd85038e28fe3506903ba3f33f723682b3298
|
|
This reverts commit 0a51605ddd81635135463dab08b6f7c21b58ffb0.
Reason for revert: Reland after some of the required work
was merged in other CLs.
Also address a TODO from the original CL to mark required
symbols with EXPORT in `intrinsic_objects.h`.
Also mark symbols in new files as HIDDEN.
Bug: 186902856
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I936d448983928af23614ca82c2d0bf9a645e2c52
|
|
And use the field offset as seen at compile time.
Implemented for x86-64, arm and arm64 but not for x86
with incomplete set of `VarHandle` intrinsics.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 191765508
Change-Id: If68b0287c8823e69c493dcefb7e61dc34d69fb4f
|
|
From OpenJDK 10 onward, sun.misc.Unsafe has been moved to
jdk.internal.misc. Trying to merge in changes from OpenJDK 11
depends on having jdk.internal.misc.Unsafe available. As
sun.misc.Unsafe is still used throughout libcore code, it cannot
be changed yet, so a copy is made to jdk.internal.misc.Unsafe for
now.
As OpenJDK 11 is merged in and sun.misc.Unsafe references will
disappear, it can be deprecated and eventually made to call into
jdk.internal.misc.Unsafe.
Test: m
Test: art/test/testrunner/testrunner.py -t 004-UnsafeTest
Test: art/test/testrunner/testrunner.py -t 2235-JdkUnsafeTest
Bug: 190470684
Change-Id: I472a9778a1001fbd7c3ecce0dfa58ea6d632f158
|
|
This reverts commit 4a889b7f1e58368f0ffd795eaa24f2f493ccab8d.
Reason for revert: relanding the original change after fixing the
baseline compiler.
Static checks for VarHandle intrinsics are now done in two places:
1) Simple static checks are done for both baseline and optimizing
compilers in `HInstructionBuilder::BuildInvokePolymorphic`.
2) More complex checks are done in instruction simplifier only for the
optimizing compiler. They can use information provided by preceding
optimization passes.
Bug: 191765508
Test: art/test.py --host -r
Change-Id: I92932f6fcf408c700e6db0101fe2fb1e8300a54a
|
|
This reverts commit b3a7a6a72d7b91ee5507bd7314a3aae3948e6f29.
Reason for revert: Breaks ART baseline compiler.
Bug: 191765508
Change-Id: Ida63660e0149c4847f015950f95282e61add7204
|
|
Create a `VarHandleOptimizations` helper class holding the
optimization flags for VarHandle intrinsics.
Add a flag to avoid emitting the intrinsic implementation
and move shared checks previously duplicated in intrinsic
codegens helpers `HasVarHandleIntrinsicImplementation()` to
the instruction simplifier. Individual intrinsic codegens
perform additional checks as needed.
Add the first optimization flag to avoid null check on the
holder object if it cannot be null. And do not emit the
intrinsic implementation if the holder object is null.
Test: testrunner.py --host --optimizing
Test: testrunner.py --target --optimizing
Bug: 191765508
Change-Id: I53b1b57c327f02a9913f22885c1ce663cd9c3d44
|
|
Test: Added tests to 122-npe and 160-read-barrier-stress
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 172573708
Change-Id: I8342510565289058df218d3249ffac1eb993ca4f
|
|
These were erroneously moved to unimplemented intrinsics in
https://android-review.googlesource.com/1372099 .
Test: m
Bug: 71781600
Change-Id: Ic348ec1be92e7db8722575dd44f22826e770cc75
|
|
The compiled code and runtime stubs don't need to have direct access to
the dex cache anymore.
Test: test.py
Change-Id: Id3aab9b10445ba2599e1a9ffd8e36506a745bfec
|
|
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --jit
Test: aosp_blueline-userdebug boots.
Test: run-gtests.sh
Test: testrunner.py --target --optimizing --jit
Bug: 170286013
Change-Id: I4762f7c1cf3d61de2215ec8f1d14be80289c2372
|
|
Prepare for Reference.getReferent() intrinsic implementation
by a refactoring to separate the retrieval of an intrinsic
method's declaring class to its own helper function, rather
than being a part of a larger one.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --jit
Test: aosp_blueline-userdebug boots.
Test: run-gtests.sh
Test: testrunner.py --target --optimizing --jit
Bug: 170286013
Change-Id: Ib6c0e55d0c6fcc932999428f21c51afe32ab7ef2
|
|
This commit prepares the ground for adding VarHandle support
in the compiler. The intrinsic locations builder and code
generator are now triggered for HInvokePolymorphic nodes.
VarHandle and MethodHandle intrinsics are marked as unimplemented
rather than unreachable.
Since the Varhandle intrinsics are not implemented yet, the
functionality is not changed (i.e. the intrinsics are evaluated
at runtime and not compiled). I manually tested that the intrinsic
Visit* methods are triggered for the VarHandle methods.
Bug: b/65872996
Test: art/test.py --host -r -t 713-varhandle-invokers
Test: art/test.py --host --all-compiler -r
Change-Id: I3333728c5f16d8dc4f92ceae2738ed59b3e31e6a
|
|
This reverts commit e2727154f25e0db9a5bb92af494d8e47b181dfcf.
Reason for revert: Breaks ASAN tests (ODR violation).
Bug: 142365358
Change-Id: I38103d74a1297256c81d90872b6902ff1e9ef7a4
|
|
Make symbols in compiler/optimizing hidden by a namespace
attribute. The unit intrinsic_objects.{h,cc} is excluded as
it is needed by dex2oat.
As the symbols are no longer exported, gtests are now linked
with the static version of the libartd-compiler library.
libart-compiler.so size:
- before:
arm: 2396152
arm64: 3345280
- after:
arm: 2016176 (-371KiB, -15.9%)
arm64: 2874480 (-460KiB, -14.1%)
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --jit
Bug: 142365358
Change-Id: I1fb04a33351f53f00b389a1642e81a68e40912a8
|
|
|
|
This reverts commit 344b0d18eb9f9f2f2ef704acadc510a6dd56a282.
Reason for revert: Not the CL that broke the tests.
Change-Id: I38221d1ac723e5ea71cb398401e2fda8dd2d7db9
|
|
This reverts commit e734fe8d4aa5f70a5798363774a4ed63357ebe20.
Reason for revert: May be breaking tests.
Change-Id: I6c0c04a60c1b4f329c472d28a3c2666526bd6383
|
|
bug: 111397239
bug: 119800099
Test: m
Change-Id: Id831b641e18a8497435839e2fbcfee1f6d60a56d
|
|
Avoid caching the results. Caching was broken for JIT in the
presence of class unloading; entries for unloaded dex files
were leaked and potentially used erroneously with a newly
loaded dex file.
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: Pixel 2 XL boots.
Test: m test-art-target-gtest
Test: testrunner.py --target
Bug: 118808764
Change-Id: Ic1163601170364e060c2e3009752f543c9bb37b7
|
|
Implemented as a stripped down version of the optimizing compiler,
not running any optimization.
Adjust code to still work with expectations in code generators.
bug: 111397239
Test: test.py --baseline
Change-Id: I4328283825f9a890616e7496ed4c1e77d6bcc5dd
|
|
Instead just recognize the intrinsic when creating an invoke
instruction.
Also remove some old code related to compiler driver sharpening.
Test: test.py
Change-Id: Iecb668f30e95034970fcf57160ca12092c9c610d
|
|
Test: art/test.py
Bug: 68181300
Bug: 67628039
Change-Id: I66afa3ea010f758125f8aec79509f0255cb5ea03
|
|
This reverts commit da283050a1a3ddbb7cefae3f36e8c8c1a6acedb7.
Reason for revert: This CL is no longer needed with
https://android-review.googlesource.com/737437
which makes the String class non-movable in all cases.
Test: art/test.py
Bug: 68181300
Bug: 67628039
Change-Id: I414abd79de1e1b0fc43dc3be412fc70598ef3044
|
|
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with
'final' and 'override' specifiers. Remove all definitions of these
macros as well, which were located in these files:
- libartbase/base/macros.h
- test/913-heaps/heaps.cc
- test/ti-agent/ti_macros.h
ART is now using C++14; the 'final' and 'override' specifiers have
been introduced in C++11.
Test: mmma art
Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
|
|
And generate only one "boot image live objects" array rather
than one per boot*.art file.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: testrunner.py --target --optimizing
Bug: 71526895
Change-Id: I23af7f47fea5150805f801cd2512f2d152ee5b73
|
|
And fix the intrinsic for JIT even in case when someone
messes up the IntegerCache using reflection. Two cases are
exposed with a regression test (one that previously failed
randomly and one that failed 100%) but other crashes were
possible; for example, we would need a read barrier for
array reads when elements are not guaranteed to be in the
boot image.
The new approach loads references only from the boot image
live objects array which cannot be touched by reflection.
The referenced objects and IntegerCache.cache are exposed
and can lead to weird behavior but not crashes.
On x86, the pc_relative_fixups_86 actually checks the cache
an additional time but discrepancies between this check and
the location building at the beginning of codegen should be
OK as the HIsX86ComputeBaseMethodAddress should be added
for PIC regardless of whether pc_relative_fixups_86 thinks
the method is intrinsified or not.
Test: 717-integer-value-of
Test: Pixel 2 XL boots.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --pictest --npictest
Test: testrunner.py --host --jit
Test: testrunner.py --target --optimizing --pictest --npictest
Test: testrunner.py --target --jit
Bug: 71526895
Change-Id: I89b3245a62aba22980c86a99e2af480bfa250af1
|
|
Rationale:
The change adds a return value to Run() in preparation of
conditional pass execution. The value returned by Run() is
best effort, returning false means no optimizations were
applied or no useful information was obtained. I filled
in a few cases with more exact information, others
still just return true. In addition, it integrates inlining
as a regular pass, avoiding the ugly "break" into
optimizations1 and optimziations2.
Bug: b/78171933, b/74026074
Test: test-art-host,target
Change-Id: Ia39c5c83c01dcd79841e4b623917d61c754cf075
|
|
Rationale:
Having explicit MIN/MAX/ABS operations (in contrast
with intrinsics) simplifies recognition and optimization
of these common operations (e.g. constant folding, hoisting,
detection of saturation arithmetic). Furthermore, mapping
conditionals, selectors, intrinsics, etc. (some still TBD)
onto these operations generalizes the way they are optimized
downstream substantially.
Bug: b/65164101
Test: test-art-host,target
Change-Id: I69240683339356e5a012802f179298f0b04c6726
|
|
NOTE: step 1 of 2 for
"Introduce MIN/MAX/ABS as HIR nodes."
Rationale:
Having explicit MIN/MAX/ABS operations (in contrast
with intrinsics) simplifies recognition and optimization
of these common operations (e.g. constant folding, hoisting,
detection of saturation arithmetic). Furthermore, mapping
conditionals, selectors, intrinsics, etc. (some still TBD)
onto these operations generalizes the way they are optimized
downstream substantially.
Bug: b/65164101
Test: test-art-host,target
Change-Id: I9c93987197216158ba02c8aca2385086adedabc4
|
|
For a invocation that's devirtualized to a different method, try
to give intrinsics matching an opportunity before trying to inline it.
Test: run-test on host. 638-checker-inline-cache-intrinsic.
Change-Id: I51f70835db4c07575c58872a64a603a38dbcb89c
|
|
Removes a couple of unnecessary SOA instances.
Bug: 69622155
Test: m -j32
Change-Id: I92e194096faeb4a83e4972d745bd8182ce8f820c
|
|
Rationale:
Inliner could introduce new method calls, in particular
it could change invoke-interface to invoke-virtual,
which could expose new intrinsics. This situation
happens, for example, in Kotlin generated code where
String operations first go through the CharSequence
interface. Rather than running a full new phase,
we just recognize intrinsics when interface calls
are replaced by virtual calls.
This optimization boosts KotlinMicroItems by 100%
Test: test-art-host test-art-target
Change-Id: Ibd0519283d67ed6997b056e34b4eafdd49fcbc2d
|
|
Rationale:
Refactors the way we set up optimization passes
in the compiler into a more centralized approach.
The refactoring also found some "holes" in the
existing mechanism (missing string lookup in
the debugging mechanism, or inablity to set
alternative name for optimizations that may repeat).
Bug: 64538565
Test: test-art-host test-art-target
Change-Id: Ie5e0b70f67ac5acc706db91f64612dff0e561f83
|
|
If the String.class is moveable (i.e. running without boot
image), the instanceof check emitted by the JIT in the
String.equals() intrinsic would require read barriers.
As we do not really care about the performance of running
without the boot image, disable the intrinsic in this case.
Test: 669-moveable-string-class-equals (--jit)
Bug: 68181300
Change-Id: I39c9f9935e0482b3b30f1ae5cd23515cbda0603b
|
|
Adds VarHandle accessor method to list of intrinsics.
Adds code to interpreter to ensure intrinsics with polymorphic
signatures are initialized.
Rename most uses of InvokePolymorphic to InvokeMethodHandle (and
similar changes) to be clear that the particular code path applies to
MethodHandle instances rather than VarHandle.
Change-Id: Ib74865124a1e986badc0a7c4bb3d782af07225d4
Bug: 65872996
Test: art/test.py --host
|
|
Passes using local ArenaAllocator were hiding their memory
usage from the allocation counting, making it difficult to
track down where memory was used. Using ScopedArenaAllocator
reveals the memory usage.
This changes the HGraph constructor which requires a lot of
changes in tests. Refactor these tests to limit the amount
of work needed the next time we change that constructor.
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: Build with kArenaAllocatorCountAllocations = true.
Bug: 64312607
Change-Id: I34939e4086b500d6e827ff3ef2211d1a421ac91a
|