History log of /art/openjdkjvmti/deopt_manager.cc
Revision Date Author Comments
7f40ae52e9de9badb534969fb116579aee11bb84 19-Apr-2018 Alex Light <allight@google.com> Move jit startup attempt to openjdkjvmti from adbconnection

We were attempting to start the jit in adbconnection if it was not
already running in order to improve the performance of debugging
system_server and other similar processes. Since we have opened up the
kArtTiVersion (0x70010200) environment to any agent (on userdebug/eng
builds) it would be useful for these other agents also have the
performance boost when running on these processes.

Test: Build
Test: adb root &&
adb shell setenforce 0 &&
adb forward tcp:12345 jdwp:`adb shell pidof system_server` &&
jdb -attach localhost:12345;
<Do things with debugger and device>

Bug: 78119634
Bug: 78195998
Merged-In: Ibfe10b43dcd23d615c03c12af2625e2b0c54f6a4
Change-Id: Ibfe10b43dcd23d615c03c12af2625e2b0c54f6a4
(cherry picked from commit 60fbefcdf3578be9995a3be2b975b3998cdb430c)
d698ef52ab913384473c39687c32d68592422132 02-Apr-2018 Alex Light <allight@google.com> Revert^6 "Ensure that OSR still is possible with jvmti"

The instrumentation uninstall could set methods to non-debuggable
boot.oat code. This could cause events to be missed due to methods
being inlined. We needed to change the path so that we would only have
the JIT/interpreter replace methods. We do this by adding a new
callback that can be used to determine if a method needs to be
debuggable and being more careful about replacing code when this is
true.

This reverts commit 5f3005c8844d851d7d218b88b5f90d6c9083ce24.
This unreverts commit b9ad26d1ed9146b89555d4333021f44eeb831f05.

Reason for revert: Fixed issue causing CTS version of test 993 failure.

Test: cts-tradefed run cts-dev CtsJvmtiRunTest993HostTestCases
Test: ./test.py --host -j50 --all -t 993
Test: ./test.py --host
Test: while ./test/run-test --host --jit 1935; do; done
Test: while ./test/run-test --host --jit --jvmti-redefine-stress 1935; do; done
Test: am start --attach-agent -n com.example.android.displayingbitmaps/.ui.ImageGridActivity
Run blur filter.
Bug: 76226464
Bug: 77306669

Merged-In: I5068201a03f7613787c66981405499b6499c24e1
Change-Id: I5068201a03f7613787c66981405499b6499c24e1
(cherry picked from commit f28586390b055a5681e50617d729a3fa09792d9c)
0e84118e875038ee5e90571489abcde86da3db81 12-Feb-2018 Alex Light <allight@google.com> Revert^6 "Prevent UAF issues caused by static destructors"

This reverts commit 4798222e3b3c22435d0a8d915d272fe67c80bd01.

Reason for revert: Fixed issue in underlying change.

Bug: 69591477
Test: ./test.py --host -j50
Change-Id: I31f0ba00ade607f388e248f287801ff878c7296f
4798222e3b3c22435d0a8d915d272fe67c80bd01 12-Feb-2018 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert^4 "Prevent UAF issues caused by static destructors""

run-test changes cause issues.

Bug: 69591477

This reverts commit e9dc52492979364748e0c39682c0b2e9728ee50c.

Change-Id: I1ee05747cdc9292c6e1ce9f3ed8fc31a3d3fd6b8
e9dc52492979364748e0c39682c0b2e9728ee50c 09-Feb-2018 Alex Light <allight@google.com> Revert^4 "Prevent UAF issues caused by static destructors"

The test 1944 was not very robust and could spuriously fail for
several reasons. Most notably it did not actually check that the exit
value was what we expected and it could cause linker warning messages
to be printed. The first we solved by checking for the exit value
directly. The second cannot be simply solved so we simply filter these
messages out.

This reverts commit 70f4415d0485f67922323557f2657b009f20696d.

Reason for revert: Made test more robust.

Test: ./test.py --host -j50
Bug: 69591477
Change-Id: I8580973e16d63583e0cb80825892b4604c2591b6
ef012225dcec8f736fc8fd848f5d8ee01c3c280f 21-Jun-2017 Roland Levillain <rpl@google.com> Fix typos.

Test: art/test/testrunner/testrunner.py
Change-Id: I5f5e052c940650a3adb3a8717b84260e6b306500
70f4415d0485f67922323557f2657b009f20696d 08-Feb-2018 Orion Hodson <oth@google.com> Revert "Revert "Revert "Prevent UAF issues caused by static destructors"""

This reverts commit 6280f87f24c420676bff3fcd3a9698246df366b9.

Reason for revert: test failures

https://build.chromium.org/p/client.art/builders/angler-armv8-ndebug/builds/2415/steps/test%20optimizing/logs/stdio

Change-Id: I857562ae54340956fe83f68ee995b49e1d8416e3
6280f87f24c420676bff3fcd3a9698246df366b9 07-Feb-2018 Alex Light <allight@google.com> Revert "Revert "Prevent UAF issues caused by static destructors""

We were not initializing the frame_pop_enabled field of EventHandler
so it was undefined. If it happened to be true then the FramePop
handlers will never be installed and the FramePop events will never be
triggered.

