Avoid conditional loads if WORKAROUND_CORTEX_A9_745320 is defined.

No noticeable performance impact by this change.

Bug: 3117632
Change-Id: I31c6adc6cb9999498bb456f1e87f6f04f33e4144

Conflicts:
	CleanSpec.mk
	vm/mterp/armv5te/footer.S
	vm/mterp/out/InterpAsm-armv4t.S
	vm/mterp/out/InterpAsm-armv5te-vfp.S
	vm/mterp/out/InterpAsm-armv5te.S
	vm/mterp/out/InterpAsm-armv7-a-neon.S
	vm/mterp/out/InterpAsm-armv7-a.S
	vm/mterp/out/InterpAsm-x86-atom.S
Don't force optimizations during class init in dexopt.

Some "optimizations" are mandatory, notably those having to do with
access to volatile fields.  We get into an odd situation in dexopt
where we have to initialize and execute <clinit> in a few classes
(primarily Class and Object), but if optimizations are disabled we
don't want to write optimized instructions into the output DEX.

This modifies the class init code to skip the mandatory optimizations
if we're in dexopt.  Either the optimization will happen as a normal
part of dexopt operation, or it won't (in which case it'll be applied
when the class is first loaded in a normal VM).

Bug 3099161.

Change-Id: I11ee5affd5e3ac5a1e8583241acdf3c4de033a96

Conflicts:
	vm/oo/Class.cpp
Lock thread list, show join target

There were some paths to "thread list lock must be held" functions that
weren't locking the thread list.  We now do trylock/unlock in dumpFrames
to ensure that doesn't happen.

Also, append "tid=N" to the "waiting on" line in stack trace output
when we're waiting on a VMThread object (i.e. we're in Thread.join()).

Bug 2827015 (for the thread list lock).

Change-Id: I05aa27dd440c671b22ef7cfe47e31dfe54b0ed2d
Correct verifier merging of primitive arrays

Merging of primitive array types (e.g. float[][] + String[]) was being
handled by the general-purpose type merge, which was determining the
result to be an Object.  It should have been an Object[].

This changes the verifier to treat arrays of primitive as arrays, but
with one fewer dimension.

Bug: 3130586
Change-Id: I35a6c27256f69f142fa2a8c22bc5f995096c9ae1
Remove nio cruft.

Change-Id: Ie0dd478f499e9fa40a4af8f10b81df7144a3e813
Separate HPROF from the GC.

In the beginning, the only way to traverse the roots and heap was to
piggyback off the garbage collector.  As such, HPROF was implemented
by instrumenting the root- and object traversal routines to check a
mode flag and call into HPROF during a GC when the flag was set.

This change moves the HPROF calls out of the GC and into callbacks
invoked through the visitor.  Notably, it allows HPROF dumps to be
computed at any point in time without invoking a GC and potentially
destroying evidence relating to the cause of an OOM.

Change-Id: I2b74c4f10f35af3ca33b7c0bbfe470a8b586ff66

Conflicts:
	vm/alloc/GC.h
	vm/alloc/Heap.cpp
	vm/alloc/MarkSweep.cpp
	vm/alloc/Verify.cpp
	vm/alloc/Visit.cpp
	vm/alloc/Visit.h
Reclassify the pin table as a VM internal root.  The native stack
classification requires an associated thread but are not directly
associated with a thread.  If we encounter an object in the pin table
during an hprof dump hat will fail.

Change-Id: I9e49f88cd632584b5818c702cf80f3f96ec5da85
Resume all threads after performing an HPROF dump.

Change-Id: I83df8359a5d57e6b7cd79d75acc979024e50effb
Check that the debug registry has been started before visting it.

Change-Id: I54605ebcb9a07846bbefc61ea48ba9e148a202fb

Conflicts:
	vm/alloc/Visit.cpp
JIT - support for return-void-barrier [Issue 2992352]

Slight reworking of the memory barrier instruction generation to
generalize it, and then add "dmb st" for the new return-void-barrier
instruction.

Change-Id: Iad95aa5b0ba9b616a17dcbe4c6ca2e3906bb49dc

Conflicts:
	vm/compiler/codegen/arm/CodegenDriver.cpp