History log of /art/runtime/cha.h
Revision Date Author Comments
ab2ce84d4995f05c38c5ebfefc6683b244a36260 01-Feb-2018 Alexey Grebenkin <a.grebenkin@samsung.com> Fix dangling SingleImplementations left after class unloading

Test: make test-art-host, manual using sample code

bug: 73143991

(cherry picked from commit be4c2bd892bd167a50b4dfa7133e70a809197698)

Change-Id: I5f4d726334a9ea306d93b967966c58111fd34fd1
29103d6bb966809e0aa61ceee749eee0dd764392 21-Jul-2017 Mathieu Chartier <mathieuc@google.com> Remove CHA dependencies for class unloading when JIT is disabled

When a linear alloc is unloaded, remove the corresponding CHA
dependencies to prevent any dangling pointers to ArtMethods.

Bug: 63905544
Bug: 63467744
Test: test-art-host

(cherry-picked from commit cf79cf51feeea395a965c8dc452f86be60c00aab)

Change-Id: I2a9bd434bfa89aa01ebb603cb2ae31afcb002f58
cf79cf51feeea395a965c8dc452f86be60c00aab 21-Jul-2017 Mathieu Chartier <mathieuc@google.com> Remove CHA dependencies for class unloading when JIT is disabled

When a linear alloc is unloaded, remove the corresponding CHA
dependencies to prevent any dangling pointers to ArtMethods.

Bug: 63905544
Bug: 63467744
Test: test-art-host
Change-Id: I6f54c6e774daef1a64c6a02a17eb5f5ab98841fd
8cf9cb386cd9286d67e879f1ee501ec00d72a4e1 19-Jul-2017 Andreas Gampe <agampe@google.com> ART: Include cleanup

Let clang-format reorder the header includes.

Derived with:

* .clang-format:
BasedOnStyle: Google
IncludeIsMainRegex: '(_test|-inl)?$'

* Steps:
find . -name '*.cc' -o -name '*.h' | xargs sed -i.bak -e 's/^#include/ #include/' ; git commit -a -m 'ART: Include cleanup'
git-clang-format -style=file HEAD^
manual inspection
git commit -a --amend

Test: mmma art
Change-Id: Ia963a8ce3ce5f96b5e78acd587e26908c7a70d02
582d96a75c962c79a66c417ad55ed1a2a31140ad 24-Jul-2017 Andreas Gampe <agampe@google.com> ART: Fix null pointer in CHA debug verification

Fix the case that excluded_method is null in VerifyNonSingleImplementation.
Refactor slightly to hide from the interface. Add the class chain from
to the output.

Bug: 34193647
Test: m
Change-Id: I63a30f30805d68874c9817103a04a4dcae157fd7
d49012909625c3bf87bf51138fe79315ce1b1bdc 31-May-2017 Andreas Gampe <agampe@google.com> ART: Clean up heap headers

Use more forward declarations for accounting structures and spaces.
Factor out structs to reduce header surface. Remove heap include where
unnecessary. Fix up transitive users. Move some debug-only code out
of line.

Test: m test-art-host
Change-Id: I16db4aaa803f39e155ce6e1b0778b7e393dcbb17
cc10450383fd6aa543a9f61ac40a84f406bec936 25-May-2017 Mingyao Yang <mingyao@google.com> Simplify CHA dependency tracking data structure.

Change pointer to vector in the map to just vector.

