History log of /art/runtime/art_method-inl.h
Revision Date Author Comments
c6ea7d00ad069a2736f603daa3d8eaa9a1f8ea11 02-Feb-2017 Andreas Gampe <agampe@google.com> ART: Clean up art_method.h

Clean up the header. Fix up other headers including the -inl file,
in an effort to prune the include graph. Fix broken transitive
includes by making includes explicit. Introduce new -inl files
for method handles and reference visiting.

Test: source build/envsetup.sh && lunch aosp_angler-userdebug && mmma art
Test: source build/envsetup.sh && lunch aosp_mips64-userdebug && mmma art
Change-Id: I8f60f1160c2a702fdf3598149dae38f6fa6bc851
b0c4ff350be0032e30772295c5fbe7922aa57466 17-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Gracefully handle bogus profiling info for inline caches.

Test: 643-checker-bogus-ic
Bug: 36371709

(cherry picked from commit 4c0b4bc2653be370c7ba9f34a39e29e60382dff1)

Change-Id: Ibe52c4091305d82c3a656b9d63fbad3792e41314
4c0b4bc2653be370c7ba9f34a39e29e60382dff1 17-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Gracefully handle bogus profiling info for inline caches.

Test: 643-checker-bogus-ic
Bug: 36371709
Change-Id: I2a52ac67a45a6bb5ddefb053a35e6edf5bc2da2f
f2f1c9dab95892ec2983f57185c2bb0fbce80f80 15-Mar-2017 Alex Light <allight@google.com> Revert "Revert "Refactor annotation code for obsolete methods.""

The number of InterruptedExceptions created during runtime shutdown is
sometimes inconsistent so we will filter those out of the test results.

This reverts commit 65e0775010121498a37fa26c64fcc5bb17a6c1b5.

Reason for revert: Fixed issue with test flakes

Bug: 31455788
Test: stress --cpu 60; while ./test/run-test --host 980; do; done

Change-Id: Idf53ea11ceec1f48c433da468b31092bf230de57
65e0775010121498a37fa26c64fcc5bb17a6c1b5 15-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Refactor annotation code for obsolete methods."

Test has flakes.
Bug: 31455788

This reverts commit 672a0b75c91af44749b1e946684e6a65a884d778.

Change-Id: If00ecbd31abe204bcaf8341eceb674e07c0ac8f2
672a0b75c91af44749b1e946684e6a65a884d778 10-Mar-2017 Alex Light <allight@google.com> Refactor annotation code for obsolete methods.

Reading annotations on obsolete ArtMethod* objects would cause
problems due to reading from the wrong dex file. We refactored that
code so now it always uses the correct dex file when reading
annotations. This was rarely a problem since obsolete ArtMethods are
only ever exposed to the runtime itself which rarely reads
annotations.

We also add a test for redefining Object.class. This is one of the
small number of classes where the runtime will read it's annotations
off of obsolete methods.

Bug: 31455788
Test: ./test/testrunner/testrunner.py --host -j40
Change-Id: I5f1c58464b89a7a9198a7b26b015b102a7dc9c2f
8d6768d47b66a688d35399d524ad5a5450e9d9d4 14-Mar-2017 Vladimir Marko <vmarko@google.com> Revert^6 "Hash-based dex cache type array."

Fixed ImageWriter to write class table also if it contains
only boot class loader classes. Added a regression test and
added extra checks for debug-build to verify that dex cache
types from app image are also in the class table. Removed
some unnecessary debug output.

Test: 158-app-image-class-table
Bug: 34839984
Bug: 30627598
Bug: 34659969

This reverts commit 0b66d6174bf1f6023f9d36dda8538490b79c2e9f.

Change-Id: I6a747904940c6ebc297f4946feef99dc0adf930c
bcd9b99d9613400e6de8f082778a64c1018511d9 13-Mar-2017 Vladimir Marko <vmarko@google.com> Revert^5 "Hash-based dex cache type array."

For app images, ImageWriter does not add boot image
classes to the app image class table even though it
keeps them in the dex caches. The reason for that is
unknown, the code looks OK.

Bug: 34839984
Bug: 30627598
Bug: 34659969

Also reverts "Improve debugging output for a crash."

This reverts commits
bfb80d25eaeb7a604d5dd25a370e3869e96a33ab,
8dd56fcb3196f466ecaffd445397cb11ef85f89f.

Test: testrunner.py --host
Change-Id: Ic8db128207c07588c7f11563208ae1e85c8b0e84
(cherry picked from commit 0b66d6174bf1f6023f9d36dda8538490b79c2e9f)
2f555967e54549d26ee74bd0303f8be5155f2e08 13-Mar-2017 Vladimir Marko <vmarko@google.com> Revert^5 "Hash-based dex cache type array."

For app images, ImageWriter does not add boot image
classes to the app image class table even though it
keeps them in the dex caches. The reason for that is
unknown, the code looks OK.

Bug: 34839984
Bug: 30627598
Bug: 34659969

Also reverts "Improve debugging output for a crash."

This reverts commits
bfb80d25eaeb7a604d5dd25a370e3869e96a33ab,
8dd56fcb3196f466ecaffd445397cb11ef85f89f.

Test: testrunner.py --host
Change-Id: Ic8db128207c07588c7f11563208ae1e85c8b0e84
(cherry picked from commit 0b66d6174bf1f6023f9d36dda8538490b79c2e9f)
0b66d6174bf1f6023f9d36dda8538490b79c2e9f 13-Mar-2017 Vladimir Marko <vmarko@google.com> Revert^5 "Hash-based dex cache type array."

For app images, ImageWriter does not add boot image
classes to the app image class table even though it
keeps them in the dex caches. The reason for that is
unknown, the code looks OK.

