Skip to content

Commit

Permalink
Added configuration option to support MicroJIT builds of OpenJ9
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Young <scott.young@unb.ca>
  • Loading branch information
Scott-Young-6746 committed May 14, 2020
1 parent 4dcdf53 commit 34681e5
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 2 deletions.
17 changes: 17 additions & 0 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ else
FEATURE_SED_SCRIPT += $(call SedDisable,opt_jitserver)
endif

# 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.
Expand Down Expand Up @@ -315,6 +322,12 @@ else
CMAKE_ARGS += -DJ9VM_OPT_JITSERVER=OFF
endif # OPENJ9_ENABLE_JITSERVER

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 @@ -347,6 +360,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 @@ -4410,7 +4410,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=1588177583
DATE_WHEN_GENERATED=1589488456

###############################################################################
#
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 @@ -43,6 +43,7 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK],
OPENJ9_CONFIGURE_CUDA
OPENJ9_CONFIGURE_DDR
OPENJ9_CONFIGURE_JITSERVER
OPENJ9_CONFIGURE_MICROJIT
if test "x$OPENJDK_TARGET_OS" = xwindows ; then
BASIC_SETUP_OUTPUT_DIR
Expand Down Expand Up @@ -241,6 +242,31 @@ AC_DEFUN([OPENJ9_CONFIGURE_JITSERVER],
AC_SUBST(OPENJ9_ENABLE_JITSERVER)
])

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 @@ -52,6 +52,9 @@ OPENJ9_ENABLE_DDR := @OPENJ9_ENABLE_DDR@
# JITSERVER
OPENJ9_ENABLE_JITSERVER := @OPENJ9_ENABLE_JITSERVER@

# 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 @@ -891,6 +891,7 @@ CYGWIN_LINK
OUTPUT_ROOT
CONF_NAME
SPEC
OPENJ9_ENABLE_MICROJIT
OPENJ9_ENABLE_JITSERVER
OPENJ9_ENABLE_DDR
OPENJ9_GDK_HOME
Expand Down Expand Up @@ -1085,6 +1086,7 @@ with_gdk
enable_cuda
enable_ddr
enable_jitserver
enable_microjit
with_conf_name
with_toolchain_version
with_msvcp_dll
Expand Down Expand Up @@ -1903,6 +1905,7 @@ Optional Features:
--enable-cuda enable CUDA support [disabled]
--enable-ddr enable DDR support [disabled]
--enable-jitserver enable JITServer support [disabled]
--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 @@ -4528,6 +4531,8 @@ VS_SDK_PLATFORM_NAME_2017=








Expand All @@ -4541,7 +4546,7 @@ VS_SDK_PLATFORM_NAME_2017=


# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1588177583
DATE_WHEN_GENERATED=1589488456

###############################################################################
#
Expand Down Expand Up @@ -15914,6 +15919,38 @@ $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




if test "x$OPENJDK_TARGET_OS" = xwindows ; then


Expand Down

0 comments on commit 34681e5

Please sign in to comment.