Review request: Zero assembler port of HotSpot
Gary Benson
gbenson at redhat.com
Mon Aug 17 07:32:52 PDT 2009
Hi all,
Zero is an interpreter-only port of HotSpot that uses no assembler and
can trivially be built on any Linux system. The following webrev adds
Zero support to OpenJDK:
http://cr.openjdk.java.net/~gbenson/zero-07/
There are a number of environment variables that need setting before
running make, but if you are using jdk/make/jdk_generic_profile.sh
to set up your environment then you only need to set two, and a build
can be as simple as:
export CORE_BUILD=true
export ZERO_BUILD=true
. jdk/make/jdk_generic_profile.sh
gmake sanity && gmake
The two mandatory environment variables do the following:
CORE_BUILD
Setting CORE_BUILD to "true" will result in an interpreter-only
HotSpot being built, with neither the client nor the server
compilers. If CORE_BUILD is unset, or set to any other value
than "true", then the compiler(s) will be built as normal.
ZERO_BUILD
Setting ZERO_BUILD to "true" will cause the Zero interpreter to
be used. If ZERO_BUILD is unset, or set to any other value than
"true", the standard, platform-specific interpreter will be used.
The reason for having two separate flags is to allow for Zero builds
with JIT compilers such as Shark (not included in this webrev). To
build HotSpot with Zero and Shark you would set ZERO_BUILD to "true"
but leave CORE_BUILD unset.
Of the other environment variables the following are required when
ZERO_BUILD is set to "true". These are set by
jdk/make/jdk_generic_profile.sh based on the result of uname -m:
ZERO_LIBARCH
This is the name of the architecture-specific subdirectory under
$JAVA_HOME/jre/lib. Typically this will be the same as the output
of uname -m, although there are some exceptions: "amd64" instead
of "x86_64", for example, and "i386" instead of "i686".
ZERO_ARCHDEF
The value of ZERO_ARCHDEF will be passed to the C++ compiler using
-D${ZERO_ARCHDEF} to allow conditionalized platform-specific code.
This is typically set to ZERO_LIBARCH converted to uppercase but,
again, there are exceptions. "i386" becomes "IA32", to match what
HotSpot already does, and on platforms with both 32- and 64-bit
variants ZERO_ARCHDEF corresponds to the 32-bit version, so both
ppc and ppc64 have ZERO_ARCHDEF set to "PPC".
ZERO_ENDIANNESS
This is set to "little" or "big".
ZERO_BITSPERWORD
This is set to "32" or "64".
ZERO_ARCHFLAG
This is a flag that will be passed to the C++ compiler and to the
linker to instruct them to generate code for the particular
platform. This is required for platforms with both 32- and 64-bit
variants where the compiler needs to be told which variant to
build for. ZERO_ARCHFLAG will typically be set to "-m32" or
"-m64", except on 31-bit zSeries where it will be set to "-m31".
Zero uses one external library, libffi, for JNI method invocation.
The following two variables are used to tell the compiler and linker
how to find libffi. These can be set by the user, but if left unset
then jdk/make/jdk_generic_profile.sh will attempt to set them using
pkg-config or, failing that, by supplying defaults pointing to the
standard locations:
LIBFFI_CFLAGS
Flags to be passed to the C++ compiler to build against libffi.
If unset (and pkg-config is not installed, or if libffi is not
built with pkg-config) then this defaults to "".
LIBFFI_LIBS
Flags to be passed to the linker to link against libffi. If
unset (and pkg-config is not installed, or if libffi is not
built with pkg-config) then this defaults to "-lffi".
Cheers,
Gary
--
http://gbenson.net/
More information about the hotspot-dev
mailing list