Bug: 34839984
Bug: 30627598
Bug: 34659969

Also reverts "Improve debugging output for a crash."

This reverts commits
bfb80d25eaeb7a604d5dd25a370e3869e96a33ab,
8dd56fcb3196f466ecaffd445397cb11ef85f89f.

Test: testrunner.py --host
Change-Id: Ic8db128207c07588c7f11563208ae1e85c8b0e84
b1106e2aa98105dec533cdac9074a8f0216a4106 23-Feb-2017 Andreas Gampe <agampe@google.com> ART: Add flag for ArtMethod class state checks

The checks, especially in GetAccessFlags, is expensive. To help
with running a debug build on devices, add a flag to be able to
turn the checks off.

Bug: 35644369
Test: m
Change-Id: I2a3db1a56986df8f4a8b2dc5bcb26e1bcaea0a24
bfb80d25eaeb7a604d5dd25a370e3869e96a33ab 14-Feb-2017 Vladimir Marko <vmarko@google.com> Revert^4 "Hash-based dex cache type array."

Added extra output to the abort message to collect more data
when we hit the crash. Added extra check when loading an app
image to verify that the class table isn't already broken.

Test: testrunner.py --host
Bug: 34839984
Bug: 30627598
Bug: 34659969

This reverts commit 5812e20ff7cbc8efa0b8d7486ada2f58840a6ad5.

Change-Id: I9bb442a184c236dcb75b3e42a095f39cd6bee59d
5812e20ff7cbc8efa0b8d7486ada2f58840a6ad5 14-Feb-2017 Mathieu Chartier <mathieuc@google.com> Revert^3 "Hash-based dex cache type array."

Assert failing for "earchbox:search":
F zygote64: class_linker.cc:4612] Check failed: handle_scope_iface.Get() != nullptr

Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969

This reverts commit 85c0f2ac03417f5125bc2ff1dab8109859c67d5c.

Change-Id: I39846c20295af5875b0f945be7035c73ded23135
85c0f2ac03417f5125bc2ff1dab8109859c67d5c 02-Feb-2017 Vladimir Marko <vmarko@google.com> Revert^2 "Hash-based dex cache type array."

The reason for the revert was fixed by
https://android-review.googlesource.com/332666 .
We now enable clearing dex cache types in test 155 from that
CL. Also avoid an unnecessary store in LookupResolvedTypes()
and prevent verifier from messing up the dex cache types.

Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969

This reverts commit d16363a93053de0f32252c7897d839a46aff14ae.

Change-Id: Ie8603cfa772e78e648d005b0b6eae59062ae729d
90c5a9b889af84cbb840c60e461d5bdbf8dc0df6 01-Feb-2017 Mathieu Chartier <mathieuc@google.com> Various improvements to stack walking speed

Make BitMemoryRegion constructor inlined, remove read barrier
for IsProxyMethod.

Around 15% speedup for pmd benchmark, maybe more for CC.

Test: test-art-host

Change-Id: Ib4392649e041406e538cc944c26c69f68d388fb4
e0a1c5e871d7b68bd7c0e9c4496b620577a97cf9 01-Feb-2017 Vladimir Marko <vmarko@google.com> Revert "Hash-based dex cache type array."

Reverting to work around some programs crashing with
Check failed: handle_scope_iface.Get() != nullptr.
though the reason for the failure not yet understood.

Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969
Bug: 30419309

This reverts commit ec7862283dd49f5a58d0ac45960ce27c2f7671b8.

Change-Id: Ifded663633082f1e59e5b6ff2e026dc559bd6b82
(cherry picked from commit d16363a93053de0f32252c7897d839a46aff14ae)
80cd4004620fd1a672c2a550e9d71270feeabde9 01-Feb-2017 Vladimir Marko <vmarko@google.com> Revert "Hash-based dex cache type array."

Reverting to work around some programs crashing with
Check failed: handle_scope_iface.Get() != nullptr.
though the reason for the failure not yet understood.

Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969
Bug: 30419309

This reverts commit ec7862283dd49f5a58d0ac45960ce27c2f7671b8.

Change-Id: Ifded663633082f1e59e5b6ff2e026dc559bd6b82
(cherry picked from commit d16363a93053de0f32252c7897d839a46aff14ae)
d16363a93053de0f32252c7897d839a46aff14ae 01-Feb-2017 Vladimir Marko <vmarko@google.com> Revert "Hash-based dex cache type array."

Reverting to work around some programs crashing with
Check failed: handle_scope_iface.Get() != nullptr.
though the reason for the failure not yet understood.

Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969
Bug: 30419309

This reverts commit ec7862283dd49f5a58d0ac45960ce27c2f7671b8.

Change-Id: Ifded663633082f1e59e5b6ff2e026dc559bd6b82
ec7862283dd49f5a58d0ac45960ce27c2f7671b8 20-Dec-2016 Vladimir Marko <vmarko@google.com> Hash-based dex cache type array.

Test: m test-art-host (Interpreter, Optimizing, JIT)
Test: m test-art-target on Nexus 6P (Interpreter, Optimizing, JIT)
Test: Nexus 6P boots
Test: m valgrind-test-art-host
Bug: 30627598
Bug: 34659969
Bug: 30419309
Change-Id: Ic00eda89e58088a3573fc9ec0ad04c0e69e161d1
137cdfa1e8a3810fb86d3298ec10036c0491d13f 26-Jan-2017 Mathieu Chartier <mathieuc@google.com> Avoid read barriers for ArtMethod::GetDexFile

Shows up in pmd benchmark from Class::FindDeclaredDirectMethod and
Class::FindDeclaredVirtualMethod. There are still calls to
IsProxyMethod that could probably be eliminated.

