Better inline instrumentation callbacks in interpreter.
While instrumentation callbacks (MethodEnterEvent, MethodExitEvent and
DexPcMovedEvent) are inlined, the given arguments (this object, method and
current dex pc) are "constructed" even if the callback results in a no-op
(because no listener is attached) and these arguments are not used.
This CL improves these parts of code by explicitely test whether a listener is
attached before calling the callback. Thus, parameters are only created if
a listener is attached. In the case no listener is attached, we prevent from
loading from memory the 'this' object and the method and prevent from computing
the dex pc (which is the difference between the code start address and the
current instruction address).
Change-Id: Ia93aeca1eaa6c1fc644e932eb67001d46b1cf429
2 files changed