History log of /art/openjdkjvmti/ti_redefine.cc
Revision Date Author Comments
d3782f304acee54273f551c52f547539c8f4a78b 05-Apr-2018 Alex Light <allight@google.com> Prevent deadlock calling transformation functions in ClassLoad callback.

If an agent called RetransformClasses or RedefineClasses from the
ClassLoad event callback and the class that caused the event is
included the thread would deadlock. This happened because the
verification code would try to wait for the class to be linked but
since the current thread is responsible for doing that this will never
happen. To prevent this from happening we make those functions simply
return JVMTI_ERROR_INTERNAL if they are called on the same thread the
class is being loaded on.

In order to test this we needed to modify the test helper code to keep
track of the current jvmtiEventCallbacks state.

Bug: 77652488
Test: ./test.py --host -j50

(cherry picked from commit 9e7859cb2449d6150b97c7d8ff9646a5405737f8)
Merged-In: I0a196b999a08ec3bf9cdf98357e223f89fdcd666
Change-Id: I0a196b999a08ec3bf9cdf98357e223f89fdcd666
18e14b5029ccac1cce609250b97bf17ebcbf128c 06-Mar-2018 Alex Light <allight@google.com> Ensure when NotifyMethodRedefined is called the ArtMethod is valid

Previously we were calling Jit::JitCodeCache::NotifyMethodRedefined
with an ArtMethod that was not fully valid. This could cause OOB
memory accesses if NotifyMethodRedefined attempts to access the
incorrect dex-file associated with the method at that time. This
occurs if the method is a native method. By looking at the wrong dex
file the JIT will get an incorrect MethodID and Shorty meaning it is
unable to correctly update the jit-code-cache.

Test: ./test.py --host -j50
Test: Run WIP dexmaker tests that hit this issue.
Bug: 74116990
Change-Id: Ied035b01b07d595df4037352b4bd20b42d285cb9
(cherry picked from commit 035105ff976680f11fa4fb12f1d42e2b7e250503)
e34fe44a04a28d5688e0ae5effee9922c26c5916 22-Feb-2018 Alex Light <allight@google.com> Ensure redefinition does not break breakpoint deoptimization

We had a bug where redefining a method with breakpoints made it
impossible to deoptimize the (newly redefined) method. This meant that
breakpoints added after the redefinition might not work. We fixed this
by removing the breakpoints earlier in the redefinition process,
when we were still capable of removing the deoptimization.

Bug: 73742185
Test: ./test.py --host -j50
Change-Id: I86973fbdce370a3ae7bc78b5fc71470d99046044
64e4c145e9301615a339a0981b1bc34fbe78c2f9 30-Jan-2018 Alex Light <allight@google.com> Refactor JVMTI ClassFileLoadHook handling

Make initial load ClassFileLoadHook use the same helper structures as
the retransform path. This makes the system simpler and creates a
single point where changes to the ClassFileLoadHook handling can be
done.

Test: ./test.py --host -j50
Test: ./test.py --redefine-stress --host -j50
Bug: 72064989
Change-Id: I7df9fed267fea497d9efd4f4214506237e63339f
013fd8073f3ece22b0bba1853d3f3430c8a9e4bd 12-Jan-2018 David Sehr <sehr@google.com> Create an ART-independent DexFileLoader

Opening DEX files should not rely on instantiating a runtime or having a
large number of dependencies on runtime components. This CL makes
DexFileLoader a stub class that is independent of ART, and introduces a
subclass ArtDexFileLoader that contains the current implementations.

Bug: 22322814
Test: make -j 50 test-art-host
Change-Id: Ia6e92ae93c347057ea0c10455525239cbbe42c03
9e734c7ab4599d7747a05db0dc73c7b668cb6683 05-Jan-2018 David Sehr <sehr@google.com> Create dex subdirectory

Move all the DexFile related source to a common subdirectory dex/ of
runtime.

Bug: 71361973
Test: make -j 50 test-art-host
Change-Id: I59e984ed660b93e0776556308be3d653722f5223
57943810cfc789da890d73621741729da5feaaf8 07-Dec-2017 Andreas Gampe <agampe@google.com> ART: Replace base/logging with android-base/logging

Replace wherever possible. ART's base/logging is now mainly VLOG
and initialization code that is unnecessary to pull in and makes
changes to verbose logging more painful than they have to be.

Test: m test-art-host
Change-Id: I3e3a4672ba5b621e57590a526c7d1c8b749e4f6e
b7c273cb44fcbdab3c17ec69124fe4bbea2696b1 11-Nov-2017 Mathieu Chartier <mathieuc@google.com> Add ClassDataItemIterator::HasNextMethod