ReadBarrier::Mark goes from 12.39% to 3.45% according to perf.

Test: test-art-host

Change-Id: I6a4f2fa2d68bf5f393f83b9b70e8d6fcc9dbdaa2
72ab684871f870aead76b23cb67deb046107b380 20-Jan-2017 Vladimir Marko <vmarko@google.com> Add class status for resolved erroneous classes.

Split the old ambiguous status mirror::Class::kStatusError
into kStatusErrorUnresolved and kStatusErrorResolved. Once
a class has been resolved, IsResolved() shall return true
even if the class later becomes erroneous. Allow returning
erroneous class from ClassLinker::EnsureResolved() if it has
been previously resolved. This allows consistent behavior
for retrieving classes, immune to multi-threaded races and
multi-dex weirdness. It also allows JVMTI to properly report
"prepared" (i.e. resolved) classes that are also erroneous.

The new behavior is consistent with the RI.

Add regression tests to 008-exceptions for inconsistent
behavior for multi-dex retrieval of erroneous resolved class
(wrapping or not wrapping the old exception based on which
dex file is used for lookup) and for a CHECK(IsResolved())
crash in ClassLinker::LoadSuperAndInterfaces() (without any
tests for similar checks that could have previously failed
only due to extremely unlikely race conditions; these should
now also be fixed).

Inconsistency still remains for class verification as shown
by the new exceptionsForSuperClassInitFailure() test in
008-exceptions, where interpreter and Optimizing still
cause different exceptions to be thrown.

Note: This is partially changing behavior implemented for
bug 28787733. Since we allow the class loader to retrieve an
erroneous resolved class, the ExceptionInInitializerError is
not thrown at all from VMClassLoader_findLoadedClass(), so
there is nothing to wrap in ClassNotFoundException.

Test: m test-art-host
Bug: 30627598
Bug: 28787733
Change-Id: I86cdca00f35a0d6221d2559e3026ac0428a3613c
9cd522b50a5f0209e97a2e6bcf8c9c350d3f3f83 18-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Remove now unused dex_cache_resolved_types_ from ArtMethod.

Test: test-art-host test-art-target
Change-Id: I004c040da165934f74eb8b8e85e99e7c6621c2df
942fd3130254d8276cbfe8e6201825e9c49e9b2c 16-Jan-2017 Vladimir Marko <vmarko@google.com> Reduce using ArtMethod's dex_cache_resolved_types_.

Avoid using the ArtMethod's dex cache type array shortcut
in runtime, preparing for its removal. We do not completely
remove the shortcut yet because it is still used by array
allocation entrypoints.

Fix ArgArray::BuildArgArrayFromObjectArray in reflection.cc
to not ask for the parameter type to be resolved. It should
have been previously resolved when retrieving the Method.

Also partially revert
https://android-review.googlesource.com/310717
because it relied on the removed AIOOBE check in the removed
ArtMethod::GetDexCacheResolvedType(). The removed check was
simply defensive but it could not be triggered without some
memory corruption.

Test: m test-art-host
Bug: 30627598
Change-Id: Ic45a5ff8c66b79429e440cbc08d67bf22a083682
5d37c152f21a0807459c6f53bc25e2d84f56d259 12-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Put inlined ArtMethod pointer in stack maps.

Currently done for JIT. Can be extended for AOT and inlined boot
image methods.

Also refactor the lookup of a inlined method at runtime to not
rely on the dex cache, but look at the class loader tables.

bug: 30933338
test: test-art-host, test-art-target
Change-Id: I58bd4d763b82ab8ca3023742835ac388671d1794
dba61481035b7944173181ec9ee02aea41dd0e29 21-Dec-2016 Alex Light <allight@google.com> Revert "Revert "Revert "Revert "Basic obsolete methods support""""

A GetDeclaringClass()->GetDexCache() got inserted during the
merge/review process meaning that we would try to access incorrect
dex-cache in obsolete methods in some situations.

Also when using tracing we would loop forever (or at least until an
OOM error) in test 916 due to tracing forcing InterpretOnly mode
meaning methods would never be jitted.

Bug: 32369913
Bug: 33630159

Test: ART_TEST_TRACE=true \
ART_TEST_JIT=true \
ART_TEST_INTERPRETER=true mma -j40 test-art-host

This reverts commit f6abcda293b115a9d7d8a26376ea2dcf2d1dc510.

Change-Id: I0773bfcba52e3cd51a83be815c6a50c189558f48
f6abcda293b115a9d7d8a26376ea2dcf2d1dc510 21-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "Basic obsolete methods support"""

Fails in tracing mode

Bug: 32369913
Bug: 33630159

This reverts commit ce77fc0e7f60a15354bb20c356537cbf8b53b722.

Change-Id: I1bdcf6ad467f2e31f9c5d0c3c987b90a4f5efc69
ce77fc0e7f60a15354bb20c356537cbf8b53b722 15-Dec-2016 Alex Light <allight@google.com> Revert "Revert "Basic obsolete methods support""

This reverts commit b81a9840b44480bfeacd74b8d9f51e06f295411d.

There were 2 issues with the original CL's test 916-obsolete-jit that
caused it to sporadically fail.

First, when checking if we had jitted the function under test in
916-obsolete-jit we failed to check to see if the function 'doCall',
which is used to work-around bugs in our deoptimization & compilation
systems, had also been jitted.

In the case where the 'sayHi' function had been jitted but the
'doCall' function had not we would (correctly) fail to redefine the
'Transform' class since we would not be able to deoptimize the 'sayHi'
function since it is under a quick_to_interpreter_bridge (runtime)
frame.

