Fix crash when debugging exception

Fixes a crash when detaching the debugger during an exception event. The cause
is a concurrent modification of Instrumentation::exception_caught_listeners_
list (consequence of debugger being detached) while we loop over its elements.

Workaround the issue by making a copy of the listeners list.

Bug: 13738672
Change-Id: I56b84c5c8f31d6fbda1ba7cb35caeefc5e7ca60f
Speed up single-stepping

During single-stepping sequence, we need to deoptimize everything when we
register a single-step event and undeoptimize everything when it is done. This
causes a slow pattern where we continuously deoptimize-undeoptimize everything
for each single-step.

This CL introduces a special handling of single-step undeoptimization. We now
delay the undeoptimization to the next resume (one thread or all threads) or
the end of the debugging session. Indeed, a single-step event registration is
always followed by a resume command.
At the "resume" point, we know if a single-step event is registered and if we
really need to undeoptimize. At the "registration" point, we know we did not
undeoptimized everything so we don't need to deoptimize everything again.
Therefore, in a sequence of single-steps, we only do a full deoptimization for
the first single-step and a full undeoptimization for the last single-step.

We update logs at deoptimization points so we can track more precisely. Note
they are verbose logs that still must be enabled with -verbose:jdwp option.

We also make some improvement inside instrumentation:
* updates Instrumentation::ShouldNotifyMethodEnterExitEvents to comply with its
name.
* compute frame id only once when looking for the corresponding instrumentation
frame.
* compute the OatMethod once in ClassLinker::GetPortableOatCodeFor to avoid
looking for it again.

Bug: 13577964
Change-Id: If6fa198a676b515cd474b8c4d7bf7ef3626f2dc7
Avoid allocating OatFile::OatClass on the heap.

Avoid allocating a BitVector for OatFile::OatClass::bitmap_
with kOatClassSomeCompiled methods. That makes the OatClass
copy-constructible as it doesn't own any memory. We use that
in OatFile::OatDexFile::GetOatClass() to return the result
by value thus avoiding one or two heap allocations per call.

Change-Id: Ic7098109028a5b49e39ef626f877de86e732ed18
GenArithOpInt should ensure that reg is in core

GenArithOpInt in two-addr case of add-int where destination is in
register should ensure that it is a core reg.

Change-Id: I5b5ca126773a2bb45f9b23ad892102b034d694b4
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
64bit changes to the stack walker for the Quick ABI.

- Spill registers have different sizes.
- The ArtMethod at the bottom of the stack is always of kWordSize.

Change-Id: I92f67ff928477970c393c7146980255d08e8e6af
Revert "Revert "Use LIRSlowPath for throwing ArrayOutOfBoundsException.""

This adds back using LIRSlowPath for ArrayIndexOutOfBoundsException.
And fix the host test crash.

Change-Id: Idbb602f4bb2c5ce59233feb480a0ff1b216e4887
Add an option to specify a list of methods for LIR dumping.

An example would be:
--runtime-arg -verbose-methods:Array.checkRange32,Array.checkRange64
or
"-verbose-methods:void Array.checkRange32,void Array.checkRange64"

Change-Id: I61c1eb3b2eb4b24126a9264261c27889d53cc6bd
Fix dependencies in the test suite for multi-target tests

Change-Id: I94dd767490a7cd8cceddc158d90f56f5bd3fef26
Merge "Fix dependencies in the test suite for multi-target tests"
ART: GTest target tests missing "PASSED"

This seems to have gotten lost a while ago.

Change-Id: Ia0114d4fc0dfcf6e53339307cd556e168312fc53
Merge "ART: GTest target tests missing "PASSED""
Merge "Add an option to specify a list of methods for LIR dumping."
Merge "Revert "Revert "Use LIRSlowPath for throwing ArrayOutOfBoundsException."""
Merge "GenArithOpInt should ensure that reg is in core"
Merge "Speed up single-stepping"
Merge "64bit changes to the stack walker for the Quick ABI."
Revert "64bit changes to the stack walker for the Quick ABI."

This reverts commit 5cb328362a633302ca0fcdbaa0da7d94069df051.

Change-Id: Icc0ec1a9f15c2e4e9103e732d7ba75a4feb853b1
Merge "Revert "64bit changes to the stack walker for the Quick ABI.""
Merge "Fix crash when debugging exception"
Merge "Avoid allocating OatFile::OatClass on the heap."