A char array copy optimization (dalvik).

Bug: 7103825

(cherry picked from commit dc6cb9c7cb4ef636aa6f542615410b56a67b94dc)

Change-Id: I0b8ab789ffb8702bc134b32398c120cc3ed29b9c
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
export setThreadName() and add NULL check

Change-Id: I9b69a23b308fe851ed49722c0da3953433b3f5b8
setting RLIMIT to INFINITY.

This is to generate coredumps for processes spawned by zygote

Change-Id: I2dbac76fbcaa7be3845ba5e12ad064548a25e2e3
dalvik: Fix leak in error condition in FindClass

Release trackedLoader for all exit points in FindClass

Change-Id: I2da26ed6253c2b1b9381bff394596245b993602c
Dalvik: Add sdiv support in the interpreter

This patch adds hardware divide support in the interpreter side of
dalvik. This operation is supported on new armv7 cpus such as A15 or A7.

Opcodes added:
    OP_DIV_INT
    OP_DIV_INT_2ADDR
    OP_DIV_INT_LIT16
    OP_DIV_INT_LIT8
    OP_REM_INT
    OP_REM_INT_2ADDR
    OP_REM_INT_LIT16
    OP_REM_INT_LIT8

Change-Id: Ib1ec5856d957feadd90807fe53ec34cc0e1fd4a2
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Dalvik: Add sdiv support in the JIT

This patch adds hardware divide support in the JIT side of dalvik.
This operation is supported on new armv7 cpus such as A15 or A7.

The following opcodes are enabled and will generate code based using
SDIV instruction:

        OP_DIV_INT
        OP_DIV_INT_2ADDR
        OP_REM_INT
        OP_REM_INT_2ADDR
        OP_DIV_INT_LIT16
        OP_DIV_INT_LIT8
        OP_REM_INT_LIT16
        OP_REM_INT_LIT8

Change-Id: I2b2f9f337f13b5c794df951c4929b6ca0ad583c4
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Dalvik: Add hardware support for OP_LONG_TO_DOUBLE in the interpreter

The following patch adds hardware vfp support for OP_LONG_TO_DOUBLE
in the interpreter. Previously this opcode was implemented using one of
gcc's builtin helpers.

Change-Id: I7713aa03c0b0bed8df592710dd50ab3d13d4bd9b
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Dalvik: Add hardware vfp support for OP_LONG_TO_DOUBLE in JIT

The following patch adds hardware vfp support for OP_LONG_TO_DOUBLE
in the JIT. Previously this opcode was implemented using one of gcc's
builtin helpers.

Change-Id: I3c88b2a527dea99dcefdb34be6695e75993da73e
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Don't implicitly cast NULL to a bool

The code is wrong and causes an error when building with clang 3.4
(-Werror,-Wnull-conversion)

Change-Id: If03aa782fa25337802ff906a0d06071fbda93e26
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Initialize callTgt variable

This silcences a clang build failure:
dalvik/vm/compiler/codegen/arm/armv7-a-neon/../CodegenDriver.cpp:904:41:
error: variable 'callTgt' is uninitialized when used here
[-Werror,-Wuninitialized]
        LOAD_FUNC_ADDR(cUnit, r2, (int) callTgt);
                                        ^~~~~~~

Change-Id: Ic5b3bb492f19b842743bf7d6214c89301ff524e7
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Remove code related to extended-opcode.

- This support was removed one year ago.

(cherry-pick from commit 18b65cbb3ec6634618bd3240a692507432e634b5)

Change-Id: I1154e518dc8a15220f2fcb163056570030492bb0
Change exception message for ArrayStoreException.

The exception message is tested in SystemTest. I'm not sure
what's worse: Changing the dalvik message or changing the test
to be happy with both messages.

(I assume the art message is the one we chose because it's more
recent.)

Change-Id: Ia68641a05f992ab5a949add865fb3f7bb46e61be
Fix dx test 034.

- Test 034 requires that a dex file is dumped in a human readable form
even if the dex file does not contain ClassDef.
Consequently, the command line behavior is modified to satisfy this requirement.

(cherry-pick from commit 64f4aad1e6ef58b29f860b59512ca1a676ac6eb8)

Change-Id: Id64b563745db2b22ec98fba9be25413192c07719
Use MAP_FIXED in remapNewHeap

The heap address must not change when it is remapped

Change-Id: Ia44f178932e2afe8de3d4739e7085caae8568885
Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
vm: Enable fast multiply on perf builds too

Change-Id: I74d152ea9cfe5b15daa9a8353ca27d8afa7474d2
Revert JIT changes for now

 * Need fixed to play nice with perf

Revert "Dalvik: Add hardware vfp support for OP_LONG_TO_DOUBLE in JIT"

This reverts commit eadd85e3c0eceb448f4afb55ab6ef4b5f3b7736a.

Revert "Dalvik: Add sdiv support in the JIT"

This reverts commit c28a3412e2d18872f0eae1b1a96bb29e6f6e0df9.
Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: whitespace

Bug: 12114500
Change-Id: I989c83291d0c42d4cad63f24a3e98a93e231c9d3
Remove old fork-and-specialize API

As promised, this is the cleanup patch-set which removes the
old native "fork and specialize" API, which has been replaced
by a slightly-enhanced one which can close the Zygote socket
descriptors in the Zygote child.

Change-Id: I33f504afd242e268863270139b4e421d4b0728f2
dalvik: add placeholder for future changes

add placeholder for future changes

Change-Id: I09dd704a60857de71cafd7e6b64ee750c5cb95b1