Secondly, the function Main.isInterpretedFunction was incorrect and
would always return false, regardless of the actual state of the
function. This would cause the test to fail as the
quick_to_interpreter_bridge frame prevented deoptimization of the
obsoleted function. Usually the warm-up period was enough to make sure
the methods were jitted anyway but this was not guaranteed.

Both of these problems become more likely to occur on systems with
more cpu contention such as the buildbots.

Test: stress --cpu 60 &; while ./test/run-test --host --jit 916; do ; done

Reason for revert: Fixed bug in test that was causing failures.

Original Tests:

Test: ./test/run-test --host 914
Test: ./test/run-test --host 915
Test: ./test/run-test --host 916
Test: mma -j40 test-art-host
Test: ART_TEST_JIT=true \
ART_TEST_INTERPRETER=true mma -j40 test-art-host
Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64
Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 --no-jit

Bug: 32369913
Bug: 33630159

Change-Id: If1a92e47b90965a7dc21c5826185debe62bd1554
b81a9840b44480bfeacd74b8d9f51e06f295411d 15-Dec-2016 Alex Light <allight@google.com> Revert "Basic obsolete methods support"

This reverts commit d8936da27b792d1ca02e59c92456a1a53c7b9905.

Reason for revert: Some sort of race in JIT

Change-Id: Ibb4e520bb0721d6d7aa2c841a52eb5baff07740e
d8936da27b792d1ca02e59c92456a1a53c7b9905 29-Nov-2016 Alex Light <allight@google.com> Basic obsolete methods support

Add support for executing obsolete methods following redefinitions.
This support includes methods that have been jitted. This does not add
any additional validity checks to our redefinition functions.

Note using work-arounds to ensure 916 works pending some fixes to the
compiler, deoptimizer, or both.

Test: ./test/run-test --host 914
Test: ./test/run-test --host 915
Test: ./test/run-test --host 916
Test: mma -j40 test-art-host
Test: ART_TEST_JIT=true \
ART_TEST_INTERPRETER=true mma -j40 test-art-host
Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64
Test: ./art/tools/run-jdwp-tests.sh --mode=host --variant=X64 --no-jit

Bug: 32369913
Bug: 33630159

Change-Id: I78ef95f484146f1fb93c37fc50f56575bdab2432
063fc772b5b8aed7d769cd7cccb6ddc7619326ee 02-Aug-2016 Mingyao Yang <mingyao@google.com> Class Hierarchy Analysis (CHA)

The class linker now tracks whether a method has a single implementation
and if so, the JIT compiler will try to devirtualize a virtual call for
the method into a direct call. If the single-implementation assumption
is violated due to additional class linking, compiled code that makes the
assumption is invalidated. Deoptimization is triggered for compiled code
live on stack. Instead of patching return pc's on stack, a CHA guard is
added which checks a hidden should_deoptimize flag for deoptimization.
This approach limits the number of deoptimization points.

This CL does not devirtualize abstract/interface method invocation.

Slides on CHA:
https://docs.google.com/a/google.com/presentation/d/1Ax6cabP1vM44aLOaJU3B26n5fTE9w5YU-1CRevIDsBc/edit?usp=sharing

Change-Id: I18bf716a601b6413b46312e925a6ad9e4008efa4
Test: ART_TEST_JIT=true m test-art-host/target-run-test test-art-host-gtest
a01de59eef990c07df9815376cd3c675e3acd481 15-Nov-2016 Alex Light <allight@google.com> Infrastructure for obsolete methods

This adds some of the structures and functions needed to eventually
support obsolete methods. Specifically this adds the code to create
and iterate through the obsolete dex-cache maps of classes and
re-organizes the redefinition code to be more sensible and extensible.

Bug: 32369913
Test: ./test/run-test --host 902
Test: mma -j40 test-art-host

Change-Id: I93d60fa66e7512e8b059cdf42af8a56e93ef4bd7
e51ca8bfa8a193b64901ad214842f213adca92eb 22-Nov-2016 Nicolas Geoffray <ngeoffray@google.com> Move inline caches GC handling in JitCodeCache.

Make the classes they hold weak references and visit
them during SweepJitRoots.

This fixes the newly introduced deadlock:

Thread1:
1) Lock JitCodeCache lock to create Profiling info for
ArtMethod m.
2) m is a copied method, we need to track the actual holder,
needing to decode a weak reference.
3) Weak references are not accessible due to GC.

GC Thread:
- Disallow weak reference access.
- Wait for checkpoint.

Thread2:
- Try to lock JitCodeCache lock
- Deadlock, as Thread1 owns the JitCodeCache lock.

Test: test-art-host
bug: 31289185
bug: 33198826

Change-Id: I7ee17631015450ace8d2a0264415a81c5a902bb8
a5b09a67034e57a6e10231dd4bd92f4cb50b824c 18-Nov-2016 Andreas Gampe <agampe@google.com> ART: Add dex::TypeIndex

Add abstraction for uint16_t type index.

Test: m test-art-host
Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a
28357fab628bd9b91749988b554977398caf9963 19-Oct-2016 Mathieu Chartier <mathieuc@google.com> Move most of class linker to ObjPtr

Return values are still mirror pointer. Fix some failing asserts in
compiler driver and tests.

Bug: 31113334

Test: test-art-host

Change-Id: I4450bf9dfb2541749496b8388616e8aae8488919
709b070044354d9f47641f273edacaeeb0240ab7 13-Oct-2016 David Sehr <sehr@google.com> Remove mirror:: and ArtMethod deps in utils.{h,cc}

The latest chapter in the ongoing saga of attempting to dump a DEX
file without having to start a whole runtime instance. This episode
finds us removing references to ArtMethod/ArtField/mirror.

