summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2018-07-26 16:06:15 -0700
committerAlex Light <allight@google.com>2018-08-31 10:10:37 -0700
commit22d8e48cada1e5811ad50db16cdf985ec9f568e3 (patch)
tree45dc76450e35d11f1b931cc8d11f9bcd916b9359 /compiler/optimizing/graph_visualizer.cc
parentfcefab5ecf8b9abc6fa6479141085f5c132b7a4b (diff)
Avoid holding locks when calling ObjectFree callback
We were calling into agent code (through the ObjectFree event) while holding the ObjectTagTable's allow_disallow_lock_ and other locks. Depending on the GC being used, this could prevent other threads from accessing tag-data while the ObjectFree is ongoing. Combined with the ObjectFree event making use of jrawMonitorID locks (something they are explicitly allowed to do) this could easily lead to deadlocks. To fix this we made the ObjectTagTable delay sending the events until locks are released after calling either the Allow or Broadcast functions which notify the table that the sweep is finished. We did need to modify the SemiSpace collector to call the Broadcast function as well. This has the unfortunate effect that previously all ObjectFree events would occur before the end of the Runtime.gc function which is no longer the case. This is all allowed by the spec however. We needed to modify test 905 to check for gc having occurred using phantom references since this change means that ObjectFree events might happen after a Runtime.gc call returns. Test: ./test/testrunner/run_build_test_target.py art-gss-gc Test: ./test.py --host Test: ./art/tools/run-libjdwp-tests.sh --mode=host Bug: 76205593 Change-Id: I4565e9828d134899a1623c2f490ac183e7be5ab6
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
0 files changed, 0 insertions, 0 deletions