dalvik: Fix for broswer-crashing bug

This applies the fix proposed by Olivier Cozette in
https://code.google.com/p/android/issues/detail?id=37561
and fixes our bug:
https://bugs.launchpad.net/linaro-android/+bug/978060

An alternative fix has been applied since, leaving this one in
as a comment for reference

Change-Id: I54336c83650c1628fd1bb689148bc1dd8843d7c6
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Use -fno-strict-aliasing for libdvm
Signed-off-by: Paul Beeler <sparksco@gmail.com>
Fix handling of annotations whose classes are missing at runtime.

Bug: http://code.google.com/p/android/issues/detail?id=39854
Change-Id: I3089b693ff3084b093f991f991ac9273dea7356d
Reclaiming attribute obj after pthread_create

call pthread_attr_destroy in order to reclaim attribute object.

Change-Id: I2592903ef67101a7c656a3ab0ad243a9716298b5
Optimize dvmHash Loops.

pHashTable->tableSize is working as volatile variable & is evaluated on every iteration.
Help compiler to define tableSize as local(Register) variable.

Change-Id: Iecdea3ecb810319d461ff3924ef21fd6c2d69d1e
GC triggering performance optimizations

Copy the correct starting heap size at process init.
Interfaces to set GC/managed heap parameters.

Change-Id: I1080ba60ae64d546c0f35925bc7c931b89c7600b
Tiny optimization for complier templates for arm.

1. Remove possible bubble in TEMPLATE_STRING_INDEXOF.S
2. Remove 1 instruction and reorder the opcodes
   TEMPLATE_MUL_LONG.S
3. Reorder ldr r2 instruction in TEMPLATE_RETURN.S

Change-Id: I571c1278aa72cb1e6dbc6efe433932d5e9591b80
Fix a leak in Dalvik_dalvik_system_DexFile_openDexFile

Change-Id: I2b394c620af31914606763b35847b7f412774cf4
Fix a minor leaks caused by failed initializations.(typo)

Change-Id: I62bc3ea48938a4f54e9f47218d4025e954a6d566
Dump native stacks for all threads in native code.

Bug: 7432159
Change-Id: I83cb530155edfc35ae3be0f7a2a044245223d2d5
Fix a Field.isAnnotationPresent crash.

For instances of Proxy, generated at runtime, there is no corresponding
.dex file.

Bug: https://code.google.com/p/android/issues/detail?id=24846
Change-Id: I36da43d5279a61b8cb71cdf2bbc3065b6a979830
Remove stray references to non-existent opcodes.

Change-Id: I83ca6ea12344a8df7ef14d600baf5060b76870f5
Fix a tracked reference leak in dvmGenerateProxyClass.

Bug: https://code.google.com/p/android/issues/detail?id=43919
Change-Id: Ib5c217368ba75f4422d0c932c2c67daaaeddea4b
Fix some leaks in VfyBasicBlock & BitVector.

Change-Id: I20050135588fc96268911b8ab690b04c8ad949bc
Disable DalvikVM GC logcat spam

Dalvik logs everytime a garbage collection is run. Disabled to remove
clutter from logcat. Can be renabled by #defining DEBUG.

Change-Id: I57a461857f8d0ecbf223f3c18187f62095adb5b4

Made minor changes to https://github.com/ParanoidAndroid/android_dalvik/commit/36ffd053900b25f46b6260f951852abbc49d5730

Re-enable GC logging by setting DALVIK_LOG_GC
Fix JIT bug related to immediate doubles

Change 256211 (JIT: Performance Fix for const doubles) introduced a
defect that can cause the JIT to use the wrong floating point
double constant in traces in which the following conditions hold:

   o Two (or more) different 64-bit floating point constants are used.
   o The physical register holding the first constant is still live
     at the time the second constant is used.
   o The low 32 bits of the two constants are identical.

In this situation, the load/copy optimization pass will incorrectly
determine that the two constants are the same, delete the load of
the second constant and re-use the first constant value.

Note: this problem only occurs with 64-bit floating point literals.
64-bit long literals are unaffected.

This CL works around the problem, and a subsequent CL will rework
disambiguation of 64-bit immediates in a somewhat cleaner fashion.

(cherry-pick of c1757a6deab0ca0bfd42c38612d92b2f26c41dbe.)

Change-Id: I795b4b753550d2745cbbdd83ae25f4a7088990f6
Fix JIT initialization race

See b/8767735 Slow thread in thread spin test

A race exists in thread creation/JIT initialization that can
leave the JIT permanantly disabled for a thread (typically
the first interpreter thread).

(cherry-pick of 67985d960f5c877f86d0bba251d2d55c7a062b8d.)

Change-Id: Ic7e3a1cde2833ac78455fa5d465156b5e0896fc1
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>
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 vmla.f64 instead of vmuld + vaddd.

Optimize Java double floating-point performance for ARM JIT.
Whenever a double mul is followed with a double add,
replace it with a combined mul and add instruction.

This improves double arithmetic performance for code executing
in Dalvik.

Change-Id: Ia4fccf4fa53aa9fb4a76cbf388f5ea16dcef32b7
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>