Add sample profiling interface to startMethodTracing.

Art side of this change. Also changed libcore and frameworks base.

Change-Id: I556678013cf1f4e9bef064a1ae43a6109303797c
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
Fix OatFile leak causing dlopen to return stale OatFile contents

Bug: 10917637
Change-Id: If6b7bb8dd9c7aa3d870bd43964f31512385c5d39

Conflicts:
	runtime/class_linker.cc

Change-Id: I337c879d9dc03db677ca809bb15d1e0cade61421
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
Use memcpy instead of Array::Set in mirror::String::AllocFromUtf16.

Also, add a DCHECK on the hashcode if provided.

Change-Id: I604c09c3d0c48ebab8df8f1af0cd65b2507f94a8

Conflicts:
	runtime/mirror/string.cc

Change-Id: Ia0c4061147665ffa50f056272afd452b071bc5fd
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