One aspect of this change that I would like to call out specfically
is that the utils versions of the "Pretty*" functions all were written
to accept nullptr as an argument. I have split these functions up as
follows:
1) an instance method, such as PrettyClass that obviously requires
this != nullptr.
2) a static method, that behaves the same way as the util method, but
calls the instance method if p != nullptr.
This requires using a full class qualifier for the static methods,
which isn't exactly beautiful. I have tried to remove as many cases
as possible where it was clear p != nullptr.

Bug: 22322814
Test: test-art-host
Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
d6e0fa923dfe85c363408844b35e30ddcd65e199 17-Oct-2016 Alex Light <allight@google.com> Fix invoke-virtual not throwing ICCE in some cases

Due to an oversight invoke-virtual on an interface method would
not cause an ICCE to be thrown if the target method is default. This
could potentially cause incorrect methods to be called at runtime.

Bug: 32201623
Test: mma test-art-host-run-test-978-virtual-interface
Change-Id: Ie565cf2fbe8602b17be0fb051e21d221a17b518f
0795f23920ee9aabf28e45c63cd592dcccf00216 28-Sep-2016 Mathieu Chartier <mathieuc@google.com> Clean up ScopedThreadStateChange to use ObjPtr

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
75a7db67f0e56bc0ccc63df4a6a1bb04ab3e86b1 26-Sep-2016 Andreas Gampe <agampe@google.com> ART: Factor out IMT from ArtMethod

Move IMT Conflict Table to its own file. Move IMT index computation to
ImTable.

In preparation for code using this independent of specific ArtMethods.

Bug: 31594153
Test: m test-art-host
Change-Id: Ifd6e304bb86724c5284984c4655c43d3af357f84
9323e6e44060545d6c4f925139572868f65b7fe3 13-Sep-2016 David Sehr <sehr@google.com> Separate annotations from dexfile reading.

Bug: 22322814
Change-Id: I867d66da407dd80394a10d19903ebbc1ec3986ff
Test: test-art
fd36f1f927c138575184a1f4c7ea4e7abb3e2dbf 03-Aug-2016 Vladimir Marko <vmarko@google.com> Rename callee save enumerators.

And related image method enumerators, macros, etc.
Clean up some entrypoint assembly comments.

This is a follow-up to
https://android-review.googlesource.com/252348

Test: Run ART test suite on host and Nexus 9.
Bug: 30212852
Change-Id: I2707342d4255c88c547655be83ed97a67e12ae9e
542451cc546779f5c67840e105c51205a1b0a8fd 26-Jul-2016 Andreas Gampe <agampe@google.com> ART: Convert pointer size to enum

Move away from size_t to dedicated enum (class).

Bug: 30373134
Bug: 30419309
Test: m test-art-host
Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
10b218d32c0006aab747a53a9867d982cde9c938 26-Jul-2016 Mathieu Chartier <mathieuc@google.com> Add missing filter cards to zygote mod union table

Without filtering the cards, every object in the zygote is grayed
during the GC. This was deleted in a PS of previous CL.

GrayAllDirtyImmuneObjects goes from 1.974ms to 376.464us for CC on
N9 maps. This happens during the pause. This CL also fixes regression
in zygote PSS.

Bug: 29516968
Bug: 12687968

Change-Id: I42014e78b1de3ce9b2eefa3bd32f0d24e2ff71c6
75f0885d7c3d72a0351912b6d47682e1c860efdf 19-Jul-2016 Andreas Gampe <agampe@google.com> ART: Rename ArtMethod JNI field

The field is multi-purpose, rename it to data and clean up
accessors in preparation of more checks.

Test: m test-art-host
Change-Id: Ib4b84b7b1a51ca201544bc488ce8770aa858c7fd
465ecc86ff65ca546629630c9469deb6d2d8137e 19-Jul-2016 Matthew Gharrity <gharrma@google.com> Revert "Revert "Refactor GetIMTIndex""

Originally reverted in order to revert
https://android-review.googlesource.com/#/c/244190/
but can now be merged again.

This reverts commit d4ceecc85a5aab2ec23ea1bd010692ba8c8aaa0c.

Test: m test-art-host

Change-Id: Id9205f2b77a378fc0f06088e78c66e81a49f712d
d4ceecc85a5aab2ec23ea1bd010692ba8c8aaa0c 29-Jun-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Refactor GetIMTIndex"

I need to revert this to get https://android-review.googlesource.com/#/c/244190/ to cleanly revert. Matthew, do you mind rewriting it?

This reverts commit 50706437d8216e41f0fea1e413cda7891324d397.

Change-Id: I5c1435f5dffb46dbb5b613b22adb88c7770304f2
50706437d8216e41f0fea1e413cda7891324d397 14-Jun-2016 Matthew Gharrity <gharrma@google.com> Refactor GetIMTIndex

This allows us to more easily maintain and experiment with
interface method table indexing and hashing.

Change-Id: I719920fae7490dcedcda7c1c36db225c2b8b16df
7a62e6728463237684d3d9834d81bd7bba7ab197 11-Jun-2016 Hiroshi Yamauchi <yamauchi@google.com> Propagate the read barrier option to Class::VisitNativeRoots.

Propagate the read barrier option from Object::VisitReferences to
Class::VisitNativeRoots.

This is a step toward the GC thread avoiding graying objects (and
reducing dirty pages) in the immune spaces.

Bug: 12687968

Change-Id: I29c4126a4ad4c40e63a934e62451fb3fb36aad43
e128d749ce7c1f88ba3e66223d8c69f9dc9255ae 04-May-2016 Nicolas Geoffray <ngeoffray@google.com> Check if a class is verified before visiting profiling info.

The call to IsNative expects non-retired classes, and we know
we don't have any profiling info for non-verified classes anyway.

