History log of /art/runtime/instrumentation_test.cc
Revision Date Author Comments
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
2ee17909eadd7155f4a7751c38398b36fc267f04 30-Aug-2017 Mingyao Yang <mingyao@google.com> Revert^4 "Allow deoptimization when returning from a runtime method."

This reverts commit 07c7028e518b98d3267a77dfe0d149db1adbe858.

Need some special treatment of string init's shorty.

Test: run-test/gtest on both host and target
Test: 597-deopt-busy-loop, 597-deopt-invoke-stub
Bug: 33616143
Change-Id: Id4c64910acfdd088835b6db6fc503e6ade0218e7
9fb1ab1f6bb58bdaccef78bc81b3202d0121e2ed 05-Sep-2017 Alex Light <allight@google.com> Revert "Revert "JVMTI Exception and ExceptionCatch events""

Fixed error where we were incorrectly not updating a ShadowFrame
dex_pc causing deoptimization errors.

Bug: 62821960
Bug: 65049545

Test: ./test.py --host -j50
Test: ./art/tools/run-libcore-tests.sh \
--mode=host --variant-X32 --debug

This reverts commit 959742483885779f106e000df6dd422fc8657931.

Change-Id: I91ab2bc3e645ddf0359c189b19a59a3ecf0d8921
959742483885779f106e000df6dd422fc8657931 04-Sep-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "JVMTI Exception and ExceptionCatch events"

Breaks tests.

Bug: 62821960
Bug: 65049545

This reverts commit 798eab03120f6189e8f6aa804d67af1b1d9f00b0.

Change-Id: Ie96903df06bbbe41f288f5b75a5114b142998fac
798eab03120f6189e8f6aa804d67af1b1d9f00b0 23-Aug-2017 Alex Light <allight@google.com> JVMTI Exception and ExceptionCatch events

Add support for the JVMTI can_generate_exception_events capability.
This includes the Exception and ExceptionCatch events and all their
associated behaviors.

Test: ./test.py --host -j50
Bug: 62821960
Bug: 65049545

Change-Id: I21cc8522c01033cdeb47bf34fa433bf04bf7ca5c
07c7028e518b98d3267a77dfe0d149db1adbe858 30-Aug-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "Allow deoptimization when returning from a runtime method."""

Bug: 33616143

deopt string test still failing on occasion.

This reverts commit 047abb20d02546d3dd6e8630befc31e5568fa90e.

Change-Id: I89fc28696290da52317d0e3dd07ecf0d1bdac823
e814f9d09c0fb1b678e610780d11ce3577db3599 01-Aug-2017 Alex Light <allight@google.com> JVMTI NotifyFramePop support

Adds support for the JVMTI can_generate_frame_pop_events capability.
This includes the NotifyFramePop function and the FramePop event.

We mark the interpreter shadowframes directly to get the events. This
relies on the fact that we never replace extant shadow-frames on the
interpreter stack to ensure that we can distinguish which jvmti-envs
requested the frame pops.

Test: ./test.py --host -j50
Bug: 34414072
Bug: 62821960
Bug: 65129403

Change-Id: I6e79e39f62fdf79268540c5c1be6311df704cff7
047abb20d02546d3dd6e8630befc31e5568fa90e 24-Aug-2017 Mingyao Yang <mingyao@google.com> Revert "Revert "Allow deoptimization when returning from a runtime method.""

This reverts commit 2b87ae0073256e909e15f464300912552e58ee48.

For an invocation runtime method such as quick-to-interpreter bridge,
add a special stack walk to get the shorty for the invoked method.

Test: run-test/gtest on both host and target, and 597-deopt-runtime-method.
Bug: 33616143

Change-Id: I53ae93880f62c95dcf48005239b925d7f7b11eb6
6e1607e247d979a1671a1fd5a98de3f1031fe719 23-Aug-2017 Alex Light <allight@google.com> Rename instrumentation ExceptionCaught to ExceptionThrown

The instrumentation ExceptionCaught event was badly named since it is
actually sent at the time the exception is thrown and is sent even if
the exception is never actually caught. Rename it and associated
methods/fields to ExceptionThrown to more accurately reflect the
event's semantics.

Test: ./test.py --host -j50
Change-Id: I1e9c401ab619259b25928dbf19f62d3fa9573d47
2b87ae0073256e909e15f464300912552e58ee48 23-Aug-2017 Vladimir Marko <vmarko@google.com> Revert "Allow deoptimization when returning from a runtime method."

Reason for revert:
Some tests failing even after a minor fix.

This reverts commit edeba10d523c3e283ab939a16c7203af32c7707e.

Change-Id: I6407c9b489c016d19a12c28d1da0efa55ad554a7
edeba10d523c3e283ab939a16c7203af32c7707e 12-Apr-2017 Mingyao Yang <mingyao@google.com> Allow deoptimization when returning from a runtime method.

