8166417: Integrate Graal-core into JDK for AOT compiler

Reviewed-by: iveresov, erikj, ihse, mchung
This commit is contained in:
Vladimir Kozlov 2016-12-11 12:09:13 -08:00
parent f0b8192dc1
commit 1a40cebca3
7 changed files with 133 additions and 13 deletions

View File

@ -700,6 +700,7 @@ JVM_FEATURES_minimal
JVM_FEATURES_core
JVM_FEATURES_client
JVM_FEATURES_server
INCLUDE_GRAAL
INCLUDE_DTRACE
GCOV_ENABLED
ZIP_EXTERNAL_DEBUG_SYMBOLS
@ -4247,7 +4248,7 @@ pkgadd_help() {
# All valid JVM features, regardless of platform
VALID_JVM_FEATURES="compiler1 compiler2 zero shark minimal dtrace jvmti jvmci \
fprof vm-structs jni-check services management all-gcs nmt cds static-build"
graal fprof vm-structs jni-check services management all-gcs nmt cds static-build"
# All valid JVM variants
VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
@ -5082,7 +5083,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1481213545
DATE_WHEN_GENERATED=1481486918
###############################################################################
#
@ -52768,11 +52769,37 @@ $as_echo "$JVM_FEATURES" >&6; }
JVM_FEATURES_jvmci=""
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.vm.compiler should be built" >&5
$as_echo_n "checking if jdk.vm.compiler should be built... " >&6; }
if [[ " $JVM_FEATURES " =~ " graal " ]] ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
$as_echo "yes, forced" >&6; }
if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
as_fn_error $? "Specified JVM feature 'graal' requires feature 'jvmci'" "$LINENO" 5
fi
INCLUDE_GRAAL="true"
else
# By default enable graal build on linux-X64 and when JVMCI is available
if test "x$JVM_FEATURES_jvmci" = "xjvmci" && test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
JVM_FEATURES_graal="graal"
INCLUDE_GRAAL="true"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
JVM_FEATURES_graal=""
INCLUDE_GRAAL="false"
fi
fi
# All variants but minimal (and custom) get these features
NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
# Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_graal"
JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"

View File

@ -25,7 +25,7 @@
# All valid JVM features, regardless of platform
VALID_JVM_FEATURES="compiler1 compiler2 zero shark minimal dtrace jvmti jvmci \
fprof vm-structs jni-check services management all-gcs nmt cds static-build"
graal fprof vm-structs jni-check services management all-gcs nmt cds static-build"
# All valid JVM variants
VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
@ -263,11 +263,33 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
JVM_FEATURES_jvmci=""
fi
AC_MSG_CHECKING([if jdk.vm.compiler should be built])
if HOTSPOT_CHECK_JVM_FEATURE(graal); then
AC_MSG_RESULT([yes, forced])
if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
AC_MSG_ERROR([Specified JVM feature 'graal' requires feature 'jvmci'])
fi
INCLUDE_GRAAL="true"
else
# By default enable graal build on linux-X64 and when JVMCI is available
if test "x$JVM_FEATURES_jvmci" = "xjvmci" && test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
AC_MSG_RESULT([yes])
JVM_FEATURES_graal="graal"
INCLUDE_GRAAL="true"
else
AC_MSG_RESULT([no])
JVM_FEATURES_graal=""
INCLUDE_GRAAL="false"
fi
fi
AC_SUBST(INCLUDE_GRAAL)
# All variants but minimal (and custom) get these features
NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
# Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_graal"
JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"

View File

@ -764,6 +764,7 @@ PNG_CFLAGS:=@PNG_CFLAGS@
#
INCLUDE_SA=@INCLUDE_SA@
INCLUDE_GRAAL=@INCLUDE_GRAAL@
OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
OS_VERSION_MINOR:=@OS_VERSION_MINOR@

View File

