Fix missing class initialization during instrumentation.
Static methods (except the <clinit>) all point to the resolution trampoline
to handle class initialization. When we enable instrumentation, we update the
entry point to the instrumentation stub. But doing so makes us miss the call
into the trampoline.
This CL fixes this issue by leaving the resolution trampoline. Once a method's
class is initialized, we update all its static methods' entry point. When
instrumentation is enabled, this entry point becomes the instrumentation entry
stub.
This also allows to post method enter events in the right order during static
invokes. First, we get into the trampoline which call the method's class
<clinit> method and post the corresponding "method enter" event. Then we get
into the instrumentation entry stub of the static method being called and post
the corresponding "method enter" event before getting into its code.
Bug: 11686442
Change-Id: I202db921225c8be0b2191074d09b0ba40f9248b2
2 files changed