bug:28542527

(cherry picked from commit 022dd86f9c1fd63dfd7e052a876289387393a78f)

Change-Id: I247ce08b6996bdae526a5e106dacdbb7b70504af
022dd86f9c1fd63dfd7e052a876289387393a78f 04-May-2016 Nicolas Geoffray <ngeoffray@google.com> Check if a class is verified before visiting profiling info.

The call to IsNative expects non-retired classes, and we know
we don't have any profiling info for non-verified classes anyway.

bug:28542527
Change-Id: I5bb9528a8d357bc8940c2190e2cde33a13df3e8d
796d63050a18f263b93ea34951a61deaecab3422 13-Mar-2016 Nicolas Geoffray <ngeoffray@google.com> Add an ImtConflictTable to better resolve IMT conflicts.

- Attach a ImtConflictTable to conflict runtime ArtMethod.
- Initially 0, a new one will be created at the first hit of
the conflict method.
- If the assembly code does not find a target method in the table,
we will create a new one again, copying the data from the previous
table and adding the new mapping.

Implemented for arm/arm64/x86/x64.

bug:27556801
bug:24769046

Change-Id: Ie74d1c77cf73d451a1142bdc5e3683f9f84bb4e7
daf58c80d42f024aae0cb94ebd2c0bd61ebbf240 17-Mar-2016 Alex Light <allight@google.com> Revert "Fix issue with proxy invocation on default methods"

This reverts commit ec3b7ab8f008f36f1072d4ba03da204229b95976.

Change-Id: Idfb2c63c246cc5dae7670503e70ad3f62bb1e1eb
7670908bb4a19649e0d60296d5adb3f05e9fea86 16-Mar-2016 Alex Light <allight@google.com> Revert "Fix issue with proxy invocation on default methods"

This reverts commit 4b34bf5b242dce5ee20db08b7781bbbaf0d25969.

Change-Id: If072fdbaafd0ee1877e8281a83ba4a598adb3355
4b34bf5b242dce5ee20db08b7781bbbaf0d25969 15-Mar-2016 Alex Light <allight@google.com> Fix issue with proxy invocation on default methods

Bug: 27621360

(cherry picked from commit ec3b7ab8f008f36f1072d4ba03da204229b95976)

Change-Id: I617eee243f475872235fd75b6a401e056111ea23
ec3b7ab8f008f36f1072d4ba03da204229b95976 15-Mar-2016 Alex Light <allight@google.com> Fix issue with proxy invocation on default methods

Bug: 27621360

Change-Id: I617eee243f475872235fd75b6a401e056111ea23
0b4cbd0c2a75b47ae09d21e5d73d2b1709cb5b9e 09-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add oatdump support for app images

Example usage on host:
oatdumpd --app-oat=art/plus32.odex --app-image=art/plus32.art
--image=art/oats/system@framework@boot.art --instruction-set=arm

TODO: Add to oatdump test.

Bug: 27408512
Bug: 22858531

(cherry picked from commit bcb6a72569a1401b36a3ad3b6aa4d13e29966cf0)

Change-Id: I9d1aa7eaa16795e5fbabc6974d245849e16b1d03
bcb6a72569a1401b36a3ad3b6aa4d13e29966cf0 09-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add oatdump support for app images

Example usage on host:
oatdumpd --app-oat=art/plus32.odex --app-image=art/plus32.art
--image=art/oats/system@framework@boot.art --instruction-set=arm

TODO: Add to oatdump test.

Bug: 27408512
Bug: 22858531

Change-Id: I320db8b76c780c6eadabcb45ce88f45950741484
b79eb75ba5671b787ac0622ded2de970f8f0d2c1 07-Mar-2016 Hiroshi Yamauchi <yamauchi@google.com> Revert "ProfilingInfo roots should be visited by the declaring class."

This reverts commit 9a3be989d0aee1a6998e33813c7f70906d27f89a.

Superceded by CL 206308.

Bug: 27435111
9a3be989d0aee1a6998e33813c7f70906d27f89a 04-Mar-2016 Nicolas Geoffray <ngeoffray@google.com> ProfilingInfo roots should be visited by the declaring class.

There seems to be an implicit assumption that only classes can
visit native roots (ie kVisitNativeRoots in Class::VisitReferences).
However, some places like Dbg::VisitRoots and
AllocRecordObjectMap::VisitRoots visit ArtMethod::VisitRoot
directly, and that breaks the assumptions.

bug:27435111
Change-Id: I5b476e614ba820394635d946cb562bf872a50e7e
dec3a12c45e160097e6938be3778a6175113c42f 13-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Don't call IsNative if the declaring class can be null.

There's a check down below the IsNative call that makes
sure the declaring class is not null.

Change-Id: I744bf01105eadeea9893ae626970c4b6b2f64a8b
87170e764119d23caf5f0b319f8bf2ab6b4e974b 07-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Always visit ProfilingInfo, the counter could be reset.

The counter could be reset or overflow, but we may have
inline caches populated.

bug:26775558

(cherry picked from commit ef404468d727332b088e6d461d0cf2f0ce0a897a)

Change-Id: Ib0cc8da05aa75d50c0474a1ddcb88cd60ae34707
ef404468d727332b088e6d461d0cf2f0ce0a897a 07-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Always visit ProfilingInfo, the counter could be reset.

The counter could be reset or overflow, but we may have
inline caches populated.

bug:26775558
Change-Id: I0566b6b4a7bf8dfb3411492c0413eafbf39da7c3
e7f75f35371cf32954d94f9bb10fc96924f7edb4 02-Feb-2016 Mathieu Chartier <mathieuc@google.com> Add read barrier option to UpdateEntrypoints

