Combine JDWP location events

The runtime now sends location events BREAKPOINT, SINGLE_STEP, METHOD_ENTRY,
METHOD_EXIT and METHOD_EXIT_WITH_RETURN_VALUE in the same JDWP event packet
when they relate to the same location.

We update the Dbg::UpdateDebugger method to take initial event flags and
returned value. It allows to call this method from DebugInstrumentationListener
so we can treat method entry/exit events with breakpoint and single-step.

In the interpreter, we ensure we do not call Instrumentation::DexPcMovedEvent
when Instrumentation::MethodEnterEvent has just been called or when we're about
to call Instrumentation::MethodExitEvent. This prevents from sending duplicated
events.

I measured the average performance impact on some benchmarks with a Nexus 4
without a debugger attached:
* 1%-2% for the computed-goto-based interpreter (default interpreter)
* 5%-10% for the switch-based interpreter.
This is mostly due to the test of the boolean flag for the method entry event.

Bug: https://code.google.com/p/android/issues/detail?id=68427
Bug: 11874828
Change-Id: Ic4ff61375ff6b4ed5825adeac09f61f97b4be619
4 files changed