Merge tag 'android-5.0.0_r5' into HEAD

Android 5.0.0 release 5
ART Extension

Vendor extension hooks.

Change-Id: I2b33c2294415bc909084be5a33ddedd91826559a
ART: minor bugfix

1. reset reference counters during initialization
2. check element existence when removing from GrowableArray

Change-Id: I3a48da94346ecd407febb91ffe61a0ca7da9e8f2
setting RLIMIT to INFINITY.

This is to generate coredumps for processes spawned by zygote

Change-Id: Iecc1eb7784373ffaf3ebfdc60d32d2ae0beb3235
more ART Extension

Vendor extension hooks.

Change-Id: I9f03153bba698e82d1a1e992baf2bc1c48a5d059
art: Update QC-PERF board flag to TARGET_HAVE_QC_PERF

 * Some targets will set QCOM_HARDWARE but won't have these libs.

Change-Id: I84292c190c120b646f5017d4801e7893fed902ff
Fix thread priorities for unstarted threads.

Calls to Thread.setPriority for unstarted threads now behave
similar to dalvik. Note that there's still some inconsistent
behaviour carried over from dalvik.

- high priority threads from bg_non_interactive processes are
  not always moved to the SP_FOREGROUND cgroup.
- we do not attempt to adjust the cgroup of a native thread
  that's attaching.

Note that on android, the system_server will change the
cgroups for all running threads in a process when it moves
into the foreground and background. It's by design that
threads in a background process can request to be moved
to the foreground by setting a higher priority.

bug: 17893086

Change-Id: I1662982b1c7b3ac509698e2e12c9768d082c8053
Avoid signed arithmetic overflow in UTF hash functions.

Change-Id: I3485ef8445a6034661c1e75dc11ab9ad48884458
Avoid signed integer overflow.

Caught by -ftrapv there is a benign integer overflow if a switch has the
value max int within it (as in run-test 095).

Change-Id: I86bb8ce2f9097cb367c031ec51d58d01b31313e2
Avoid signed integer overflow in identity hash code.

Caught by -ftrapv.

Change-Id: Ib8dbb31440ccce88a3c3ce7ea3b2394621616eff
Fix LoadValue{Wide} to free temp when reg classes are not matched

If the current register mapping does not match the required one we
are allocating a new temp and make a copy. After that we are clobbering
the old mapping of VR to physical register. However we can also free it
for future allocations as soon as it will not used more.

This is a fix of the bug I met. The reason of the dex2oat crash was that
GenInlinedMinMaxFP loaded two sources to fp registers. It appeared that
both of them were live in two pairs of core regs. As a result after
loading of them all 4 temps available for x86 platfrom are marked as in use.
As a result after an attempt to allocate new temp to load a constant
required by GenInlinedMinMaxFP register allocator reported that there is
no available temp registers.

Change-Id: I9233012e39de1e574761f3d9bd3cad80d743e522
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
ART: Fix clobbering low part in 32-bit version of X86Mir2Lir::GenNegDouble

If source registers overlap destination registers the low part of result can be clobbered in current implementation.
For example, for 'neg-double v5, v6' bytecode compiler can generates the following instructions:
  lea     ecx, [edx + 0x80000000]
  mov     eax, ecx

The fix forces source registers to be temp so there is no need to copy the low part.

Change-Id: I986ca17d1dc45c9e9d44a66e501cd354af496fde
Signed-off-by: Pavel Vyssotski <pavel.n.vyssotski@intel.com>
Add null check for thread name creation

Previously we didn't check for null which could result in check jni
failures if we tried to throw another OOM in the next allocation.

Bug: 18297817

(cherry picked from commit a7ade888ab99b1453571d14c41d4a0322c400fcd)

Change-Id: Ideef46f4900e546e81fbd9a5225c06698f36e9ac
Fix bad OOM check in Thread::CreatePeer().

Bug: 18342629

(cherry picked from commit 7bcea103af7cd130254835a30b45d5277a478074)

Change-Id: I5d5c7511bbc705d040095f4934d98d326d54d39e
ART: Implicit null check should break def tracking

Implicit null check can provoke exception that needs to be sure all VRs are saved on stack.
The fix is to reset the def tracking system at the moment of adding an implicit null check.

Change-Id: Ie8a32b727086438e04e745d4a3f87f096ff36cac
Signed-off-by: Pavel Vyssotski <pavel.n.vyssotski@intel.com>
Fix reference leaks in ToReflectedMethod and ToReflectedField

Used ScopedLocalRef to fix, added regression tests.

Bug: 18396311

(cherry picked from commit 8c41753e5eda8322b4d992fe88855058f4c0c2e1)

Change-Id: I0ddfc20ac2384c90ff18586242c1f1d9a6d6eb6d
Avoid some recursive aborting.

Bug: 18469797
Change-Id: Ic1889a605a041bdec679ff54f8dce3842d85f2e1
Fix UnimplementedEntryPoint initialziation.

Change-Id: I16c4a8869a210008eede244fc3e5388d882ccaf5
Signed-off-by: Xingxing Pan <xxingpan@gmail.com>
ART: Avoid recursive abort

Bug: 18469797
Change-Id: Ided50bec3377034dd9a995f9f0700a795adb3940
Fix growth limit / footprint limit problems

We now properly clear the growth limit of all the spaces when
ClearGrowthLimit is called. Previously we didn't clear the growth
limit of the background space.

This wasn't caught by heap test since it only manifested itself
when we had a zygote space.

Bug: 18504942

(cherry picked from commit d59c170057dcc213a858652abc71eec710898a41)

Change-Id: I6e4394b9c9f7f22aabc5f5955adb8dd4511c2617