Bug: 37953217
Test: m -j20 test-art-host-run-test test-art-host-gtest
Change-Id: I0e601c69aef99401360cc1a3967c056952a05a0f
18ea1c9e9281b5c143b8c376d76c3ff9cae885fb 27-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> "Revert^6 "CHA for interface method."""

Update test expectations for CHA tests flaking on no-dex2oat.

bug:36344221

This reverts commit 27ef25f084017421ca05508208f436b5fc11df73.

Change-Id: Ie92adc7a2ec3b3081a1c57d71f8c89247e58cd46
27ef25f084017421ca05508208f436b5fc11df73 24-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert^4 "CHA for interface method.""

Still failing on the bots.

This reverts commit fb185130f35bbfe2ba1875974ed39ef0b3c7a77f.

Change-Id: I1629e237dd41ce4784ccadbfc346352dfcbdb137
fb185130f35bbfe2ba1875974ed39ef0b3c7a77f 17-Mar-2017 Mingyao Yang <mingyao@google.com> Revert^4 "CHA for interface method."

This reverts commit 43e99be9db10111a2d6e094882cd06c248c69e11.

Also fix the issue that tries to change invoke-interface to
an invoke-virtual of a cross-dexfile proxy method. Added a
testcase.

Test: run-libcore-tests.sh --mode=host --variant=X64 --debug
Test: ART_TEST_JIT=true m -j20 test-art-host-run-test
Change-Id: Iacdf9d7ad93590e8163ed59d5838d70700a69018
43e99be9db10111a2d6e094882cd06c248c69e11 15-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "CHA for interface method."""

Breaks libcore tests.

This reverts commit 8f301e26943c53485abc2da5ff1907f7c2e0ff0c.

Change-Id: Iea46176118be9e05aceb06f2d290961bb1f38265
8f301e26943c53485abc2da5ff1907f7c2e0ff0c 28-Feb-2017 Mingyao Yang <mingyao@google.com> Revert "Revert "CHA for interface method.""

This reverts commit 85a1ec1347c8117365632dcaaa648ebb0a8691f5.

It also fixed the issue that's caused by changing an invokeinterface
to an invokevirtual, when the method is the original default interface
method. Since the default interface method is not in any vtable, unless
it's copied and becomes a virtual method.

Test: ART_TEST_JIT=true m -j20 test-art-host-run-test
Change-Id: I627616978690485c66cfca47c234f1504066ea1d
85a1ec1347c8117365632dcaaa648ebb0a8691f5 28-Feb-2017 Mingyao Yang <mingyao@google.com> Revert "CHA for interface method."

This reverts commit 7130fc769896a96573f55496444d87161e4b41e8.

There might be some race condition going on. 960-default-smali
fails sometimes.
7130fc769896a96573f55496444d87161e4b41e8 16-Feb-2017 Mingyao Yang <mingyao@google.com> CHA for interface method.

Test: m test-art-host, boot device.
Change-Id: Ia2da74c2af1974fe344f215ae667eaf03c59a26e
e8fcd013493b800227bd7ea5f38f6cc27e9b90d1 20-Jan-2017 Mingyao Yang <mingyao@google.com> Revert "Revert "CHA for abstract methods.""

This reverts commit 8ebc8bf055e8bd8f6f167e65a69cf4dae136db55.

When we set the single-implementation method for an abstract method, it
need to be protected by the cha-lock.

Test: new testcase and ART_TEST_JIT=true m -j20 test-art-host-run-test
Change-Id: I66acb20ffa7e49dd9c391f001e3bb52f961872e4
8ebc8bf055e8bd8f6f167e65a69cf4dae136db55 20-Jan-2017 Colin Cross <ccross@android.com> Revert "CHA for abstract methods."

This reverts commit ae6c189b9d63ca4c2ae0e952187819c5e442e3c9.

This is causing sporadic build failures with:
dex2oatd F 01-20 15:05:33 8343 10164 cha.cc:292] Check failed: method_in_super->HasSingleImplementation()

Change-Id: I4435ab028d3f7893e18b44347f294326c573a255
ae6c189b9d63ca4c2ae0e952187819c5e442e3c9 05-Jan-2017 Mingyao Yang <mingyao@google.com> CHA for abstract methods.

Add the ability to devirtualize abstract method invocation if
an abstract method has only one implementation. Only support in JIT
mode currently.

Test: new testcase and ART_TEST_JIT=true m -j20 test-art-host-run-test
Change-Id: I43da03a9fa9a73840f5eaf207c6611e0913a7f66
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