fix unintentionally retained finalizables and improve low mem performance

Objects which are eligable for finalization must be retained until
after their finalize methods are called.  However, the VM must
determine the entire set of such objects before retaining any of them;
otherwise the process of retaining a given object may cause others to
become reachable and thus be considered ineligible for finalization
even though they are only reachable via other finalizable objects.
The end result of this mistake is that only a few of the objects which
are finalizable will be recognized at each GC cycle, so it requires
many such cycles to find them all, and if new objects become
finalizable at a faster rate, the VM will never catch up and
eventually run out of memory.

This patch fixes the above mistake and also includes tuning to
minimize the need for GC in low memory situations.
add avian.trace.port property

Setting this property (e.g. -Davian.trace.port=5555) will cause the VM
to start an extra daemon thread which listens on the specified TCP
port for incoming connections and dumps stack traces for all running
threads to that socket.  You can retrieve that dump using e.g. netcat:

  nc localhost 5555
briefly enter idle state in get*Volatile

In order for a thread to enter the "exclusive" state such that no
other threads are active in the VM, it must wait for all active
threads to enter the "idle" state.  In order for this to happen in a
timely manner, threads must check frequently to see if a thread is
waiting to enter the exclusive state.  These checks happen at every
memory allocation, wait, sleep, native call, etc.  However, if a
thread is in a busy loop that does none of those things, it will block
any other thread from entering that state.

The proper way to address this is to detect such loops (or tail
recursion in tail-call-optimized builds) at compile or interpret time
and insert explicit checks.  This hasn't been a high priority thus
far, though, since we had yet to encounter such code in the wild.

Now, however, we find that scala.concurrent.forkjoin.ForkJoinPool.scan
(and possibly some versions of java.util.concurrent.ForkJoinPool.scan,
on which we assume the former is based) has just such a loop.
Fortunately, that loop calls Unsafe.getObjectVolatile, which the VM
implements and thus can treat as a checkpoint.  That's the workaround
we use in this patch.
first step towards supporting Android class library on Windows

A majority of the tests are passing, but more work is needed to get
them all to pass.
fix Android library build regression for non-Windows platforms
rebuild bootimage-generator when vm-objects have changed
exit with error code from test.sh if any test fails
test non-debug build first in ci.sh

If something's broken, the script will fail faster if we test the
faster build first, giving us quicker feedback.
ensure that array classes implement Cloneable and Serializable in bootimage build
ensure that we can intercept static Java methods in bootimage build

Timezone code was broken in the Android class library bootimage build
because the code we use to intercept loading the tzdata file wasn't
working.  The reason is have no way of intercepting static methods at
runtime in the bootimage build without telling the bootimage-generator
we're going to do it ahead of time.  So now we do tell it so.

This commit also removes the need to intercept Thread methods since we
can update Thread.vmThread in VMThread.create instead.
remove -static-libstdc++ -static-libgcc from bootimage-generator-lflags

MinGW-w64's GCC doesn't understand those flags, and we shouldn't be
linking statically or dynamically with either of those libraries.
fix Windows 32-bit bootimage build regression
fix parameter ordering in windows.cpp's MySystem::visit

It's amazing to me that ebp and esp have been swapped for over three
years without anybody noticing.  It was dumb luck that the Trace test
(which is designed to catch just such a thing) happened to fail when I
ran the whole suite, and further investigation revealed that it was
failing maybe five percent of the times it was run.  Now we know why.
fix Windows x86_64 build regression due to unspecified AVIAN_TARGET_FORMAT
allow extra flags to be passed to make in ci.sh
update method table for all classes in updateClassTables

Previously we only updated this table for non-interfaces, but
interfaces may have methods which need updating too.
set SO_NOSIGPIPE socket option when available

This ensures we avoid SIGPIPE on socket disconnect on Darwin.
fix openjdk-src build regression
fix Windows openjdk-src build regression
look for DirectByteBuffer, not ReadWriteDirectByteBuffer

The name of the class we need to use in makeDirectByteBuffer has
changed in Android's libcore, so now we use the new name.