verifier: Bypass monitor-{enter,exit} depth checks

Per Google Bug 61916[1], the monitor-enter and monitor-exit checks in
dex2oat are excessively strict and will reject some valid APKs, such as
WhatsApp[2].  This change attempts to relax those requirements.

[1] https://code.google.com/p/android/issues/detail?id=61916
[2] http://forum.xda-developers.com/showthread.php?t=2525044

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
compiler: fix cast usage

Issue: reinterpret_cast isn't capable of removing constness.

Solution: Use C style casting which is capable of removing constness.

Change-Id: Id7815208de9c82643096ec0ea530f60361d261ca
More allocation code optimizations.

- Inline Class::AllocObject() and Array::Alloc().
- Inline some short Mutex functions and add LIKELY/UNLIKELY to some
  Mutex functions.
- This change improves the Ritz MemAllocTest by ~6% on Nexus 4 and
  ~10% on host.

Bug: 9986565
Change-Id: I1606c74ddb21676cbc1de1a40e9b076fc23eaea4
Remove memory leaks

Change-Id: I13a74791b1d39edfbba7c7884057fa163c343a9a
Reduce memory allocation in verifier.

Remove the use of a map PcToRegisterLineTable for efficiency (matches Dalvik).
Place the register line register values inside the RegisterLine, saves a
secondary allocation and indirection.
Avoid the use of a deque in RegisterLine to avoid an allocation.
Simplify the SirtRef destructor in non-debug builds.
Saves >100ms from the two threaded compile time of ThinkFree on host.

Change-Id: I2dacba61dbaf284ca02d4c194413e1da221dcb76

Conflicts:
	runtime/sirt_ref.h

Change-Id: I207e77249ebab2732bcc534f248108458eeefa06
Early exit for static fixup if no direct methods.

Change-Id: I401746e48259a98fb0c80144ff5310380889b154
Remove four counter increments out of the allocation path.

- This change removes the four allocation counters (the number of
bytes allocated, the number of objects allocated, the number of bytes
allocated ever, the number of objects allocated ever) from the
dlmalloc space allocation path. Now those counter values are computed
on the fly based on a combination of the two new counters that are
incremented by the GC side (the number of bytes freed ever and the
number of objects freed ever) and mspace_inspect_all() calls.

- This results in a 1-2% speedup (though with some noise) in Ritz
MemAllocTest on Nexus 4.

Bug: 9986565
Change-Id: Id9a8e05a745ac1e5ea7a2b5fd9319814a9d4af13
Fix intrinsification of floatToRawIntBits.

Accidentially lost in quick refactoring in
commit fa57c47f1b72916371a9c2d5c1389219bce655b4.

Change-Id: Ic83cf257306efa66a236f2034ffbff3b53579090
Fix incorrect initial dex cache size.

We were previously setting it to be sizeof(DexCacheClass) instead
of sizeof(DexCache). This was causing some problems with
compaction when I relied on the object sizes being accurate to
visit objects in the bump pointer space.

Bug: 8981901
Change-Id: Iede04763aced041986b1b239368fc867143ad70d
Avoid verifier crash for quickened invoke on null.

When verifying an invoke-virtual-quick on a "null" instance, we can't infer the
class of the method being invoked. This CL handles this case and avoid a crash
due to a failed check in RegType::GetClass.

Also revert changes made to test 082-inline-execute since it succeeds with this
CL now.

Bug: 11427954
Change-Id: I4b2c1deaa43b144684539acea471543716f36fb3
Improve object clone performance and make compaction proof.

Bug: 11551604
Bug: 8981901

Change-Id: I60646d838dbb51e125303d1a8fe869191aa63e78
Use a UniquePtr to clean up global logging std::string*s.

This makes valgrind happier.
Bug: 11670287

Change-Id: I957b94cdc177665e66b069e4d2b2b8d0a4b589c8
Avoid unnecessary copy of dex_gc_map.

Change-Id: I8a7209d92aeee853f6a4e9e9bb0e094c5acd5e05
Avoid some string allocations.

Also avoid building a string one character at a time.

Change-Id: I3db26226c620a730b95637d5bfc23e2d4715cfb9

Conflicts:
	runtime/dex_file.cc

Change-Id: I3db26226c620a730b95637d5bfc23e2d4715cfb9