Add support for ARMv6J and ARMv6-VFP processor target

Merged in code from gingerbread branch with updated code in ics.
[PATCH] Basic KSM Support

Be sure to add '#define MADV_MERGEABLE 12' to
bionic/libc/include/sys/mman.h so we can have a central place for this

parse the process memory map and inform madvise common HEAP/Stack
regions on fork from zygote

These then can be used by the kernel KSM module to re-join (copy on write)
pages between the various dalvik processes.

As is on a fully loaded system you can expect ~12MB to be indicated to be
scanned by KSM.. of this 10-15% will be saved; as such a recommend a very
slow scan until as any logic to stop scanning while sleeping will require
another process and remove all memory savings provided by this logic.

To activate on a KSM kernel (2min for full scan of ~16m and 1%CPU):

echo 4000 > /sys/kernel/mm/ksm/sleep_millisecs
echo 128 > /sys/kernel/mm/ksm/pages_to_scan
echo 1 > /sys/kernel/mm/ksm/run

Newer kernels only require the last line.

In future additional memory regions and kernel logic may improve this.

Change-Id: I271cbee74a1f02a89c34c6ee9006a4ea81360154
dalvik: fix a bug in redundant branch elimination
ThumbVFP.cpp:231:10: error: variable 'wide' set but not used [-Werror=unused-but-set-variable]

Change-Id: If6828c8cf8c2c4ab28567f6e39126e537d0020c1
Added missing <include sys/resource.h> for gcc-4.7.1

Patch Set 2: Added gcc version check as suggested by jeagoss

Change-Id: I7743d5fab8d026e12ad9e9ef4d4fbabe0a9bded7
dalvik: Update ARMv6 code to compile and bring in line with ARMv5

Change-Id: I2764002422ade74db602cc2292108ed67241f0be
Support debug info in dexmerge and fix max blowup of annotations

Support debug info in dexmerge.

Bug: 4090053

(cherry-pick of bc23c4f3ebaefebb3f1be7732767631f91e165ea.)

Change-Id: I1108933fc03330ff91be3a2edef8b4966977dcd7
Signed-off-by: Jesse Wilson <jesse@swank.ca>

Fix a bug where debugInfos' size wasn't being computed.

Previously debugInfos' size of 0 caused a malformed dex file
because debug data was present but not mentioned in the table
of contents.

Change-Id: I07171aaee12fef9f303fc505909f44ef1a714114

Fix a bug where the max blowup of annotations was incorrect.

I'm not sure where the 1.34 number comes from but it's incorrect.
From the spec, the encoded_annotation is made up of a single byte
plus an unlimited number of uleb128 values. Each of these values
can double in width in the worst case. I received (personal) email
from one user who'd run into a case worse than the incorrect 1.34
limit.

Change-Id: I3b676e6d2b274aaa538ca61ce23945b3d49aff04
dalvik: update ARMv6 code to bring in line with ARMv5

Change-Id: I9c60645a4d3fff3567b4b88acd4a6be98a774927
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: Allow use of cbz/cbnz for conditional branch gen.

Optimize conditional branch generation when comparing
with zero for ARM JIT. When possible use cbz/cbnz
instead of cmp+beq/cmp+bne.

This improves performance for usecases involving
code execution in Dalvik.

Change-Id: Iffd455d9cbb3ef0b1f87caafdae1b72ba3f0d2fc
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
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: Use rsb and shift in easy multiply.

For easy multiplication using reverse subtract (when
lit is 2^n-1) use the barrel shifter for rsb.

This improves arithmetic performance for code executing
in Dalvik. E.g String.hashCode.

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