This CL patches the return pc of a runtime method to allow the top
Java frame to be deoptimized. This should fix the issue that debugger
cannot break in a busy loop. It also means we can now do full async
deoptimization, if we want to enable it by letting environment keep
registers live.

art_quick_instrumentation_exit and art_quick_deoptimize now need to save
all registers since some compiler slow paths assume runtime methods save
everything.

Some special handling needs to be done to decide whether dex_pc should
be advanced when deoptimized back to interpreter.

Test: run-test/gtest on both host and target, and 597-deopt-runtime-method.
Bug: 33616143
Change-Id: I2e2c199998825afd5057f7deadfc8fa203ce1936
e5071cc58a3cdea4a88257be3c8fd4d012a64c74 12-Jun-2017 Vladimir Marko <vmarko@google.com> ART: Change method lookup to be more consistent to JLS and the RI.

The method lookup for different invoke types was previously
widely different and didn't work well with the dex cache
method array where we have only a single slot for each
MethodId. The new behavior is to perform the same lookup for
all cases, distinguishing only between interface and
non-interface referencing class, and to further align the
behavior with the JLS and the RI. Where the JLS conflicts
with the RI, we follow the JLS semantics.

The new lookup for class methods first searches the methods
declared in the superclass chain (ignoring "copied" methods)
and only then looks in the "copied" methods. If the search
in the superclass chain finds a method that has not been
inherited (i.e. either a private method or a package-access
method where one of the classes in the chain does not belong
to the same package, see JLS 8.4.8), we still search the
"copied" methods as there may actually be a method inherited
from an interface. This follows the JLS semantics where
inherited methods are included in the search (JLS 15.12.2.1)
but conflicts with the RI where the private or
package-access method takes precedence over methods
inherited from interfaces.

Note that this search can find an accessible method that is
not inherited by the qualifying type, either for a package
access method when the referrer is in the same package but
the qualifying type is in another package, or for a private
method where the referrer is in the same class but the
qualifying type is actually a subclass. For the moment we
allow such calls and we shall consider whether to throw
an IncompatibleClassChangeError in this situation in future
to comply with JLS 15.12.4.3.

The new lookup for interface methods searches the interface
class, then all the superinterfaces and then the
java.lang.Object class, see implicitly declared methods in
interfaces, JLS 9.2. The search for the maximally-specific
non-abstract superinterface method is not yet implemented,
but the difference should be difficult to observe as the
usual subsequent call to FindVirtualMethodForInterface()
should yield the same result for any matching method.

The new test 162-method-idx-clash exposes several cases
where we previously completely messed up due to the effects
of the DexCache, or where we were out of line with the RI.
It also tests a case where the JLS and the RI disagree and
we follow the JLS.

Test: art/test/run-test --host --jvm 162-method-resolution
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: testrunner.py --host --interp-ac
Test: Nexus 6P boots.
Test: testrunner.py --target
Bug: 62855082
Bug: 30627598

(cherry picked from commit ba118827465d12177f3996e50133960087b1c916)

Change-Id: Ic73e4adf02b5cd66b5a22a3b619dc781357db14c
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
ba118827465d12177f3996e50133960087b1c916 12-Jun-2017 Vladimir Marko <vmarko@google.com> ART: Change method lookup to be more consistent to JLS and the RI.

The method lookup for different invoke types was previously
widely different and didn't work well with the dex cache
method array where we have only a single slot for each
MethodId. The new behavior is to perform the same lookup for
all cases, distinguishing only between interface and
non-interface referencing class, and to further align the
behavior with the JLS and the RI. Where the JLS conflicts
with the RI, we follow the JLS semantics.

The new lookup for class methods first searches the methods
declared in the superclass chain (ignoring "copied" methods)
and only then looks in the "copied" methods. If the search
in the superclass chain finds a method that has not been
inherited (i.e. either a private method or a package-access
method where one of the classes in the chain does not belong
to the same package, see JLS 8.4.8), we still search the
"copied" methods as there may actually be a method inherited
from an interface. This follows the JLS semantics where
inherited methods are included in the search (JLS 15.12.2.1)
but conflicts with the RI where the private or
package-access method takes precedence over methods
inherited from interfaces.

Note that this search can find an accessible method that is
not inherited by the qualifying type, either for a package
access method when the referrer is in the same package but
the qualifying type is in another package, or for a private
method where the referrer is in the same class but the
qualifying type is actually a subclass. For the moment we
allow such calls and we shall consider whether to throw
an IncompatibleClassChangeError in this situation in future
to comply with JLS 15.12.4.3.

The new lookup for interface methods searches the interface
class, then all the superinterfaces and then the
java.lang.Object class, see implicitly declared methods in
interfaces, JLS 9.2. The search for the maximally-specific
non-abstract superinterface method is not yet implemented,
but the difference should be difficult to observe as the
usual subsequent call to FindVirtualMethodForInterface()
should yield the same result for any matching method.

