Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added configuration option to support MicroJIT builds of OpenJ9 #413

Open
wants to merge 5 commits into
base: openj9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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_ENABLE_MICROJIT

# openj9_stage_buildspec_file
# ---------------------------
# param 1 = The simple name of the file to copy.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion common/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

###############################################################################
#
Expand Down
26 changes: 26 additions & 0 deletions jdk/make/closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand Down
3 changes: 3 additions & 0 deletions jdk/make/closed/autoconf/custom-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
39 changes: 38 additions & 1 deletion jdk/make/closed/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ CYGWIN_LINK
OUTPUT_ROOT
CONF_NAME
SPEC
OPENJ9_ENABLE_MICROJIT
WARNINGS_AS_ERRORS_OPENJ9
WARNINGS_AS_ERRORS_OMR
OPENJ9_ENABLE_OPENJDK_METHODHANDLES
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -4591,6 +4594,8 @@ VS_SDK_PLATFORM_NAME_2017=








Expand All @@ -4604,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

###############################################################################
#
Expand Down Expand Up @@ -16478,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


Expand Down