Returns true if there are either static of virtual methods remaining,
changed most places to use this where possible.

Slight behavioral change for duplicate method checking, we not
persist the method index across the static method / virtual method
boundary.

Motivation: Generic cleanup to remove copy paste.

Test: test-art-host
Change-Id: I7a1b507e681b2c40452f8a9913b53a96b181e171
b0a6aeee250945b1d156ebab94053380f2e5a3c5 27-Oct-2017 Vladimir Marko <vmarko@google.com> Record @{Fast,Critical}Native in method's access flags.

Repurpose the old kAccFastNative flag (which wasn't actually
used for some time) and define a new kAccCriticalNative flag
to record the native method's annotation-based kind. This
avoids repeated determination of the kind from GenericJNI.
And making two transitions to runnable and back (using the
ScopedObjectAccess) from GenericJniMethodEnd() for normal
native methods just to determine that we need to transition
to runnable was really weird.

Since the IsFastNative() function now records the presence
of the @FastNative annotation, synchronized @FastNative
method calls now avoid thread state transitions.

When initializing the Runtime without a boot image, the
WellKnowClasses may not yet be initialized, so relax the
DCheckNativeAnnotation() to take that into account.

Also revert
https://android-review.googlesource.com/509715
as the annotation checks are now much faster.

Bug: 65574695
Bug: 35644369
Test: m test-art-host-gtest
Test: testrunner.py --host
Change-Id: I2fc5ba192b9ce710a0e9202977b4f9543e387efe
373a9b5c718a45ac484afcf4fe6ce84f4bb562b3 18-Oct-2017 Andreas Gampe <agampe@google.com> ART: Depend on libnativehelper headers only

Depend on header-only versions where possible. Move projects
excluding libart to libnativehelper_header_only.

Bug: 65522645
Test: mmma art
Change-Id: I53dd3b2a97e94ee685f72de007ed3858f7f5c6b6
79c87da9d4698ec58ece65af0065eebd55a1cfe0 10-Oct-2017 Mathieu Chartier <mathieuc@google.com> Add DexFileLoader class

Added DexFileLoader class, moved functionality from DexFile there:
- Multidex loading logic
- DexFile opening logic for Zip and etc
- Some other helpers

Bug: 63756964
Test: test-art-host

Change-Id: Ic3dfa458947d4b69912dea5cdd836e7e8f55061c
abbc4bc8a6716a6e524ec2572834fa34604519c1 06-Oct-2017 Alex Light <allight@google.com> Don't notify jit of non-invokable methods being redefined.

This can lead to crashes if the method stored something in it's data_
pointer (such as it's single-implementation).

Bug: 67465851
Test: ./test.py --host -j50
Change-Id: Iee060560f558a91c70e3c72b739de8292ba5a43b
53330619324886205b11119affb687069225e4a7 05-Oct-2017 Alex Light <allight@google.com> Ensure that soft-verification doesn't fail class redefinition.

We were incorrectly returning ERR(FAILS_VERIFICATION) when a
redefinition has a soft-verification failure (e.g. an unknown method).
This was incorrect.

Test: ./test.py --host -j50
Bug: 67425338
Change-Id: I1d2c6716a377a8b5bdc5781fecc2e3795b318cfa
cfcc9cfb44bab79f7381bcc4bfd9bf2d4435f734 29-Sep-2017 Orion Hodson <oth@google.com> ART: Increase the number of potential instrinsics

The new limit is 256 intrinsics.

Adds additional sanity checks.

Avoids setting the kAccPreviouslyWarm bit for intrinics (defaults to
true).

Bug: 65872996
Test: art/test.py --host -j32
Change-Id: I33ea67c9b6b8500b3ceb8a085358f075f6fcbb82
5122e6ba34d46851cd89f2ad55bf6bb067e038d6 17-Aug-2017 Vladimir Marko <vmarko@google.com> ART: Remove ArtMethod::dex_cache_resolved_methods_.

Test: m test-art-host-gtest
Test: testrunner.py --host
Test: testrunner.py --target on Nexus 6P
Test: Repeat the above tests with ART_HEAP_POISONING=true
Test: Build aosp_mips64-eng
Change-Id: I9cd0b8aa5001542b0863cccfca4f9c1cd4d25396
06c42a571358b5e5adb69104b183af8f32f4c07d 26-Jul-2017 Andreas Gampe <agampe@google.com> ART: Move openjdkjvmti to art/

Move libopenjdkjvmti out of the runtime directory. Let's not
pollute the runtime library.

Test: m test-art-host
Change-Id: Idb6b9cebcd61777bd3200437a2ae584a63a4a341