The new test 162-method-idx-clash exposes several cases
where we previously completely messed up due to the effects
of the DexCache, or where we were out of line with the RI.
It also tests a case where the JLS and the RI disagree and
we follow the JLS.

Test: art/test/run-test --host --jvm 162-method-resolution
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: testrunner.py --host --interp-ac
Test: Nexus 6P boots.
Test: testrunner.py --target
Bug: 62855082
Bug: 30627598
Change-Id: If450c8cff2751369011d649c25d28a482a2c61a3
d76615851af31791c7b1549e8c4609152237b9ce 01-May-2017 Alex Light <allight@google.com> Handler-ize InstrumentationListener and related code

We are going to be making instrumentation listeners that can cause
suspensions during their running. We explicitly handler-ize all the
instrumentation listener functions in order to ensure this is safe.

Bug: 34414073
Test: ./test.py --host --ntrace --trace -j40
Change-Id: Ic719080d0991b104d41b7757df8d1f332c72cd04
b486a98aadc95d80548953410cf23edba62259fa 01-Jun-2017 Andreas Gampe <agampe@google.com> ART: Introduce thread-current-inl.h

Factor out Thread::Current() code into its own -inl file to remove
transitive includes.

This requires at the same time correcting mutex.h, i.e., moving
some functions into mutex-inl.h.

Test: m test-art-host
Change-Id: I88f888b604e0897368d9b483edce6ce4332dd9c9
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
bdf7f1c3ab65ccb70f62db5ab31dba060632d458 31-Aug-2016 Andreas Gampe <agampe@google.com> ART: SHARED_REQUIRES to REQUIRES_SHARED

This coincides with the actual attribute name and upstream usage.
Preparation for deferring to libbase.

Test: m
Test: m test-art-host
Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
1a0de6acd03b43a03678b58f47b2f21b5215cc22 27-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in art.

* Add parentheses around macro parameters, or
use NOLINT to suppress warning.
Bug: 28705665

Test: build with WITH_TIDY=1
Change-Id: Ifc922c2e66215772042bac372754ea70074f0053
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
81f0f953c4bb159997046c962d44cb1898b1778d 20-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Move backward branch instrumentation to all branch.

This is in preparation for osr, and later dead branch profiling.

Change-Id: I4597c0784c894c310f295dd534967d67dcefa419
aa5168291c46f9b418d989bccf2d8e09338a83e6 03-Oct-2015 Mathieu Chartier <mathieuc@google.com> Add exclusion between instrumentation and GC

Instrumentation calls VisitClasses while exclusive holding the
mutator lock. This can cause deadlocks since VisitClasses needs to
decode JNI weak globals. If the system weak slow path flag is set,
then we wait holding locks while exclusive holding the mutator lock.
This causes a deadlock since the GC cannot acquire the mutator lock
to sweep system weaks.

This fixes a deadlock seen in one of the tracing tests.

Change-Id: I580152118e068a70f309dcc19df4144afec835dd
4f55e22630d99ca0edd9e951e5ee96b57bb9b980 04-Sep-2015 Mathieu Chartier <mathieuc@google.com> Add and use ScopedSuspendAll

Usage replaces most SuspendAll and ResumeAll calls.

Change-Id: I355683a5365876242cea85a656dcb58455f7a294
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
f1d666e1b48f8070ef1177fce156c08827f08eb8 04-Sep-2015 Mathieu Chartier <mathieuc@google.com> Add ScopedThreadSuspension

Fixes the TransitionFromRunnableToSuspended and
TransitionFromSuspendedToRunnable pattern that was prone to errors.

Change-Id: Ie6ae9c0357c83b4fc4899d05dfa0975553170267
90443477f9a0061581c420775ce3b7eeae7468bc 17-Jul-2015 Mathieu Chartier <mathieuc@google.com> Move to newer clang annotations

Also enable -Wthread-safety-negative.

Changes:
Switch to capabilities and negative capabilities.

Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.

Bug: 20072211

Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
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
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
5eae455507399286c845ba54796c47087a72b3e2 01-Apr-2015 Sebastien Hertz <shertz@google.com> Support multiple instrumentation clients

Changes Instrumentation::ConfigureStubs to support multiple clients
that need different levels of instrumenation. A client is identified
by a string key used to save the desired instrumentation level.

Also adds regression gtest instrumentation_test and some cleanup.

Bug: 19829329

(cherry picked from commit 0462c4c87c39db6cfcd338f323844738109ac3c9)

Change-Id: I1fc24a86fcb7cb46d4be806895376c25cc0a0b3c
0462c4c87c39db6cfcd338f323844738109ac3c9 01-Apr-2015 Sebastien Hertz <shertz@google.com> Support multiple instrumentation clients

Changes Instrumentation::ConfigureStubs to support multiple clients
that need different levels of instrumenation. A client is identified
by a string key used to save the desired instrumentation level.

Also adds regression gtest instrumentation_test and some cleanup.

Bug: 19829329
Change-Id: I1fc24a86fcb7cb46d4be806895376c25cc0a0b3c