Use ShouldDeoptimizeFlag to check if method exit hooks are needed
When we want to execute a particular method in switch interrpeter we
update the entry point of the method and we need to deopt any method
invocations that are on the stack currently. All future invocations
would use the correct entry point so we only need to check for a deopt
for the methods that are currently on the stack. In the current
implementation, we check a global flag to call method exit hooks (that
checks if a deopt of caller is necessary) which means we call method
exit hooks more often than necessary. This CL changes it so we use a bit
on the ShouldDeoptimizeFlag and update the bit for all method
invocations that are currently on the stack.
We still have to call method exit hooks for any future invocations if
method exit listeners are installed. So the JITed code is now updated
to call method exit hooks if the stack slot indicates a deopt check
is necessary or if method exit listeners are installed.
This improves the performance of golem benchmarks by close to 8x
bringing the performance close it what it was before adding a
breakpoint.
Bug: 253232638
Test: art/test.py
Change-Id: Ic70a568c3099bc9df8d72f423b33b4f148209de9
8 files changed