This reverts commit 6a94cec7343bf006234b62525398c83bb55858eb.

Reason for revert: fixed issue with frame pop

Test: ./test/testrunner/testrunner.py -a --host -t 923
Bug: 69591477

Change-Id: Id47f91a76b6e7c9326e94d7cbdf8c5472bffb58a
6a94cec7343bf006234b62525398c83bb55858eb 07-Feb-2018 Nicolas Geoffray <ngeoffray@google.com> Revert "Prevent UAF issues caused by static destructors"

This reverts commit 123aeb716563d0783c73f309c3afef6dfd8f8b9e.

Bug: 69591477

Change-Id: I368802d0c0c64143568d63a6fb02f969702c881e
123aeb716563d0783c73f309c3afef6dfd8f8b9e 07-Feb-2018 Alex Light <allight@google.com> Prevent UAF issues caused by static destructors

Agents calling exit(3) would cause static destructors to run on
several openjdkjvmti data-structures. This caused problems as other
threads could still be running and might hit UAF issues, causing
errors. We fix this by making sure that no important jvmti
data-structures are statically allocated. Since these data-structures
must be live for the whole program runtime this is not a big issue.

Bug: 69591477
Test: ./test.py --host -j50
Test: while ./test/run-test --host 1944; do; done
Test: ./art/tools/run-libjdwp-tests.sh --mode=host --test \
org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ExitTest.testExit001
Change-Id: I25b01fc129d46c5f15bce1b9ec7952d29088a5a2
8c0961f9e061ee4b04c1c4ba8ad5cca13bcf884d 24-Jan-2018 David Sehr <sehr@google.com> Move missed files to libdexfile

Reduce the dependencies on utf and utils in preparation for separate
directory.

Bug: 22322814
Test: make -j 50 test-art-host
make -j 50 dexdump2 dexlist

Change-Id: Icdecf895dafec63ef903514eef79d459abc14925
2ce6fc80711af9afa3ecda8fdff6f4ed80aa3022 19-Dec-2017 Alex Light <allight@google.com> Support using adbconnection and openjdkjvmti without JAVA_DEBUGGABLE

We need to support using a best-effort JDWP when we have the
ENABLE_JDWP attribute without the JAVA_DEBUGGABLE attribute. This is
used on eng and userdebug builds. We do this by making the plugin try
to change the runtime to debuggable if possible and to allow getting
an ArtTiEnv which is a best-effort version of JVMTI by calling GetEnv
with (JVMTI_VERSION_1_2 | 0x4000000). This is needed since if the
runtime isn't debuggable we cannot guarantee compatibility with the
JVMTI specification in all cases due to compiler optimizations such as
inlining. By creating this special version agents are able to
positively signal that they are able to deal with this uncertainty.

We also support using openjdkjvmti without being JAVA_DEBUGGABLE. This
is done by either only allowing the best effort ArtTiEnvs or by
changing the environment to be debuggable if we are loaded early
enough.

Moving the runtime to debuggable state involves deoptimizing the boot
image and throwing out any image files associated with non-debuggable
oat-files.

Bug: 62821960
Test: ./test.py --host -j50
Test: Manual
Test: Build, Test debugging system_server and other processes.
Change-Id: I2233299fceb83c76785e5de09e51eaf18b7922e8
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
0fa1786bdcc333873ed65a1f77a4669d5701ac5e 24-Oct-2017 Alex Light <allight@google.com> Avoid JVMTI global deoptimization when possible

This changes the openjdkjvmti plugin to be more controlled about the
situations that it will deoptimize everything. Most notably this makes
the plugin deoptimize only individual methods for breakpoints instead
of doing a full deoptimization. It also doesn't deoptimize for the
JVMTI_EVENT_EXCEPTION method, since our throwing code will always send
the appropriate event.

Impact:
Exoplayer benchmark with breakpointlogger setting a breakpoint on
a method that is never called.

The agent is the tools/breakpoint-logger agent.

'art' options are for all runs were:
--64
-Xusejit:true
-Xcompiler-option --debuggable
'art' options for 'Pre change' and 'Post change' runs included:
-Xplugin:libopenjdkjvmti.so
'-agentpath:libbreakpointlogger.so=Lbenchmarks/common/java/BenchmarkBase;->run()V@0'

Clean run (no agent loaded):
Running FMP4 x 1 : 53
Running TS x 1 : 144
Running FMP4 x 2500 : 3309
Running TS x 100 : 3584
ExoPlayerBench(RunTime): 6977000.0 us.
Pre change:
Running FMP4 x 1 : 159
Running TS x 1 : 9395
Running FMP4 x 2500 : 298591
Running TS x 100 : 944447
ExoPlayerBench(RunTime): 1.243226E9 us.
Post change:
Running FMP4 x 1 : 87
Running TS x 1 : 495
Running FMP4 x 2500 : 2939
Running TS x 100 : 3947
ExoPlayerBench(RunTime): 6979000.0 us.

Post change vs clean run is well within margin of error for this
benchmark.

Test: ./test.py --host -j50
Test: ./art/tools/run-prebuild-libjdwp-tests.sh

Bug: 62821960
Bug: 67958496

Change-Id: I63ef04f71c36c34d8534651d0c075921a836ec08