@ -448,7 +448,47 @@ jdk.jvmstat_COPY := aliasmap
################################################################################
jdk.vm.ci_ADD_JAVAC_FLAGS := -Xlint:-exports
# -parameters provides method's parameters information in class file,
# JVMCI compilers make use of that information for various sanity checks.
# Don't use Indy strings concatenation to have good JVMCI startup performance.
jdk.vm.ci_ADD_JAVAC_FLAGS := -parameters -Xlint:-exports -XDstringConcat=inline
################################################################################
jdk.vm.compiler_ADD_JAVAC_FLAGS := -parameters -XDstringConcat=inline
jdk.vm.compiler_EXCLUDES += \
org.graalvm.compiler.core.match.processor \
org.graalvm.compiler.nodeinfo.processor \
org.graalvm.compiler.options.processor \
org.graalvm.compiler.serviceprovider.processor \
org.graalvm.compiler.replacements.verifier \
org.graalvm.compiler.api.directives.test \
org.graalvm.compiler.api.test \
org.graalvm.compiler.asm.aarch64.test \
org.graalvm.compiler.asm.amd64.test \
org.graalvm.compiler.asm.sparc.test \
org.graalvm.compiler.asm.test \
org.graalvm.compiler.core.amd64.test \
org.graalvm.compiler.core.sparc.test \
org.graalvm.compiler.core.test \
org.graalvm.compiler.debug.test \
org.graalvm.compiler.graph.test \
org.graalvm.compiler.hotspot.amd64.test \
org.graalvm.compiler.hotspot.lir.test \
org.graalvm.compiler.hotspot.test \
org.graalvm.compiler.jtt \
org.graalvm.compiler.lir.jtt \
org.graalvm.compiler.lir.test \
org.graalvm.compiler.microbenchmarks \
org.graalvm.compiler.nodes.test \
org.graalvm.compiler.options.test \
org.graalvm.compiler.phases.common.test \
org.graalvm.compiler.replacements.test \
org.graalvm.compiler.test \
org.graalvm.compiler.virtual.bench \
#
################################################################################
@ -511,6 +551,14 @@ ifeq ($(MODULE), jdk.vm.ci)
MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
endif
ifeq ($(MODULE), jdk.vm.compiler)
## WORKAROUND jdk.vm.compiler source structure issue
VM_COMPILER_MODULESOURCEPATH := $(MODULESOURCEPATH) \
$(subst /$(MODULE)/,/*/, $(filter-out %processor/src %test/src %jtt/src %bench/src %microbenchmarks/src, \
$(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
MODULESOURCEPATH := $(call PathList, $(VM_COMPILER_MODULESOURCEPATH))
endif
$(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
MODULE := $(MODULE), \

View File

@ -122,6 +122,7 @@ CORE_EXCLUDED_PACKAGES += \
org.w3c.dom.html \
org.w3c.dom.stylesheets \
org.w3c.dom.xpath \
org.graalvm.compiler.% \
#
CORE_PACKAGES := $(filter-out $(CORE_EXCLUDED_PACKAGES), \

View File

@ -85,10 +85,14 @@ ifneq ($(CREATING_BUILDJDK), true)
buildtools-modules:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileModuleTools.gmk)
buildtools-hotspot:
+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileTools.gmk)
endif
ALL_TARGETS += buildtools-langtools interim-langtools \
interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules
interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules \
buildtools-hotspot
################################################################################
# Special targets for certain modules
@ -547,11 +551,13 @@ else
buildtools-jdk: interim-langtools interim-cldrconverter
buildtools-hotspot: interim-langtools
buildtools-modules: exploded-image-base
$(CORBA_GENSRC_TARGETS): interim-langtools
$(HOTSPOT_GENSRC_TARGETS): interim-langtools
$(HOTSPOT_GENSRC_TARGETS): interim-langtools buildtools-hotspot
$(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
@ -628,6 +634,14 @@ else
# current JDK.
jdk.vm.ci-gensrc-hotspot: java.base-java
# The annotation processing for jdk.vm.compiler needs classes from the current JDK.
jdk.vm.compiler-gensrc-hotspot: java.base-java java.management-java \
jdk.management-java jdk.vm.ci-java jdk.unsupported-java
# For jdk.vm.compiler, the gensrc step is generating a module-info.java.extra
# file to be processed by the gensrc-moduleinfo target.
jdk.vm.compiler-gensrc-moduleinfo: jdk.vm.compiler-gensrc-hotspot
# Explicitly add dependencies for special targets
java.base-java: unpack-sec
@ -788,7 +802,7 @@ endif
# Virtual targets without recipes
buildtools: buildtools-langtools interim-langtools interim-rmic \
buildtools-jdk
buildtools-jdk buildtools-hotspot
hotspot: $(HOTSPOT_VARIANT_TARGETS) hotspot-jsig

View File

@ -144,6 +144,13 @@ ifeq ($(INCLUDE_SA), false)
MODULES_FILTER += jdk.hotspot.agent
endif
################################################################################
# Filter out specific modules
ifeq ($(INCLUDE_GRAAL), false)
MODULES_FILTER += jdk.vm.compiler
endif
################################################################################
# Module list macros