Also call this without read barrier for image relocation.

Bug: 26786304
Change-Id: Ia718c1491b54cadb7283c62afc1eb9031a15b4ef
fbc31087932a65e036a153afab3049dc5298656a 24-Jan-2016 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Load app images""

This reverts commit 1bc977cf2f8199311a97f2ba9431a184540e3e9c.

Bug: 22858531

Change-Id: Ide00bf3a73a02cba3bb364177204ad1b13f70295
1bc977cf2f8199311a97f2ba9431a184540e3e9c 23-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Load app images"

Fails when a method is duplicated (see test 097-duplicate-method)

Bug: 22858531

This reverts commit f7fd970244f143b1abb956e29794c446e4d57f46.

Change-Id: Ib30ae5be00cc568e799290be6b3c8f29cbbe4c20
f7fd970244f143b1abb956e29794c446e4d57f46 09-Nov-2015 Mathieu Chartier <mathieuc@google.com> Load app images

Support in-place patching of the app image based on boot image
location and app oat location. Only loads for art run test so far
since we do not automatically generate app images for app installs.

N5 maps launch time (~200 runs):
Before: 930ms
After: 878.18ms
After + image class table: 864.57ms

TODO:
Oatdump support.
Store class loaders as class roots in image.

Bug: 22858531

Change-Id: I9cbc645645e62ea2ed1ad8e139e91af7d88514c1
705ad49f353d3f90d8b63625aca2c2035bacdbef 21-Sep-2015 Alex Light <allight@google.com> Support directly invoking interface default methods

With the Java 8 Language one is allowed to directly call default
interface methods of interfaces one (directly) implements through the
use of the super keyword. We support this behavior through the
invoke-super opcode with the target being an interface.

We add 3 tests for this behavior.

Currently only supports slow-path interpreter.

Invoke-super is currently extremely slow.

Bug: 24618811

Change-Id: I7e06e17326f7dbae0116bd7dfefca151f0092bd2
a7a4759946d9f11c88dc108b2b6a9518ce9c1e18 24-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "lambda: Add support for invoke-interface for boxed innate lambdas"

955-lambda is flaky

Bug: 24618608
Bug: 25107649

This reverts commit 457e874459ae638145cab6d572e34d48480e39d2.

(cherry picked from commit 3a0909248e04b22c3981cbf617bc2502ed5b6380)

Change-Id: I24884344d21d7a4262e53e3f5dba57032687ddb7
3a0909248e04b22c3981cbf617bc2502ed5b6380 24-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "lambda: Add support for invoke-interface for boxed innate lambdas"

955-lambda is flaky

Bug: 24618608
Bug: 25107649

This reverts commit 457e874459ae638145cab6d572e34d48480e39d2.

Change-Id: I24884344d21d7a4262e53e3f5dba57032687ddb7
457e874459ae638145cab6d572e34d48480e39d2 23-Oct-2015 Igor Murashkin <iam@google.com> lambda: Add support for invoke-interface for boxed innate lambdas

Lambda closures created with the 'create-lambda' instruction
(termed "innate lambdas") can be turned into an object with 'box-lambda'.

This CL enables support for those kinds of lambdas to work with
'invoke-interface' by generating a proxy class for the lambda.

Note: MIPS32/64 support not included.

Bug: 24618608
Bug: 25107649
Change-Id: Ic8f1bb66ebeaed4097e758a50becf1cff6ccaefb
22cf3d361695ff1d585a8a412ebeade69749811f 02-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Fix tests flakiness with jit when using Proxy classes.

We cannot copy the entry point between ArtMethod when
the entry point has been JITted. We put the interpreter
bridge instead.

bug:25334878

Change-Id: I65a50cc1f10a5a152733807f8c85fb3ed81c5829
eb7c144a6aff7da673ba53d501c46f00311d4d7f 31-Aug-2015 Alex Light <allight@google.com> Add initial default method support to Art

This commit starts the process of adding default methods and their
associated pieces to ART.

This adds full support for calling default methods using
invoke-interface and invoke-virtual on objects implementing the
interfaces. Verifier is changed to allow this when the runtime is
started with -Xexperimental:default-methods.

This also adds support for defining and calling static methods on
interface classes with invoke-static.

Directly calling overridden default methods using invoke-super is not
yet supported.

This adds 5 new run-tests for this functionality.

Bug: 24618811

Change-Id: I35ca800d99d3329348b277789b70ceeeba6e7f03
6bc4374e3fa00e3ee5e832e1761c43e0b8a71558 12-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Add an abstraction over a compiled code.

That's just step 1, moving code-related functions of ArtMethod to
another class. That class is only a wrapper on an ArtMethod, but will
be changed to be a wrapper around compiled code.

Change-Id: I6f35fc06d37220558dff61691e51ae20066b0dd6
cbc96b802f505ebcc71bb505c9a069ebec66df49 30-Sep-2015 Andreas Gampe <agampe@google.com> Revert "Revert "ART: Remove unnecessary SHARED_REQUIRES in ArtMethod""

This reverts commit 38b8287004770e4d20dcc0e0fe4697060917ec72.

Do not always use ScopedObjectAccess. The GC might call this during
sanity checking, at which point the state is not runnable, but the
mutator lock is still held.

Currently needs an ugly NO_THREAD_SAFETY_ANALYSIS helper, as the
assert isn't correctly handled (establishing the held mutator lock).

Change-Id: Ie79e85e2afedc9b989382d88155b09e426fe7f75
38b8287004770e4d20dcc0e0fe4697060917ec72 30-Sep-2015 Andreas Gampe <agampe@google.com> Revert "ART: Remove unnecessary SHARED_REQUIRES in ArtMethod"

