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
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
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>
A char array copy optimization (dalvik).

Bug: 7103825

(cherry picked from commit dc6cb9c7cb4ef636aa6f542615410b56a67b94dc)

Change-Id: I0b8ab789ffb8702bc134b32398c120cc3ed29b9c
Use RETURN_PTR(NULL) instead of RETURN_VOID in newNonMovableArray.

RETURN_VOID doesn't set the return value. This means that we are
returning random garbage when the allocation doesn't succeed.

Bug: 11971220
Change-Id: I570562c7bb9dc573161294916f582709774b35fd