Use a UniquePtr to clean up global logging std::string*s.

This makes valgrind happier.
Bug: 11670287

Change-Id: I957b94cdc177665e66b069e4d2b2b8d0a4b589c8

Conflicts:
	runtime/base/logging.cc
Search for miranda methods in virtual methods instead of interface.

Also added tests that get miranda methods via reflection and jni.
Miranda methods can't be found via reflection, and have the interface
class as their declaring class when found via jni.

Bug: 11736932
(cherry picked from 201803fb1acd15b9daae51d816e1b08aededdc41)

Change-Id: If6700303698967b7fd2c0152216461c447cbf2f9

Conflicts:
	test/JniTest/JniTest.java
	test/JniTest/jni_test.cc
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: use proper type (jsize) for iteration variable;  whitespace.

Round 3: indentation.

Bug: 12114500
Change-Id: I31d25831b477b076d980c531d57773f9c8c83261
Remove usage of LOCAL_BUILD_HOST_DEX

(cherry picked from commit cc8522f6b89e55a1c9abee181874d3ab29441466)

Change-Id: Ida3baa2acb5918557e52f083aad88b41a685da9e

Conflicts:
	test/Android.mk
Fix BUILD_DALVIK_HOST_JAVA_LIBRARY to BUILD_HOST_DALVIK_JAVA_LIBRARY

(cherry picked from commit d7997ebc2ae418d593fab83afe484f161f52b455)

Change-Id: Ibec6446b8e194e4feb92e18f4676088d201c7077
Manage JDWP errors related to garbage collection.

Returns INVALID_OBJECT error in case of invalid object ID or null object ID in
commands ObjectReference.DisableCollection, ObjectReference.EnableCollection
and ObjectReference.IsCollected.

Note: JDWP specs do not state ObjectReference.EnableCollection must return any
error code. We choose to be more strict so these three commands all behave the
same.

Change-Id: I06fb75b75f7d33cf4d23e121d9541bfd70b778bb

Conflicts:
	runtime/debugger.cc
Use the asm-generic ucontext.h for arm.

There is no ucontext.h in uapi kernel headers, so use the generic one. This
works with or without uapi kernel headers.

Bug: 11559337
Change-Id: Ia6d1dafc15ead99c802be3873dcf20f428650585

Conflicts:
	runtime/common_test.h

Conflicts:
	runtime/common_test.h
Fix build - style issues.

Change-Id: I40540dac2a51ef326e642116b5c64fb581c849f2

Conflicts:
	compiler/dex/quick/dex_file_method_inliner.cc
	compiler/dex/quick/dex_file_method_inliner.h

Conflicts:
	compiler/dex/quick/dex_file_method_inliner.cc

Conflicts:
	compiler/dex/quick/dex_file_method_inliner.cc
	compiler/dex/quick/dex_file_method_inliner.h
Fix build - test issues.

Fix compilation errors in tests.

Change-Id: Id2405edc2eec5bef9ebf5f241db03a0bb4a6b5a3

Conflicts:
	compiler/oat_test.cc
	runtime/common_test.h

Conflicts:
	compiler/oat_test.cc
	runtime/common_test.h
Fix test-art setup.

Change-Id: I5762bd10d0bb8346541346b3d5711200a0208c4f

Conflicts:
	runtime/common_test.h

Conflicts:
	compiler/oat_test.cc
Generate devirtualization map only for native compilation.

Since devirtualization is only supported by the quick compiler, we do not need
to generate devirtualization map for non-compiled method.

Bug: 12171022
Change-Id: Ic7d6882396a05b70c4b8067bd14b7a339e0a93ab

Conflicts:
	compiler/dex/verified_methods_data.cc

Conflicts:
	compiler/dex/verified_methods_data.cc
JNI: NewDirectByteBuffer should allow 0 length buffers.

This makes the implementation symmetric with direct
buffers allocated from java.

- GetDirectBufferAddress returns the address of the buffer
  passed in to NewDirectByteBuffer (and not NULL).
- GetDirectBufferCapaticy returns 0.

bug: https://code.google.com/p/android/issues/detail?id=63055
Change-Id: I55b24623ec4f7670972fed898ea097934c6c0b5f

Conflicts:
	test/JniTest/JniTest.java
	test/JniTest/jni_test.cc

Conflicts:
	test/JniTest/JniTest.java
Change safecast data from set to an ordered vector.

This saves memory and improves performance.

Bug: 12167380
Change-Id: Ica8d9291cdd515e8eab03814fb75a85d424eb629

Conflicts:
	compiler/dex/verified_methods_data.h

Conflicts:
	compiler/dex/verified_methods_data.cc
Avoid inliner spam wrt String.length.

Also, remove a use of std::map for our preferred SafeMap and be more explicit
with types.

Change-Id: I7b9a4bb1f73c22490fe416503e050671e7c99fe0

Conflicts:
	compiler/dex/quick/dex_file_method_inliner.cc

Conflicts:
	compiler/dex/quick/dex_file_method_inliner.cc
	compiler/dex/quick/dex_file_method_inliner.h
Fix JDWP IsCollected command handling.

Update the handling of the JDWP IsCollected command for 'null' object id and
invalid object id.

We follow the RI where 'null' object id triggers an INVALID_OBEJCT error but
an invalid object id does not trigger error and return 'true' result.

Also fix handling of 'null' object id to avoid confusion with valid object id.
We used to rely on ObjectRegistry::Get returning NULL to detect null object id
(in which case we return an INVALID_OBJECT error). The issue is this method
may also return NULL for a valid object id if the corresponding object has
been collected. In this case, we must not return any JDWP error and the result
of the command should be 'true' meaning the object identified by the given id
has been collected.

Bug: 12221035
Change-Id: I013f3759bac7cf5b1e9ee3e8c0d1bb2a11f1b654

Conflicts:
	runtime/debugger.cc
Update ElfWriterMclinker for klp

(cherry picked from commit a6263af9aea65c65744bdd845fed68c4814e9514)

Change-Id: I3eb9fee8afb1ef12aae4c87770882afee637971d

Conflicts:
	runtime/Android.mk

Conflicts:
	compiler/Android.mk
Fix test-art-host to work with latest build project that does not set LOCAL_MODULE_PATH

Change-Id: I75034005d77c6e6a901ca327d7b5ea348cff23dc
Disable LOCAL_DEX_PREOPT for non-default LOCAL_DEX_PREOPT_IMAGE

Change-Id: Id5634250422138195218463e731b2d3772cba48f
art: PRODUCT_DEX_PREOPT_IMAGE_IN_DATA

(cherry picked from commit 483236b6662f6671e4fd31279500af4f196e0ad3)

Change-Id: I0f668dd8e3193f7d00618ff3d4535f39f5744dfd

Conflicts:
	build/Android.oat.mk

Conflicts:
	build/Android.oat.mk
Remove boot.art phony target

Change-Id: Idb1e22828567fa2c89c2e0057d5bc65a70ba2f32

Conflicts:
	build/Android.oat.mk

Conflicts:
	build/Android.oat.mk