summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_utils.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2017-11-29 09:00:55 -0800
committerAlex Light <allight@google.com>2017-12-01 08:55:08 -0800
commit7919db947bc41f6f5d194c50b88d0cba47319a1c (patch)
treeae1aa7fed4e9a6c6bbec3fc1c2b85cef173e737c /compiler/optimizing/code_generator_utils.cc
parent50f90a44f8cd1928054245cab4cd3bd47a1a6347 (diff)
Speed up MterpShouldSwitchInterpreters check
We were often performing a pair of TLS reads in order to determine in the current thread has any pending asynchronous exceptions (exceptions thrown by the JVMTI StopThread function). This is quite slow and was impacting some benchmarks. Since it is expected that asynchronous exceptions are extremely rare we will first check to see if any asynchronous exceptions have been sent on the current process. Only if at least one asynchronous exception has been thrown will we do the expensive TLS lookups to determine if one has been thrown on the current thread. Using a global instance value without synchronization or atomics is ok here since the checkpoint that actually sets the async_exception_thrown flag provides synchronization by either occurring on the target thread or passing the checkpoint. According to go/lem this gives us a 7% increase on the caffeine string benchmark. Test: go/lem runs Test: ./test.py --host -j50 Bug: 68010816 Change-Id: I62684a5b3a7fc7cc600f5efd2a2393d9c4025917
Diffstat (limited to 'compiler/optimizing/code_generator_utils.cc')
0 files changed, 0 insertions, 0 deletions