Update entrypoints after switching the runtime to non-debuggable

When detaching a debugger or stopping tracing in non-debuggable
runtimes, we switch back to non-debuggable mode. We used to switch to
non-debuggable mode after updating the entrypoints of methods. This
meant we don't use AOT code for these methods. For this to work
correctly we should
1. Update instrumentation level
2. Switch runtime if possible
3. Update entry points.

Since this order is important, we no longer expose MaybeSwitchRuntime as
a public member. Instead we pass a parameter that says if we should try
and switch the runtime to non-debuggable.

Bug: 303686344
Test: art/test.py
Change-Id: Id655ca50964ed10072ff5bfc3e565c08ecb9987b
5 files changed