Skip to content

Commit 501a05e

Browse files
Added configuration option to support MicroJIT builds of OpenJ9
Signed-off-by: Scott Young <[email protected]>
1 parent ea7d6cb commit 501a05e

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

closed/OpenJ9.gmk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ else
140140
FEATURE_SED_SCRIPT += $(call SedDisable,opt_jitserver)
141141
endif
142142

143+
# Adjust MicroJIT enablement flags.
144+
ifeq (true,$(OPENJ9_ENABLE_MICROJIT))
145+
FEATURE_SED_SCRIPT += $(call SedEnable,opt_microjit)
146+
else
147+
FEATURE_SED_SCRIPT += $(call SedDisable,opt_microjit)
148+
endif
149+
143150
# openj9_stage_buildspec_file
144151
# ---------------------------
145152
# param 1 = The simple name of the file to copy.
@@ -315,6 +322,12 @@ else
315322
CMAKE_ARGS += -DJ9VM_OPT_JITSERVER=OFF
316323
endif # OPENJ9_ENABLE_JITSERVER
317324

325+
ifeq (true,$(OPENJ9_ENABLE_MICROJIT))
326+
CMAKE_ARGS += -DJ9VM_OPT_MICROJIT=ON
327+
else
328+
CMAKE_ARGS += -DJ9VM_OPT_MICROJIT=OFF
329+
endif # OPENJ9_ENABLE_MICROJIT
330+
318331
ifneq (,$(filter debug trace, $(LOG_LEVEL)))
319332
# The user said LOG=debug or LOG=trace, so tell cmake to echo commands.
320333
CMAKE_ARGS += -DCMAKE_VERBOSE_MAKEFILE=ON
@@ -347,6 +360,10 @@ ifeq (true,$(OPENJ9_ENABLE_JITSERVER))
347360
endif
348361
endif # OPENJ9_ENABLE_JITSERVER
349362

363+
ifeq (true,$(OPENJ9_ENABLE_MICROJIT))
364+
CUSTOM_COMPILER_ENV_VARS += J9VM_OPT_MICROJIT=1
365+
endif # OPENJ9_ENABLE_MICROJIT
366+
350367
run-preprocessors-j9 : stage-j9
351368
@$(ECHO) Running OpenJ9 preprocessors with OPENJ9_BUILDSPEC: $(OPENJ9_BUILDSPEC)
352369
@$(MKDIR) -p $(J9TOOLS_DIR)

jdk/make/closed/autoconf/custom-hook.m4

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK],
4343
OPENJ9_CONFIGURE_CUDA
4444
OPENJ9_CONFIGURE_DDR
4545
OPENJ9_CONFIGURE_JITSERVER
46+
OPENJ9_CONFIGURE_MICROJIT
4647
4748
if test "x$OPENJDK_TARGET_OS" = xwindows ; then
4849
BASIC_SETUP_OUTPUT_DIR
@@ -241,6 +242,31 @@ AC_DEFUN([OPENJ9_CONFIGURE_JITSERVER],
241242
AC_SUBST(OPENJ9_ENABLE_JITSERVER)
242243
])
243244

