Reject dex files that attempt to use unspecified class access flags

Change-Id: Ib1ecf3dfe1856a9014c2e9b0d6a1725ba7617f98
dalvik: use bionic memmove

use memmove from bionic if it is halfword atomic.

Change-Id: I81c38c2b504483b69b0b1c1e4ffb63cb81d347d5
export setThreadName() and add NULL check

Change-Id: I9b69a23b308fe851ed49722c0da3953433b3f5b8
Set Processes comm name to package name

When debugging audit logs, it is often helpful to
have the packages name. Bear in mind that the
package name is the right most chars up to
TASK_COMM_LEN. Although a possibility of truncation
exists, it can be useful for narrowing down the
possibilities.

Change-Id: Ia735b03f64352d155f8b96e1d47f48e6519b1d4f
Dalvik: DMB Optimisations for TracingJIT

Makes DMB domain ISH or ISHST instead of the implicit System.
ISH (Inner Shareable) should be sufficient for all cores/clusters,
but is not sufficient for GPU or other memory-mapped peripherals

Change-Id: Id159228daba97bc3692d2eb1ee2786bae2ee34a7
(cherry picked from commit 48704eccc23e91f3ee46ea4882d1dfef43646cc4)
Dalvik: DMB Optimisation

Replaces use of 'dmb' and 'dmb st' with inner-shareable versions.
This should improve performance in certain cases without harming
correctness.

Change-Id: Id30f58b93b34bf0e232bb01dc3956a82f7a69c40
(cherry picked from commit 2ea163ba54731afcfa11341a525c33e08d0781fa)
A char array copy optimization (dalvik).

Bug: 7103825

(cherry picked from commit dc6cb9c7cb4ef636aa6f542615410b56a67b94dc)

Change-Id: I0b8ab789ffb8702bc134b32398c120cc3ed29b9c
Dalvik : Increase the upper limit check for DexOpt Deps table

Increasing upper limit check for the Deps table as additonal
jars added causes the dalvik to crash while performing dexopt
on cached jar files. This is needed for passing cts test case
which is part of libcore.java.util.jar.DalvikExecTest class.

CRs-Fixed: 573586
Change-Id: Ic991ca7b49cdd80cdba330edc759ece43361f9fb
dalvik: use T3 branch when target offset is too large

T1 branch has offset limit of [-256, 254]. T3 branch has offset
limit of [-1048576, 1048574]. Use T3 branch when target offset
falls outside T1 range to avoid compiliation abort.

Change-Id: I86809e08236b1f5f5102e3fce4df4b1e72e4b96c
Dalvik: Ensure that the array length complies with the final specifier

JSR-133, which Android 4 should comply with, "final" fields should be
visible to all threads at the time the constructor exits, regardless of
synchronization. This behaviour should also apply to the array lengths
as they are regarded as equivalent in behaviour to "final" fields.
Non-final fields require explicit synchronization in Java for them to be
accessed correctly.

The Dalvik VM in Android ensures constructors for ordinary object behave
properly by inserting a memory barrier ("DMB") on their return if the
object's class has a "final" field.

The issue, however, is that while Dalivk inserts a barrier in
constructors, it doesn't during array create. A barrier ought to be
inserted in order to ensure an array's length is visible when the array
itself can be observed by other threads.

In order for Dalvik to be correct in respect to JSR-133 and the ARM
memory model, it should be modified to have a memory barrier after an
array is allocated and initialized, before it is visible to other
threads.

Change-Id: I329656139264552bbd7cacd8c743b694ee2e0bb8
Signed-off-by: Stuart Monteith <Stuart.Monteith@arm.com>
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>