This monster commit is the first step towards supporting
cross-architecture bootimage builds. The challenge is to build a heap
and code image for the target platform where the word size and
endianess may differ from those of the build architecture. That means
the memory layout of objects may differ due to alignment and size
differences, so we can't just copy objects into the heap image
unchanged; we must copy field by field, resizing values, reversing
endianess and shifting offsets as necessary.
This commit also removes POD (plain old data) type support from the
type generator because it added a lot of complication and little
value.
On Windows, some versions of Git automatically translate Unix line
endings to Windows line endings, which can break the build unless we
treat carriage returns as whitespace when parsing.
We now properly forward the errno value from the child when execvp()
fails, which the parent then uses to for the errno message as well as
including the failed command's name in the message.
Previously, we returned immediately from Monitor.wait if we found we
had been interrupted, but this caused deadlock when waiting to enter
the exclusive state, since we never released Machine::stateLock to
allow active threads to transition into the idle state. This commit
ensures that we at least briefly release the lock without actually
waiting in that case.
In the tails=true build, the calling method cannot always be
determined due to stack frames being optimized away, so we must be
prepared for LogRecord.getSourceMethodName to return null.
We must throw an AbstractMethodError when such a call is executed (not
when the call is compiled), so we compile this case as a call to a
thunk which throws such an error.
Singletons may have embedded object references, and if they are
allocated at fixed memory locations (e.g. if they are larger than
64KB), they must have object masks so the garbage collector knows were
to find said references.
We can't reduce a conditional branch to an unconditional jump unless
both arguments to the comparison are constants *and* those constants
have been resolved. The latter may not be true in the case of a
bootimage build.
We had be using System::Monitor::wait to block threads internally in
the VM as well as to implement Object.wait. However, the interrupted
flag should only be cleared in the latter case, not the former. This
commit adds a new method and changes the semantics of the old one in
order to acheive the desired behavior.
Recent versions of Cygwin's GCC no longer support the -mno-cygwin flag
(compilation works, but linking fails). However, Cygwin now includes
mingw64-i686-gcc, mingw64-x86_64-gcc, and related packages, so we use
those compilers instead. This has the added benefit that we can build
native x86_64 binaries on Cygwin now.
This will break the build for old Cygwin installs, so it will be
necessary to upgrade Cygwin and install the aforementioned packages to
build Avian going forward.
This was causing 8-byte SSE-to-SSE moves involving registers
xmm8-xmm15 to be misencoded on x86_64, leading to incorrect code
generation in methods with lots of local variables of type double.