History log of /art/test/478-checker-clinit-check-pruning/src/Main.java
Revision Date Author Comments
e2abbc604ce003c776c00ecf1293796bb4c4ac5a 15-Sep-2017 Andreas Gampe <agampe@google.com> ART: Move kDexNoIndex to dex_file_types.h

Define the constant with the types to allow lowering the dependency
on DexFile.

Test: m
Change-Id: I3c61421db45be96d2057e01b1a7825883d8bd178
fdb7d638c17dab47984e1d325d04796bb426d9b3 08-Feb-2017 Nicolas Geoffray <ngeoffray@google.com> Inline methods that throw.

Forked from https://android-review.googlesource.com/214292

test: 637-checker-throw-inline
bug: 30933338
Change-Id: I184be82dfab0710af3f3796e9e486c7817fa9c60
5bf7bacc0993a2efd9b0765813928ff72ea4bb9f 06-Jul-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Inline and optimize interface calls.""

This reverts commit 19dc255bf94a4229de8627a2079ee6f0e9005e2d.

Change-Id: Ifc3a92280878d4db1b460d486137497b3456beae
19dc255bf94a4229de8627a2079ee6f0e9005e2d 06-Jul-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Inline and optimize interface calls."

Went ahead too quickly.

This reverts commit d9faceaa8da92f4a56c2907de949081bd42faf79.

Change-Id: I1610deaf89b38037cf2786d135a59c48b10ced0c
d9faceaa8da92f4a56c2907de949081bd42faf79 06-Jul-2016 Nicolas Geoffray <ngeoffray@google.com> Inline and optimize interface calls.

- Support for inlining methods with invoke-interface (the
previous performance limitation is now fixed with the new
ImtConflictTable).
- Turn non inlineable invoke-interface into invoke-virtual to
avoid any potential execution of the conflict trampoline.

test:609-checker-inline-interface

Change-Id: Ibe33bc945deaada8fb78541e6e0bf034ebb52420
2b8b6040d0d34f40e3db71f0e4b1c369fd1f02c6 29-Jun-2016 Vladimir Marko <vmarko@google.com> Fix merging HLoadClass with HNewInstance.

Do not merge HLoadClass with HNewInstance if they do not
come from the same dex instruction. This is the same check
as for moving the clinit check responsibility around.

Test: Added a regression test, run standard ART test suite
plus gcstress and ndebug modes on host and Nexus 9.

Bug: 29570861
Bug: 29321958

(cherry picked from commit c7591b4c0dd405a766f4d701deea6c3750101978)

Change-Id: I0f019c36dd991889caad2666e61bbcc6d9d9c91f
c7591b4c0dd405a766f4d701deea6c3750101978 29-Jun-2016 Vladimir Marko <vmarko@google.com> Fix merging HLoadClass with HNewInstance.

Do not merge HLoadClass with HNewInstance if they do not
come from the same dex instruction. This is the same check
as for moving the clinit check responsibility around.

Test: Added a regression test, run standard ART test suite
plus gcstress and ndebug modes on host and Nexus 9.

Bug: 29570861
Bug: 29321958
Change-Id: Id8b67492ec1f58326ca0509af3f5a57257e7aea3
fbb184a1c6df22d9302b32b55206396c8278edcf 13-Nov-2015 Vladimir Marko <vmarko@google.com> Fix ClinitCheck pruning.

Make sure we merge the ClinitCheck only with LoadClass and
HInvokeStaticOrDirect that is a part of the very same dex
instruction. This fixes incorrect stack traces from class
initializers (wrong dex pcs).

Rewrite the pruning to do all the ClinitCheck merging when
we see the ClinitCheck, instead of merging ClinitCheck into
LoadClass and then LoadClass into HInvokeStaticOrDirect.
When we later see an HInvokeStaticOrDirect with an explicit
check (i.e. not merged), we know that some other instruction
is doing the check and the invoke doesn't need to, so we
mark it as not requiring the check at all. (Previously it
would have been marked as having an implicit check.)

Remove the restriction on merging with inlined invoke static
as this is not necessary anymore. This was a workaround for
X.test():
invoke-static C.foo() [1]
C.foo():
invoke-static C.bar() [2]
After inlining and GVN we have
X.test():
LoadClass C (from [1])
ClinitCheck C (from [1], to be merged to LoadClass)
InvokeStaticOrDirect C.bar() (from [2])
and the LoadClass must not be merged into the invoke as this
would cause the resolution trampoline to see an inlined
frame from the not-yet-loaded class C during the stack walk
and try to load the class. However, we're not allowed to
load new classes at that point, so an attempt to do so leads
to an assertion failure. With this CL, LoadClass is not
merged when it comes from a different instruction, so we can
guarantee that all inlined frames seen by the stack walk in
the resolution trampoline belong to already loaded classes.