245+
AC_DEFUN([OPENJ9_CONFIGURE_MICROJIT],
246+
[
247+
AC_ARG_ENABLE([microjit], [AS_HELP_STRING([--enable-microjit], [enable MicroJIT support @<:@disabled@:>@])])
248+
249+
AC_MSG_CHECKING([for microjit])
250+
OPENJ9_ENABLE_MICROJIT=false
251+
if test "x$enable_microjit" = xyes ; then
252+
if test "x$OPENJDK_TARGET_OS" = xlinux ; then
253+
AC_MSG_RESULT([yes (explicitly enabled)])
254+
OPENJ9_ENABLE_MICROJIT=true
255+
else
256+
AC_MSG_RESULT([no (unsupported platform)])
257+
AC_MSG_ERROR([MicroJIT is unsupported for $OPENJDK_TARGET_OS])
258+
fi
259+
elif test "x$enable_microjit" = xno ; then
260+
AC_MSG_RESULT([no (explicitly disabled)])
261+
elif test "x$enable_microjit" = x ; then
262+
AC_MSG_RESULT([no (default)])
263+
else
264+
AC_MSG_ERROR([--enable-microjit accepts no argument])
265+
fi
266+
267+
AC_SUBST(OPENJ9_ENABLE_MICROJIT)
268+
])
269+
244270
AC_DEFUN([OPENJ9_PLATFORM_SETUP],
245271
[
246272
AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs],

jdk/make/closed/autoconf/custom-spec.gmk.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ OPENJ9_ENABLE_DDR := @OPENJ9_ENABLE_DDR@
5252
# JITSERVER
5353
OPENJ9_ENABLE_JITSERVER := @OPENJ9_ENABLE_JITSERVER@
5454

55+
# MICROJIT
56+
OPENJ9_ENABLE_MICROJIT := @OPENJ9_ENABLE_MICROJIT@
57+
5558
# for constructing version output
5659
COMPILER_VERSION_STRING := @COMPILER_VERSION_STRING@
5760
USERNAME := @USERNAME@

jdk/make/closed/autoconf/generated-configure.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ CYGWIN_LINK
891891
OUTPUT_ROOT
892892
CONF_NAME
893893
SPEC
894+
OPENJ9_ENABLE_MICROJIT
894895
OPENJ9_ENABLE_JITSERVER
895896
OPENJ9_ENABLE_DDR
896897
OPENJ9_GDK_HOME
@@ -1085,6 +1086,7 @@ with_gdk
10851086
enable_cuda
10861087
enable_ddr
10871088
enable_jitserver
1089+
enable_microjit
10881090
with_conf_name
10891091
with_toolchain_version
10901092
with_msvcp_dll
@@ -1903,6 +1905,7 @@ Optional Features:
19031905
--enable-cuda enable CUDA support [disabled]
19041906
--enable-ddr enable DDR support [disabled]
19051907
--enable-jitserver enable JITServer support [disabled]
1908+
--enable-microjit enable MicroJIT support [disabled]
19061909
--disable-headful disable building headful support (graphical UI
19071910
support) [enabled]
19081911
--enable-hotspot-test-in-build
@@ -4528,6 +4531,8 @@ VS_SDK_PLATFORM_NAME_2017=
45284531

45294532

45304533

4534+
4535+
45314536

45324537

45334538

@@ -15914,6 +15919,38 @@ $as_echo "no (default)" >&6; }
1591415919

1591515920

1591615921

15922+
# Check whether --enable-microjit was given.
15923+
if test "${enable_microjit+set}" = set; then :
15924+
enableval=$enable_microjit;
15925+
fi
15926+
15927+
15928+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for microjit" >&5
15929+
$as_echo_n "checking for microjit... " >&6; }
15930+
OPENJ9_ENABLE_MICROJIT=false
15931+
if test "x$enable_microjit" = xyes ; then
15932+
if test "x$OPENJDK_TARGET_OS" = xlinux ; then
15933+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitly enabled)" >&5
15934+
$as_echo "yes (explicitly enabled)" >&6; }
15935+
OPENJ9_ENABLE_MICROJIT=true
15936+
else
15937+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no (unsupported platform)" >&5
15938+
$as_echo "no (unsupported platform)" >&6; }
15939+
as_fn_error $? "MicroJIT is unsupported for $OPENJDK_TARGET_OS" "$LINENO" 5
15940+
fi
15941+
elif test "x$enable_microjit" = xno ; then
15942+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no (explicitly disabled)" >&5
15943+
$as_echo "no (explicitly disabled)" >&6; }
15944+
elif test "x$enable_microjit" = x ; then
15945+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5
15946+
$as_echo "no (default)" >&6; }
15947+
else
15948+
as_fn_error $? "--enable-microjit accepts no argument" "$LINENO" 5
15949+
fi
15950+
15951+
15952+
15953+
1591715954
if test "x$OPENJDK_TARGET_OS" = xwindows ; then
1591815955

1591915956

0 commit comments

Comments
 (0)