Review request: Zero assembler port

Gary Benson gbenson at redhat.com
Wed Jul 15 06:57:45 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-03/

In order to enable the Zero build, the following environment variables
must be set:

  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.

There are five variables which 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:

  LIBFFI_CFLAGS
    Flags to be passed to the C++ compiler to build against libffi.

  LIBFFI_LIBS
    Flags to be passed to the linker to link against libffi.
    
Ok, I think that's it!    

Cheers,
Gary
    
-- 
http://gbenson.net/



More information about the hotspot-dev mailing list