Change-Id: I2b8da8d4f295355dce17141f0fab2dace126684d
b554b5a5ae3cdc66969d61be20783a8af816206e 06-Nov-2015 Vladimir Marko <vmarko@google.com> Optimizing: Remove unused ArtMethod* input from HInvokeStaticOrDirect.

Change-Id: Iea99fa683440673ff517e246f35fade96600f229
94015b939060f5041d408d48717f22443e55b6ad 04-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Use HCurrentMethod in HInvokeStaticOrDirect.""

Fix was to special case baseline for x86, which does not have enough
registers to allocate the current method.

This reverts commit c345f141f11faad177aa9635a78088d00cf66086.

Change-Id: I5997aa52f8d4df373ae5ff4d4150dac0c44c4c10
c345f141f11faad177aa9635a78088d00cf66086 04-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Use HCurrentMethod in HInvokeStaticOrDirect."

Fails on baseline/x86.

This reverts commit 38207af82afb6f99c687f64b15601ed20d82220a.

Change-Id: Ib71018367eb7c6046965494a7e996c22af3de403
38207af82afb6f99c687f64b15601ed20d82220a 01-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use HCurrentMethod in HInvokeStaticOrDirect.

Change-Id: I0d15244b6b44c8b10079398c55da5071a3e3af66
e918d38535f210fe669eb3f18e7f286e5b687419 03-Jun-2015 Guillaume "Vermeille" Sanchez <guillaumesa@google.com> Add $noinline$ tag to make sure a method has not been inlined.

Change-Id: Ic166cf43be566a0fa44c3c9e1939f647806fc500
d23eeef3492b53102eb8093524cf37e2b4c296db 18-May-2015 Nicolas Geoffray <ngeoffray@google.com> Support for inlining methods that call/throw.

Mostly fixes here and there to make it working.

Change-Id: I1b535e895105d78b65634636d675b818551f783e
a06d66a4ee60926127b9498b7ff0b3e37a24fccf 28-May-2015 David Brazdil <dbrazdil@google.com> ART: Distinguish Checker lines from comments

In order to prevent tests passing due to lines with hard-to-spot
formatting errors begin ignored, e.g. by forgetting the colon after
"//CHECK", Checker will now require its assertions to start with "///"
or "##", respectivelly for Java and Smali. Such lines will never be
ignored and will fail the test unless successfully parsed.

Change-Id: I0da9a8f13eb96d950af8c85df17d1899a853a299
0ba218df92d2130295eccd2c564f8fdd2efc3a71 19-May-2015 Calin Juravle <calin@google.com> Remove unnecessary clinit checks

Bug: 20852802
Change-Id: Ia6db8017ac22d45456845704a69ddffcc6917f4e
c57397b2b87c7e6f28f4eee3c996d091e7dc0b01 15-May-2015 David Brazdil <dbrazdil@google.com> ART: Print C1vis lists as [v1,...,vN]

Checker interprets whitespace as a don't-care placeholder, making it
easier to write assertions which test only parts of the output (e.g.
"//CHECK: Add liveness:44" does not test the inputs or any other
attributes apart from "liveness").

However, since the GraphVisualizer prints lists with elements
separated by spaces ("[ v1 ... vN ]"), this allows for false positives
caused by an occurrence elsewhere in the output. For example, the
assertion: "//CHECK: [ x y ]" will match "[ x y ]" but also
"[ x a y b ]" or even "[ x ] abc [ y ]".

Switching to comma-separated lists works around this issue.

This patch updates all test files, fixes one false positive that this
change revealed (test 442, line 337) and two occurrences of a wrong
match (test 462, lines 121, 149).

Bug: 21189305
Change-Id: I3b22503be3d92529dac0b13f66bccbcfabea6721
c2c48ffdd623b4e58b34115d1521b0988a42b217 15-May-2015 David Brazdil <dbrazdil@google.com> ART: Change Checker syntax for variables

This patch changes the syntax for defining and referencing variables
from square brackets '[[VAR]]' to angle brackets '<<VAR>>'. This is
done in order to avoid clashes when matching against lists enclosed
in square brackets.

Change-Id: Ib9560b07bdc7bd641fd1eb6143c0063e0783f1eb
5f02c6caf9f38be49e655f8bdeeeb99b6faf9383 24-Apr-2015 Roland Levillain <rpl@google.com> Reduce the number of explicit clinit checks for static invokes.

Do not generate explicit clinit checks for static invokes
when the class of the called method is a super class of the
caller method's class (referrer class).

Change-Id: I86ba18facef261fbb71f7ed20867756630ed3c53
4c0eb42259d790fddcd9978b66328dbb3ab65615 24-Apr-2015 Roland Levillain <rpl@google.com> Ensure inlined static calls perform clinit checks in Optimizing.

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