From 3a88dacbec81054ec8878e0fdb0fc7bb9a5c7dbd Mon Sep 17 00:00:00 2001 From: Scott Young Date: Thu, 14 May 2020 18:58:29 -0300 Subject: [PATCH 1/5] Added configuration option to support MicroJIT builds of OpenJ9 Signed-off-by: Scott Young --- closed/OpenJ9.gmk | 17 +++++++++++ jdk/make/closed/autoconf/custom-hook.m4 | 26 ++++++++++++++++ jdk/make/closed/autoconf/custom-spec.gmk.in | 3 ++ .../closed/autoconf/generated-configure.sh | 30 +++++++++++++++++++ 4 files changed, 76 insertions(+) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 611b8013df3..f613d6b406f 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -170,6 +170,13 @@ else # OPENJ9_ENABLE_OPENJDK_METHODHANDLES FEATURE_SED_SCRIPT += $(call SedDisable,opt_openjdkMethodhandle) endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES +# Adjust MicroJIT enablement flags. +ifeq (true,$(OPENJ9_ENABLE_MICROJIT)) + FEATURE_SED_SCRIPT += $(call SedEnable,opt_microjit) +else + FEATURE_SED_SCRIPT += $(call SedDisable,opt_microjit) +endif + # openj9_stage_buildspec_file # --------------------------- # param 1 = The simple name of the file to copy. @@ -346,6 +353,12 @@ else # OPENJ9_ENABLE_OPENJDK_METHODHANDLES CMAKE_ARGS += -DJ9VM_OPT_OPENJDK_METHODHANDLE=OFF endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES +ifeq (true,$(OPENJ9_ENABLE_MICROJIT)) + CMAKE_ARGS += -DJ9VM_OPT_MICROJIT=ON +else + CMAKE_ARGS += -DJ9VM_OPT_MICROJIT=OFF +endif # OPENJ9_ENABLE_MICROJIT + ifneq (,$(filter debug trace, $(LOG_LEVEL))) # The user said LOG=debug or LOG=trace, so tell cmake to echo commands. CMAKE_ARGS += -DCMAKE_VERBOSE_MAKEFILE=ON @@ -389,6 +402,10 @@ ifeq (true,$(OPENJ9_ENABLE_JITSERVER)) endif endif # OPENJ9_ENABLE_JITSERVER +ifeq (true,$(OPENJ9_ENABLE_MICROJIT)) + CUSTOM_COMPILER_ENV_VARS += J9VM_OPT_MICROJIT=1 +endif # OPENJ9_ENABLE_MICROJIT + run-preprocessors-j9 : stage-j9 @$(ECHO) Running OpenJ9 preprocessors with OPENJ9_BUILDSPEC: $(OPENJ9_BUILDSPEC) @$(MKDIR) -p $(J9TOOLS_DIR) diff --git a/jdk/make/closed/autoconf/custom-hook.m4 b/jdk/make/closed/autoconf/custom-hook.m4 index 4b901355a18..5bfba5722f1 100644 --- a/jdk/make/closed/autoconf/custom-hook.m4 +++ b/jdk/make/closed/autoconf/custom-hook.m4 @@ -48,6 +48,7 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK], OPENJ9_CONFIGURE_JITSERVER OPENJ9_CONFIGURE_OPENJDK_METHODHANDLES OPENJ9_CONFIGURE_WARNINGS + OPENJ9_CONFIGURE_MICROJIT if test "x$OPENJDK_TARGET_OS" = xwindows ; then BASIC_SETUP_OUTPUT_DIR @@ -384,6 +385,31 @@ AC_DEFUN([OPENJ9_CONFIGURE_WARNINGS], AC_SUBST(WARNINGS_AS_ERRORS_OPENJ9) ]) +AC_DEFUN([OPENJ9_CONFIGURE_MICROJIT], +[ + AC_ARG_ENABLE([microjit], [AS_HELP_STRING([--enable-microjit], [enable MicroJIT support @<:@disabled@:>@])]) + + AC_MSG_CHECKING([for microjit]) + OPENJ9_ENABLE_MICROJIT=false + if test "x$enable_microjit" = xyes ; then + if test "x$OPENJDK_TARGET_OS" = xlinux ; then + AC_MSG_RESULT([yes (explicitly enabled)]) + OPENJ9_ENABLE_MICROJIT=true + else + AC_MSG_RESULT([no (unsupported platform)]) + AC_MSG_ERROR([MicroJIT is unsupported for $OPENJDK_TARGET_OS]) + fi + elif test "x$enable_microjit" = xno ; then + AC_MSG_RESULT([no (explicitly disabled)]) + elif test "x$enable_microjit" = x ; then + AC_MSG_RESULT([no (default)]) + else + AC_MSG_ERROR([--enable-microjit accepts no argument]) + fi + + AC_SUBST(OPENJ9_ENABLE_MICROJIT) +]) + AC_DEFUN([OPENJ9_PLATFORM_SETUP], [ AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs], diff --git a/jdk/make/closed/autoconf/custom-spec.gmk.in b/jdk/make/closed/autoconf/custom-spec.gmk.in index 74166c6a3ea..322d8cb8495 100644 --- a/jdk/make/closed/autoconf/custom-spec.gmk.in +++ b/jdk/make/closed/autoconf/custom-spec.gmk.in @@ -62,6 +62,9 @@ OPENJ9_ENABLE_INLINE_TYPES := @OPENJ9_ENABLE_INLINE_TYPES@ OPENJ9_ENABLE_JITSERVER := @OPENJ9_ENABLE_JITSERVER@ OPENJ9_ENABLE_OPENJDK_METHODHANDLES := @OPENJ9_ENABLE_OPENJDK_METHODHANDLES@ +# MICROJIT +OPENJ9_ENABLE_MICROJIT := @OPENJ9_ENABLE_MICROJIT@ + # for constructing version output COMPILER_VERSION_STRING := @COMPILER_VERSION_STRING@ USERNAME := @USERNAME@ diff --git a/jdk/make/closed/autoconf/generated-configure.sh b/jdk/make/closed/autoconf/generated-configure.sh index 54277eed70f..7937cc5ba36 100644 --- a/jdk/make/closed/autoconf/generated-configure.sh +++ b/jdk/make/closed/autoconf/generated-configure.sh @@ -898,6 +898,7 @@ SPEC WARNINGS_AS_ERRORS_OPENJ9 WARNINGS_AS_ERRORS_OMR OPENJ9_ENABLE_OPENJDK_METHODHANDLES +OPENJ9_ENABLE_MICROJIT OPENJ9_ENABLE_JITSERVER HEALTHCENTER_JAR OPENJ9_ENABLE_DEMOS @@ -1103,6 +1104,7 @@ enable_jitserver enable_openjdk_methodhandles enable_warnings_as_errors_omr enable_warnings_as_errors_openj9 +enable_microjit with_conf_name with_toolchain_version with_freemarker_jar @@ -1937,6 +1939,7 @@ Optional Features: --disable-warnings-as-errors-openj9 do not consider OpenJ9 native compile warnings to be errors [enabled] + --enable-microjit enable MicroJIT support [disabled] --disable-headful disable building headful support (graphical UI support) [enabled] --enable-hotspot-test-in-build @@ -16424,6 +16427,33 @@ $as_echo "no (explicitly disabled)" >&6; } $as_echo "no (default)" >&6; } else as_fn_error $? "--enable-openjdk-methodhandles accepts no argument" "$LINENO" 5 + # Check whether --enable-microjit was given. +if test "${enable_microjit+set}" = set; then : + enableval=$enable_microjit; +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for microjit" >&5 +$as_echo_n "checking for microjit... " >&6; } + OPENJ9_ENABLE_MICROJIT=false + if test "x$enable_microjit" = xyes ; then + if test "x$OPENJDK_TARGET_OS" = xlinux ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitly enabled)" >&5 +$as_echo "yes (explicitly enabled)" >&6; } + OPENJ9_ENABLE_MICROJIT=true + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (unsupported platform)" >&5 +$as_echo "no (unsupported platform)" >&6; } + as_fn_error $? "MicroJIT is unsupported for $OPENJDK_TARGET_OS" "$LINENO" 5 + fi + elif test "x$enable_microjit" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (explicitly disabled)" >&5 +$as_echo "no (explicitly disabled)" >&6; } + elif test "x$enable_microjit" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 +$as_echo "no (default)" >&6; } + else + as_fn_error $? "--enable-microjit accepts no argument" "$LINENO" 5 fi From d521b6e84edfde58a57e2e698e54660d95e57e22 Mon Sep 17 00:00:00 2001 From: Scott Young Date: Thu, 21 May 2020 20:42:56 -0300 Subject: [PATCH 2/5] Added comment to endif to clarify beginning if statement Signed-off-by: Scott Young --- closed/OpenJ9.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index f613d6b406f..83dce8d3b46 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -175,7 +175,7 @@ ifeq (true,$(OPENJ9_ENABLE_MICROJIT)) FEATURE_SED_SCRIPT += $(call SedEnable,opt_microjit) else FEATURE_SED_SCRIPT += $(call SedDisable,opt_microjit) -endif +endif # OPENJ9_ENABLE_MICROJIT # openj9_stage_buildspec_file # --------------------------- From 946c05a7384336e5a32145cd72aec8a0c9546904 Mon Sep 17 00:00:00 2001 From: Scott Young Date: Thu, 15 Oct 2020 16:17:04 -0300 Subject: [PATCH 3/5] Regenerated autoconf generated files after rebase. Signed-off-by: Scott Young --- jdk/make/closed/autoconf/generated-configure.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jdk/make/closed/autoconf/generated-configure.sh b/jdk/make/closed/autoconf/generated-configure.sh index 7937cc5ba36..ed428c8d5aa 100644 --- a/jdk/make/closed/autoconf/generated-configure.sh +++ b/jdk/make/closed/autoconf/generated-configure.sh @@ -897,8 +897,8 @@ CONF_NAME SPEC WARNINGS_AS_ERRORS_OPENJ9 WARNINGS_AS_ERRORS_OMR -OPENJ9_ENABLE_OPENJDK_METHODHANDLES OPENJ9_ENABLE_MICROJIT +OPENJ9_ENABLE_OPENJDK_METHODHANDLES OPENJ9_ENABLE_JITSERVER HEALTHCENTER_JAR OPENJ9_ENABLE_DEMOS @@ -16427,6 +16427,11 @@ $as_echo "no (explicitly disabled)" >&6; } $as_echo "no (default)" >&6; } else as_fn_error $? "--enable-openjdk-methodhandles accepts no argument" "$LINENO" 5 + fi + + + + # Check whether --enable-microjit was given. if test "${enable_microjit+set}" = set; then : enableval=$enable_microjit; From 1cef9f43cd1f0c095843ff2f15f83d4657f54cfd Mon Sep 17 00:00:00 2001 From: Harpreet Kaur Date: Tue, 15 Mar 2022 16:10:40 -0300 Subject: [PATCH 4/5] Regenerated autoconf configure files after rebase Signed-off-by: Harpreet Kaur --- .../closed/autoconf/generated-configure.sh | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/jdk/make/closed/autoconf/generated-configure.sh b/jdk/make/closed/autoconf/generated-configure.sh index ed428c8d5aa..e438a5ddac5 100644 --- a/jdk/make/closed/autoconf/generated-configure.sh +++ b/jdk/make/closed/autoconf/generated-configure.sh @@ -895,9 +895,9 @@ CYGWIN_LINK OUTPUT_ROOT CONF_NAME SPEC +OPENJ9_ENABLE_MICROJIT WARNINGS_AS_ERRORS_OPENJ9 WARNINGS_AS_ERRORS_OMR -OPENJ9_ENABLE_MICROJIT OPENJ9_ENABLE_OPENJDK_METHODHANDLES OPENJ9_ENABLE_JITSERVER HEALTHCENTER_JAR @@ -4594,6 +4594,8 @@ VS_SDK_PLATFORM_NAME_2017= + + @@ -16432,38 +16434,6 @@ $as_echo "no (default)" >&6; } - # Check whether --enable-microjit was given. -if test "${enable_microjit+set}" = set; then : - enableval=$enable_microjit; -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for microjit" >&5 -$as_echo_n "checking for microjit... " >&6; } - OPENJ9_ENABLE_MICROJIT=false - if test "x$enable_microjit" = xyes ; then - if test "x$OPENJDK_TARGET_OS" = xlinux ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitly enabled)" >&5 -$as_echo "yes (explicitly enabled)" >&6; } - OPENJ9_ENABLE_MICROJIT=true - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (unsupported platform)" >&5 -$as_echo "no (unsupported platform)" >&6; } - as_fn_error $? "MicroJIT is unsupported for $OPENJDK_TARGET_OS" "$LINENO" 5 - fi - elif test "x$enable_microjit" = xno ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (explicitly disabled)" >&5 -$as_echo "no (explicitly disabled)" >&6; } - elif test "x$enable_microjit" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } - else - as_fn_error $? "--enable-microjit accepts no argument" "$LINENO" 5 - fi - - - - # Check whether --enable-warnings-as-errors-omr was given. if test "${enable_warnings_as_errors_omr+set}" = set; then : enableval=$enable_warnings_as_errors_omr; @@ -16513,6 +16483,38 @@ $as_echo "yes (default)" >&6; } + # Check whether --enable-microjit was given. +if test "${enable_microjit+set}" = set; then : + enableval=$enable_microjit; +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for microjit" >&5 +$as_echo_n "checking for microjit... " >&6; } + OPENJ9_ENABLE_MICROJIT=false + if test "x$enable_microjit" = xyes ; then + if test "x$OPENJDK_TARGET_OS" = xlinux ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitly enabled)" >&5 +$as_echo "yes (explicitly enabled)" >&6; } + OPENJ9_ENABLE_MICROJIT=true + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (unsupported platform)" >&5 +$as_echo "no (unsupported platform)" >&6; } + as_fn_error $? "MicroJIT is unsupported for $OPENJDK_TARGET_OS" "$LINENO" 5 + fi + elif test "x$enable_microjit" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (explicitly disabled)" >&5 +$as_echo "no (explicitly disabled)" >&6; } + elif test "x$enable_microjit" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 +$as_echo "no (default)" >&6; } + else + as_fn_error $? "--enable-microjit accepts no argument" "$LINENO" 5 + fi + + + + if test "x$OPENJDK_TARGET_OS" = xwindows ; then From 1a5e46c5429aea12c11fc9643eaeb9ee194ca911 Mon Sep 17 00:00:00 2001 From: Harpreet Kaur Date: Thu, 12 May 2022 19:00:53 -0300 Subject: [PATCH 5/5] Regenerated autoconf configure files after rebase Signed-off-by: Harpreet Kaur --- common/autoconf/generated-configure.sh | 2 +- jdk/make/closed/autoconf/generated-configure.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 263d37f2a0b..e925b9c2012 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4433,7 +4433,7 @@ VS_SDK_PLATFORM_NAME_2017= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1649701470 +DATE_WHEN_GENERATED=1652392606 ############################################################################### # diff --git a/jdk/make/closed/autoconf/generated-configure.sh b/jdk/make/closed/autoconf/generated-configure.sh index e438a5ddac5..fc937d6b0de 100644 --- a/jdk/make/closed/autoconf/generated-configure.sh +++ b/jdk/make/closed/autoconf/generated-configure.sh @@ -4609,7 +4609,7 @@ VS_SDK_PLATFORM_NAME_2017= # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1649701470 +DATE_WHEN_GENERATED=1652392606 ############################################################################### #