This reverts commit 6dd332933a570f5e413dd0d784481607798fbcf5.

Interestingly fails for sdk build.

Change-Id: I28d8fc05575ff1d744b4a831c32ef4414775561a
6dd332933a570f5e413dd0d784481607798fbcf5 29-Sep-2015 Andreas Gampe <agampe@google.com> ART: Remove unnecessary SHARED_REQUIRES in ArtMethod

Move DCHECKs in GetAccessFlags into their own block and let them
acquire the mutator lock, if necessary. Then remove the old
annotations.

Change-Id: I29e24f17b001d0e16dc66c01a0f6450efb64ebc6
1147b9bd68323c753ed1a0b6106b205fd640c820 15-Sep-2015 Mathieu Chartier <mathieuc@google.com> Use image pointer size for profile info

May fix some random crashes in dex2oat due to cross compilation.

Change-Id: I633652500e8c7dfec38044dffd07eb467973d82a
5550ca8bcc742b109d77e62f3a0877c667d894d3 21-Aug-2015 Nicolas Geoffray <ngeoffray@google.com> Record profiling information before Jitting.

- Add a new instrumentation kind to record dynamic invokes.
- Use the JNI entry point field to store the profiling data.
- Record seen receivers for every dynamic invoke.

Change-Id: I2c1738ab2a72052d45964d055dc16b44b906e54c
05792b98980741111b4d0a24d68cff2a8e070a3a 03-Aug-2015 Vladimir Marko <vmarko@google.com> ART: Move DexCache arrays to native.

This CL has a companion CL in libcore/
https://android-review.googlesource.com/162985

Change-Id: Icbc9e20ad1b565e603195b12714762bb446515fa
00370827646cc21cb370c3e7e93f9c0cff4c30c2 18-Aug-2015 Hiroshi Yamauchi <yamauchi@google.com> Use thread-local is_gc_marking flags for the CC collector.

The currently global is_marking flag is used to check if the read
barrier slow path needs to be taken for GC roots access. Changing it
to a thread-local flag simplifies the fast path check and makes it
easier to do it in assembly code. It also solves the issue that we
need to avoid accessing the global flag during startup before the heap
or the collector object isn't allocated and initialized.

Bug: 12687968
Change-Id: Ibf0dca12f400bf3490188b12dfe96c7de30583e0
14632857428b7e37761e6e811c19021715a400f8 17-Aug-2015 Vladimir Marko <vmarko@google.com> ART: Rename ArtMethod's size and alignment methods.

Remove the historical prefix "Object" to avoid confusion
with Java objects.

Change-Id: Ib36422c9a24878d8d4bd757977d99cbf66b3d567
10e5ea90e20375e5ad2ff26cb760c0e7c586cc16 13-Aug-2015 Mathieu Chartier <mathieuc@google.com> Visit declaring class of methods on call stack

Bug: 22720414
Change-Id: Iab9727dde243d76fd9dfdb1db73899fedd1ab6ea
bfbb72ed414688d070fab5c35d652def5ea6361d 18-Jul-2015 Mathieu Chartier <mathieuc@google.com> Don't check code pointer for proxies in ArtMethod::GetQuickFrameInfo

(cherry picked from commit 7c0fe5e99d1d150b3072a3ae4cd0f0362fe32834)

Bug: 22541058

Change-Id: Id084a69ccd9835147ec71df6bb759e0f1b5e6fbf
7c0fe5e99d1d150b3072a3ae4cd0f0362fe32834 18-Jul-2015 Mathieu Chartier <mathieuc@google.com> Don't check code pointer for proxies in ArtMethod::GetQuickFrameInfo

Bug: 22541058

Change-Id: Id084a69ccd9835147ec71df6bb759e0f1b5e6fbf
3f64f25151780fdea3511be62b4fe50775f86541 13-Jun-2015 Hiroshi Yamauchi <yamauchi@google.com> Print more diagnosis info on to-space invariant violation.

Pass the method/field (in GcRootSource) to the read barrier to print
more info when a to-space invariant violation is detected on a
method/field GC root access.

Refactor ConcurrentCopying::AssertToSpaceInvariant().

Bug: 12687968
Bug: 21564728

Change-Id: I3a5fde1f41969349b0fee6cd9217b948d5241a7c
3d21bdf8894e780d349c481e5c9e29fe1556051c 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997

(cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33)

Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d

Fix some ArtMethod related bugs

Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.

Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.

Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.

TODO: Fix JDWP tests.

Bug: 19264997

Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3

ART: Fix casts for 64-bit pointers on 32-bit compiler.

Bug: 19264997
Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457

Fix JDWP tests after ArtMethod change

Fixes Throwable::GetStackDepth for exception event detection after
internal stack trace representation change.

Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of
proxy method.

Bug: 19264997
Change-Id: I363e293796848c3ec491c963813f62d868da44d2

Fix accidental IMT and root marking regression

Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.

Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.

EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots

Bug: 19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0

Fix bogus image test assert

Previously we were comparing the size of the non moving space to
size of the image file.

Now we properly compare the size of the image space against the size
of the image file.

Bug: 19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a

[MIPS64] Fix art_quick_invoke_stub argument offsets.

ArtMethod reference's size got bigger, so we need to move other args
and leave enough space for ArtMethod* and 'this' pointer.

This fixes mips64 boot.

Bug: 19264997
Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
e3b034a6f6f0d80d519ab08bdd18be4de2a4a2db 31-May-2015 Mathieu Chartier <mathieuc@google.com> Fix some ArtMethod related bugs

Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.

Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.

Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.

TODO: Fix JDWP tests.

Bug: 19264997

Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3
e401d146407d61eeb99f8d6176b2ac13c4df1e33 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d