diff options
author | Vladimir Marko <vmarko@google.com> | 2020-03-05 17:13:28 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2020-03-09 15:35:25 +0000 |
commit | 509e943e819276bd1622f34f1af58f9080e35c1d (patch) | |
tree | a666651695ea744583bcaa58007928a97956c17b /test/008-exceptions/src/MultiDexBadInit.java | |
parent | 334e2f16caadb2b08c33b22e4d8bde4c1e6270c8 (diff) |
Allow ThreadLocal object allocation during AOT.
The class ThreadLocal has a static field nextHashCode used
for assigning hash codes to new ThreadLocal objects. Since
the class and the object referenced by the field are in the
boot image, they cannot be modified under normal rules for
AOT compilation. However, since this is a private detail
that's used only for assigning hash codes and everything
should work fine with different hash codes, we override the
field for the compilation, providing another object that
the AOT class initialization can modify. We select the
initial hash code based on dex file checksums.
Use similar hash code selection for the identity hash code.
(cherry picked from commit 37d6d77297bf682eed7f9d65be49e8ea61aa3b69)
Test: aosp_taimen-userdebug boots.
Test: m dump-oat && \
grep -cE 'Class.*VisiblyInitialized' \
out/soong/boot.arm64.oatdump.txt
# before: 8635
# after: 8706
Test: EMMA_INSTRUMENT_FRAMEWORK=true m
Bug: 150319075
Change-Id: I93a703a9e2874930c8b6bb8f62e8a293d546ce93
Diffstat (limited to 'test/008-exceptions/src/MultiDexBadInit.java')
0 files changed, 0 insertions, 0 deletions