Fix minor leaks caused by failed initialization in JNI_CreateJavaVM

Change-Id: I97e4b162fa729c97a1e71786b696f2befed56835
Fix a minor leak in dvmCreateInlineSubsTable

Change-Id: I1dce0e24c861903e8f5eccb23a7e2865ae8c9cec
Fix a minor bug in dvmCreateInterpThread

Change-Id: I452ee02290bc7e0be7fefcf5755c5cd9628142dc
Don't duplicate annotation set ref lists when merging.

See exception reported on this thread:
https://groups.google.com/d/msg/android-contrib/h0sDMo5DVBI/MAMiBv5XR44J

Change-Id: I867a8d2328b32625e5baa0b029f55e373fe11271
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: I8f7c44c87eb73d4da00a48fd86220a62cb0515f5
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
Remove spammy logging from 8470684 investigation.

This has been tracked down to a kernel bug, so we no longer need
the extra diagnostics.

Bug: 8470684
Change-Id: Ib170d1f7b94488ed4acc763f8dddc44c81807aed
Merge "Remove spammy logging from 8470684 investigation."
Fix dx.bat to match the new SDK structure.

(Cherry-picked from c26c1291743ce7877cf11f3dc73d6f0c240229f7)

Change-Id: I57a7678178fc58e2a101c9d86da5009c6ec4f6a0
Merge "Don't duplicate annotation set ref lists when merging."
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
Merge "Fix JIT bug related to immediate doubles"
Teach dex how to parse encoded values from .dex files.

Previously primitive values were treated as opaque byte arrays.
Now the encoded values can be interpreted as their proper types:
integers, indices, floats, chars, etc. This gets complicated
pretty fast due to the dense packing dx performs when encoding
the values.

The encoding code is moved from ValueEncoder. The decoding code
is ported from C++ to Java from Annotation.cpp.

There's a bunch of new tests to make sure the decoding is correct;
porting from C++ to Java was tricky because of the '>>' shifts on
unsigned values. The test input data is generated by dex!

Change-Id: I83b2fc3e16115d667fa94b3dab782d1a9687f3ad
(cherry picked from commit 27847605b9255358f0577ffec28886c450263898)
Change com.android.dx.io.Annotation to use EncodedValue

(cherry picked from commit 4ec022b0b6c84f994ab2fc78934110ad96d0bdec)

Change-Id: Ia420b7661f372c59af8fe62bdab7982a1d2b008f
Mechanical refactoring of dx into two parts.

This splits off a new package, com.android.dex that contains
code for parsing and modelling dex files. This code is usable
both at build time (for compilation and analysis) and at runtime
(for introspection).

The original package, com.android.dx is the tool that compiles
.class files into .dex files. That package also includes utilities
for merging and querying dex files, all visible to the dx command
line application.

In a follow up change I'll move the new com.android.dex package
into the libcore/ project, and configure build rules so that it's
included in both dx.jar and core.jar. The core.jar will then be
able to use it for annotation processing.

Change-Id: I3c58cf87e728e4dda1925a0992c1ee7b8130e81a
(cherry picked from commit bab4abb07335d162ecdb8091fc395cf84803a580)

Conflicts:
	dx/junit-tests/com/android/dx/util/BitIntSetTest.java
	dx/junit-tests/com/android/dx/util/BitsTest.java
	dx/junit-tests/com/android/dx/util/IntListTest.java
	dx/junit-tests/com/android/dx/util/ListIntSetTest.java
	dx/src/com/android/dex/Dex.java
	dx/src/com/android/dex/TableOfContents.java
	dx/src/com/android/dx/annotations/AnnotationAccess.java
	dx/src/com/android/dx/command/Main.java
	dx/src/com/android/dx/dex/code/OutputFinisher.java
	dx/src/com/android/dx/dex/code/form/Form32s.java
	dx/src/com/android/dx/dex/code/form/Form33x.java
	dx/src/com/android/dx/dex/code/form/Form41c.java
	dx/src/com/android/dx/dex/code/form/Form52c.java
	dx/src/com/android/dx/gen/DexGenerator.java
	dx/src/com/android/dx/merge/DexMerger.java
Move dex utilities from dalvik/dx to libcore/dex

Change-Id: If0022a069ba3ac51ae5cdc4b0eabb6b913cd8afe
(cherry picked from commit 7b13a4d41243f81fe80a76e2ff2f877b53610446)

Conflicts:
	dx/src/com/android/dex/Code.java
	dx/src/com/android/dex/Dex.java
	dx/src/com/android/dex/SizeOf.java
	dx/src/com/android/dex/TableOfContents.java
Switch Dex from byte[] to ByteBuffer for backing store. Part 2.

Change-Id: Ifd3672027d075b6c9f8df208a04bc33122c883af
(cherry picked from commit f8357511efd16d76ce4410459c15dbb08b0140b6)

Conflicts:
	dx/src/com/android/dx/merge/DexMerger.java
Merge "Teach dex how to parse encoded values from .dex files."
Merge changes I3ef1ad8c,I0bbbba1a,Ife107fb6,Ia420b766

* changes:
  Switch Dex from byte[] to ByteBuffer for backing store. Part 2.
  Move dex utilities from dalvik/dx to libcore/dex
  Mechanical refactoring of dx into two parts.
  Change com.android.dx.io.Annotation to use EncodedValue
Update dalvik host script for new conscrypt and okhttp classpath entries

Change-Id: I9af7dfeb7387544bff98af55716f3db9808e39cb
Merge "Update dalvik host script for new conscrypt and okhttp classpath entries"