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).
2 files changed