dalvik: update ARMv6 code to bring in line with ARMv5

Change-Id: I9c60645a4d3fff3567b4b88acd4a6be98a774927
Zygote: Restrict slave mountspace so Dalvik apps can mount system-wide volumes

Android 4.2 implements multi-user storage using per-process mount
namespaces.  Originally, everything under "/" (the entire filesystem
hierarchy) is marked as a recursive-slave mountspace for all zygote
instances.  This is done so that user-storage sandbox mounts under
/storage/emulated are hidden from other apps and users.

Unfortunately this means that any Dalvik app (actually, any program whose
clone/fork ancestry includes a Dalvik zygote, which is everything except
services spawned directly from init) cannot mount system-wide volumes.
Thus, apps like CifsManager are effectively broken in Android 4.2, since
its cifs mounts are only visible to the CifsManager app itself.  All other
apps see empty mountpoints instead of the mounted volume.  Furthermore,
Linux provides no provision for a process to "escape" a recursive-slave
mountspace in versions prior to Linux 3.8 (setns syscall).

Here, we restrict the slave mountspace to /storage (and, due to a possible
kernel bug, /mnt/shell/emulated) so that Dalvik apps can mount system-wide
volumes elsewhere (with appropriate permission, as in earlier versions of
Android), while retaining full multi-user storage compatibility.

This change requires that a tmpfs volume is mounted as /storage in init.rc.
If this volume is unavailable, then Zygote falls back to the previous
behavior of marking the entire filesystem hierarchy as slave.  It also
implicitly requires that EMULATED_STORAGE_TARGET is path-prefixed by (part
of the subhierarchy of) ANDROID_STORAGE, which is the typical case.
dvm: Bring back the ANDROID_DATA override

This got broken by the split-cache patch, and it's impacting the
CTS vm unit. Fixit.

Change-Id: I602824afef19c92a4d2c1702d10c8f0315277227
debug: allow ability to hide GC freed lines in logcat

use setprop dalvik.vm.debug.alloc 0 to disable these noisy logs...

Change-Id: I8692b941901b43d33ea9ee30c288a47b6a3be3b1
JIT: Combine shift & sub for monitor unlock.

Optimize monitor unlock for ARM Thumb2 JIT.
Monitor unlock performs a logical shift left
and sub, replace it with a sub capable of
performing the shift in the same instruction.

This improves performance for usecases involving code
executing in Dalvik.

Change-Id: Iaf062d750c3bc941926f3c3b8a64dc9c7984a477
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
JIT: Hoist loop load operations above loop.

Hoists Dalvik frame load operations outside of loops, when possible.
This improves performance in most loops, and is noticable in many
applications.

Change-Id: Ibe42b509b50a13f19758fd923f31d703e33a51c6
Signed-off-by: Henrik Smiding <henrik.smiding@stericsson.com>
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
JIT: Combine add with shift.

Optimize logical shift for ARM JIT.
Whenever logical shift is followed by an add,
try to replace it with an add capable of performing
the shift in the same instruction.

This improves performance for usecases
involving code executing in Dalvik.

Change-Id: I3cb807b6d6ef4b053a19e2703676a93a930eb963
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
JIT: Combine add with shift and offset for array load & store.

Optimize long and double array load / store for ARM JIT.
Array load / store performs a logical shift left and add,
replace it with add capable of performing shift in the
same instruction.
Array load / store performs an add instead of using offset
for vldr/vstr. Replace the add and vldr/vstr with a vldr/vstr
that is capable of handling offset.

This improves performance for usecases involving long and double
array code execution in Dalvik. E.g WindowOrientation.

Change-Id: I90220c349ab936cdba1987139ccdf4dc31d7bbb0
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
Revert "Support debug info in dexmerge."

This reverts commit 89b53f727b579850a777a99b822aab1d31093db0.

Applied in duplicate

Conflicts:
	dx/src/com/android/dx/merge/DexMerger.java

Change-Id: Ib43ae391be9e48b308d3d55516cd183936891c63
Revert "Disable -Xjnigreflimit."

This reverts commit 02381600796357082dd5e2e6cf5dd2aaf24cdef5.
Excessive JNI: Dump HPROF dump.

This change would dump the heap memory status before we abort the
VM because of excessive JNI refs.

Change-Id: Iaf43ee0f2f40fc007e231dd10d1c6c6d95284896
Add barriers for proper observation sequence.

Change-Id: I5c2ef043920fe60c92304cd2c8a857a805b6e9af
Fix merge error

Change-Id: I9a9ffebaac3364da3408b4c4703d47c159dc24ae
dalvik/vm: Dalvik startup with a low memory footprint

Initialize concurrentStartBytes and createMspace using HEAP_MIN_FREE.
This helps save Android framework memory after boot.

This is for low memory targets only(~512MB RAM & hdpi resolution)
Also, set TARGET_ARCH_LOWMEM in the BoardConfig.mk file of a device
for this patch to take effect.

Change-Id: Ib164c5eaf3236fe2de2697e84de4ee85f8997e94
Disable /cache/dalvik-cache (temporarily?)

When writing to /cache, processes are inheriting their own ownership
permissions instead of the system/metagroup abstraction used in /data,
which makes writing to this dalvik-cache fail.

Go back to using only /data until this is identified and fixed

Change-Id: I9ae19321f158ac86a9c5dd4d2db1268eec278c11
Booting, when dalvik.vm.dexopt-data-only=1 is used
Revert "Zygote: Restrict slave mountspace so Dalvik apps can mount system-wide volumes"

No longer needed as su calls piped through the Superuser daemon run outside
zygote mountspaces.

This reverts commit a4c574321cfe9d874e69d365b1326ccc27f4e9dd.

Change-Id: I39ad8842604b5067dc3e735bcbe5fce1f3454ca8