Skip to content

Commit 9a7ae63

Browse files
committed
Add new configure option --with-mixedrefs for mixed pointer mode
If --with-mixedrefs is specified in the configure command, the 'default' OPENJ9_LIBS_SUBDIR is used for the build. The mxdptrs CMake file corresponding to the build OS is used as the OPENJ9_BUILDSPEC. --with-mixedrefs=[static/dynamic] sets the reference determination mode. --with-mixedrefs without any value provided defaults to static mode. OMR_MIXED_REFERENCES_MODE is communicated to OpenJ9 and OMR through CMake args. Fail configure if --with-mixedrefs is used without CMake enabled. The new mxdptr build specs are defined in OpenJ9. The compressed and full GC libraries generated with the mixed build work are copied to the OPENJ9_LIBS_SUBDIR alongside the other existing libraries. j9gc29, j9gcchk29 are always copied j9gc_full29, j9gcchk_full29 are copied when running in mixedrefs static mode If an OpenJ9-equivalent OS has been specified in OPENJ9_BUILD_OS, use the specified OS string to override the provided OPENJDK_BUILD_OS. Use OPENJ9_BUILD_MODE_ARCH to capture the other half of the OPENJ9_BUILDSPEC, where the architecture and the pointer mode (or other additional modes/settings) are specified. Signed-off-by: Sharon Wang <[email protected]>
1 parent 04fa704 commit 9a7ae63

File tree

5 files changed

+108
-53
lines changed

5 files changed

+108
-53
lines changed

closed/CopyToBuildJdk.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ $(call openj9_copy_shlibs, \
166166
j9dmp29 \
167167
j9jextract \
168168
j9gc29 \
169+
$(if $(filter static,$(OMR_MIXED_REFERENCES_MODE)),j9gc_full29) \
169170
j9gcchk29 \
171+
$(if $(filter static,$(OMR_MIXED_REFERENCES_MODE)),j9gcchk_full29) \
170172
j9hookable29 \
171173
j9jit29 \
172174
j9jnichk29 \

closed/OpenJ9.gmk

+1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ CMAKE_ARGS := \
255255
-DJ9VM_OMR_DIR=$(OPENJ9OMR_TOPDIR) \
256256
-DBUILD_ID=$(BUILD_ID) \
257257
-DJAVA_SPEC_VERSION=8 \
258+
-DOMR_MIXED_REFERENCES_MODE=$(OMR_MIXED_REFERENCES_MODE) \
258259
-DOPENJ9_BUILD=true
259260

260261
ifeq (windows,$(OPENJDK_TARGET_OS))

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

+47-26
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
6161
[
6262
AC_ARG_WITH(cmake, [AS_HELP_STRING([--with-cmake], [enable building openJ9 with CMake])],
6363
[
64-
if test "x$with_cmake" == xyes -o "x$with_cmake" == x ; then
64+
if test "x$with_cmake" = xyes -o "x$with_cmake" = x ; then
6565
with_cmake=cmake
6666
fi
6767
if test "x$with_cmake" != xno ; then
@@ -74,10 +74,15 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
7474
fi
7575
],
7676
[with_cmake=no])
77-
if test "$with_cmake" == yes ; then
77+
if test "$with_cmake" = yes ; then
7878
OPENJ9_ENABLE_CMAKE=true
7979
else
8080
OPENJ9_ENABLE_CMAKE=false
81+
82+
# Currently, mixedrefs mode is only available with CMake enabled
83+
if test "x$OMR_MIXED_REFERENCES_MODE" != xoff ; then
84+
AC_MSG_ERROR([[--with-mixedrefs=[static|dynamic] requires --with-cmake]])
85+
fi
8186
fi
8287
AC_SUBST(OPENJ9_ENABLE_CMAKE)
8388
])
@@ -270,44 +275,57 @@ AC_DEFUN([OPENJ9_PLATFORM_SETUP],
270275
AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs],
271276
[build non-compressedrefs vm (large heap)])])
272277
278+
AC_ARG_WITH(mixedrefs, [AS_HELP_STRING([--with-mixedrefs],
279+
[build mixedrefs vm (--with-mixedrefs=static or --with-mixedrefs=dynamic)])])
280+
273281
OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
274-
if test "x$with_noncompressedrefs" != x -o "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
275-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}"
282+
283+
# Default OPENJ9_BUILD_OS=OPENJDK_BUILD_OS, but override with OpenJ9 equivalent as appropriate
284+
OPENJ9_BUILD_OS="${OPENJDK_BUILD_OS}"
285+
286+
OMR_MIXED_REFERENCES_MODE=off
287+
if test "x$with_mixedrefs" != x -a "x$with_mixedrefs" != xno; then
288+
if test "x$with_mixedrefs" = xyes -o "x$with_mixedrefs" = xstatic; then
289+
OMR_MIXED_REFERENCES_MODE=static
290+
elif test "x$with_mixedrefs" = xdynamic; then
291+
OMR_MIXED_REFERENCES_MODE=dynamic
292+
else
293+
AC_MSG_ERROR([OpenJ9 supports --with-mixedrefs=static and --with-mixedrefs=dynamic])
294+
fi
295+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_mxdptrs"
296+
OPENJ9_LIBS_SUBDIR=default
297+
elif test "x$with_noncompressedrefs" = xyes ; then
298+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}"
276299
OPENJ9_LIBS_SUBDIR=default
277300
else
278-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}_cmprssptrs"
301+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_cmprssptrs"
279302
OPENJ9_LIBS_SUBDIR=compressedrefs
280303
fi
281304
282305
if test "x$OPENJ9_CPU" = xx86-64 ; then
283-
if test "x$OPENJDK_BUILD_OS" = xlinux ; then
306+
if test "x$OPENJ9_BUILD_OS" = xlinux ; then
284307
OPENJ9_PLATFORM_CODE=xa64
285-
elif test "x$OPENJDK_BUILD_OS" = xwindows ; then
308+
elif test "x$OPENJ9_BUILD_OS" = xwindows ; then
286309
OPENJ9_PLATFORM_CODE=wa64
287-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
288-
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
289-
OPENJ9_PLATFORM_CODE=wi32
290-
OPENJ9_BUILDSPEC="win_x86"
291-
else
292-
OPENJ9_BUILDSPEC="win_x86-64"
293-
fi
294-
else
295-
OPENJ9_BUILDSPEC="win_x86-64_cmprssptrs"
310+
OPENJ9_BUILD_OS=win
311+
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
312+
OPENJ9_PLATFORM_CODE=wi32
313+
OPENJ9_BUILD_MODE_ARCH="x86"
296314
fi
297-
elif test "x$OPENJDK_BUILD_OS" = xmacosx ; then
315+
elif test "x$OPENJ9_BUILD_OS" = xmacosx ; then
298316
OPENJ9_PLATFORM_CODE=oa64
299-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
300-
OPENJ9_BUILDSPEC="osx_x86-64"
301-
else
302-
OPENJ9_BUILDSPEC="osx_x86-64_cmprssptrs"
303-
fi
317+
OPENJ9_BUILD_OS=osx
304318
else
305-
AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJDK_BUILD_OS}!])
319+
AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJ9_BUILD_OS}!])
306320
fi
307321
elif test "x$OPENJ9_CPU" = xppc-64_le ; then
308322
OPENJ9_PLATFORM_CODE=xl64
309-
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
310-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_ppc-64_cmprssptrs_le"
323+
if test "x$OMR_MIXED_REFERENCES_MODE" = xoff ; then
324+
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
325+
OPENJ9_BUILD_MODE_ARCH="ppc-64_cmprssptrs_le"
326+
fi
327+
else
328+
OPENJ9_BUILD_MODE_ARCH="ppc-64_mxdptrs_le"
311329
fi
312330
elif test "x$OPENJ9_CPU" = x390-64 ; then
313331
OPENJ9_PLATFORM_CODE=xz64
@@ -319,9 +337,12 @@ AC_DEFUN([OPENJ9_PLATFORM_SETUP],
319337
AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}!])
320338
fi
321339
340+
OPENJ9_BUILDSPEC="${OPENJ9_BUILD_OS}_${OPENJ9_BUILD_MODE_ARCH}"
341+
322342
AC_SUBST(OPENJ9_BUILDSPEC)
323343
AC_SUBST(OPENJ9_PLATFORM_CODE)
324344
AC_SUBST(OPENJ9_LIBS_SUBDIR)
345+
AC_SUBST(OMR_MIXED_REFERENCES_MODE)
325346
])
326347

327348
AC_DEFUN([OPENJ9_CHECK_NASM_VERSION],
@@ -381,7 +402,7 @@ AC_DEFUN([OPENJ9_THIRD_PARTY_REQUIREMENTS],
381402
382403
FREEMARKER_JAR=
383404
if test "x$OPENJ9_ENABLE_CMAKE" != xtrue ; then
384-
if test "x$with_freemarker_jar" == x -o "x$with_freemarker_jar" == xno ; then
405+
if test "x$with_freemarker_jar" = x -o "x$with_freemarker_jar" = xno ; then
385406
printf "\n"
386407
printf "The FreeMarker library is required to build the OpenJ9 build tools\n"
387408
printf "and has to be provided during configure process.\n"

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

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ OPENJ9_PLATFORM_CODE := @OPENJ9_PLATFORM_CODE@
8080

8181
OPENJ9_LIBS_SUBDIR := @OPENJ9_LIBS_SUBDIR@
8282

83+
# Mixed References Mode
84+
OMR_MIXED_REFERENCES_MODE := @OMR_MIXED_REFERENCES_MODE@
85+
8386
# Export autoconf cache variables for CC/CXX.
8487
# This is for the case where ccache is enabled.
8588
# It ensures that OMR autoconf uses the compiler, not ccache.

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

+55-27
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ CMAKE
905905
USERNAME
906906
JDK_FIX_VERSION
907907
JDK_MOD_VERSION
908+
OMR_MIXED_REFERENCES_MODE
908909
OPENJ9_LIBS_SUBDIR
909910
OPENJ9_PLATFORM_CODE
910911
OPENJ9_BUILDSPEC
@@ -1076,6 +1077,7 @@ with_jvm_variants
10761077
enable_debug
10771078
with_debug_level
10781079
with_noncompressedrefs
1080+
with_mixedrefs
10791081
with_cmake
10801082
with_openj9_cc
10811083
with_openj9_cxx
@@ -1949,6 +1951,8 @@ Optional Packages:
19491951
[release]
19501952
--with-noncompressedrefs
19511953
build non-compressedrefs vm (large heap)
1954+
--with-mixedrefs build mixedrefs vm (--with-mixedrefs=static or
1955+
--with-mixedrefs=dynamic)
19521956
--with-cmake enable building openJ9 with CMake
19531957
--with-openj9-cc build OpenJ9 with a specific C compiler
19541958
--with-openj9-cxx build OpenJ9 with a specific C++ compiler
@@ -4546,7 +4550,7 @@ VS_SDK_PLATFORM_NAME_2017=
45464550

45474551

45484552
# Do not change or remove the following line, it is needed for consistency checks:
4549-
DATE_WHEN_GENERATED=1604507962
4553+
DATE_WHEN_GENERATED=1605209646
45504554

45514555
###############################################################################
45524556
#
@@ -15187,6 +15191,13 @@ fi
1518715191

1518815192

1518915193

15194+
# Check whether --with-mixedrefs was given.
15195+
if test "${with_mixedrefs+set}" = set; then :
15196+
withval=$with_mixedrefs;
15197+
fi
15198+
15199+
15200+
1519015201
# Convert openjdk cpu names to openj9 names
1519115202
case "$build_cpu" in
1519215203
x86_64)
@@ -15209,43 +15220,52 @@ fi
1520915220
;;
1521015221
esac
1521115222

15212-
if test "x$with_noncompressedrefs" != x -o "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
15213-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}"
15223+
15224+
# Default OPENJ9_BUILD_OS=OPENJDK_BUILD_OS, but override with OpenJ9 equivalent as appropriate
15225+
OPENJ9_BUILD_OS="${OPENJDK_BUILD_OS}"
15226+
OMR_MIXED_REFERENCES_MODE=off
15227+
if test "x$with_mixedrefs" != x -a "x$with_mixedrefs" != xno; then
15228+
if test "x$with_mixedrefs" = xyes -o "x$with_mixedrefs" = xstatic; then
15229+
OMR_MIXED_REFERENCES_MODE=static
15230+
elif test "x$with_mixedrefs" = xdynamic; then
15231+
OMR_MIXED_REFERENCES_MODE=dynamic
15232+
else
15233+
as_fn_error $? "OpenJ9 supports --with-mixedrefs=static and --with-mixedrefs=dynamic" "$LINENO" 5
15234+
fi
15235+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_mxdptrs"
15236+
OPENJ9_LIBS_SUBDIR=default
15237+
elif test "x$with_noncompressedrefs" = xyes ; then
15238+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}"
1521415239
OPENJ9_LIBS_SUBDIR=default
1521515240
else
15216-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}_cmprssptrs"
15241+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_cmprssptrs"
1521715242
OPENJ9_LIBS_SUBDIR=compressedrefs
1521815243
fi
1521915244

1522015245
if test "x$OPENJ9_CPU" = xx86-64 ; then
15221-
if test "x$OPENJDK_BUILD_OS" = xlinux ; then
15246+
if test "x$OPENJ9_BUILD_OS" = xlinux ; then
1522215247
OPENJ9_PLATFORM_CODE=xa64
15223-
elif test "x$OPENJDK_BUILD_OS" = xwindows ; then
15248+
elif test "x$OPENJ9_BUILD_OS" = xwindows ; then
1522415249
OPENJ9_PLATFORM_CODE=wa64
15225-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
15226-
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
15227-
OPENJ9_PLATFORM_CODE=wi32
15228-
OPENJ9_BUILDSPEC="win_x86"
15229-
else
15230-
OPENJ9_BUILDSPEC="win_x86-64"
15231-
fi
15232-
else
15233-
OPENJ9_BUILDSPEC="win_x86-64_cmprssptrs"
15250+
OPENJ9_BUILD_OS=win
15251+
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
15252+
OPENJ9_PLATFORM_CODE=wi32
15253+
OPENJ9_BUILD_MODE_ARCH="x86"
1523415254
fi
15235-
elif test "x$OPENJDK_BUILD_OS" = xmacosx ; then
15255+
elif test "x$OPENJ9_BUILD_OS" = xmacosx ; then
1523615256
OPENJ9_PLATFORM_CODE=oa64
15237-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
15238-
OPENJ9_BUILDSPEC="osx_x86-64"
15239-
else
15240-
OPENJ9_BUILDSPEC="osx_x86-64_cmprssptrs"
15241-
fi
15257+
OPENJ9_BUILD_OS=osx
1524215258
else
15243-
as_fn_error $? "Unsupported OpenJ9 platform ${OPENJDK_BUILD_OS}!" "$LINENO" 5
15259+
as_fn_error $? "Unsupported OpenJ9 platform ${OPENJ9_BUILD_OS}!" "$LINENO" 5
1524415260
fi
1524515261
elif test "x$OPENJ9_CPU" = xppc-64_le ; then
1524615262
OPENJ9_PLATFORM_CODE=xl64
15247-
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
15248-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_ppc-64_cmprssptrs_le"
15263+
if test "x$OMR_MIXED_REFERENCES_MODE" = xoff ; then
15264+
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
15265+
OPENJ9_BUILD_MODE_ARCH="ppc-64_cmprssptrs_le"
15266+
fi
15267+
else
15268+
OPENJ9_BUILD_MODE_ARCH="ppc-64_mxdptrs_le"
1524915269
fi
1525015270
elif test "x$OPENJ9_CPU" = x390-64 ; then
1525115271
OPENJ9_PLATFORM_CODE=xz64
@@ -15257,6 +15277,9 @@ fi
1525715277
as_fn_error $? "Unsupported OpenJ9 cpu ${OPENJ9_CPU}!" "$LINENO" 5
1525815278
fi
1525915279

15280+
OPENJ9_BUILDSPEC="${OPENJ9_BUILD_OS}_${OPENJ9_BUILD_MODE_ARCH}"
15281+
15282+
1526015283

1526115284

1526215285

@@ -15277,7 +15300,7 @@ fi
1527715300
# Check whether --with-cmake was given.
1527815301
if test "${with_cmake+set}" = set; then :
1527915302
withval=$with_cmake;
15280-
if test "x$with_cmake" == xyes -o "x$with_cmake" == x ; then
15303+
if test "x$with_cmake" = xyes -o "x$with_cmake" = x ; then
1528115304
with_cmake=cmake
1528215305
fi
1528315306
if test "x$with_cmake" != xno ; then
@@ -15485,10 +15508,15 @@ else
1548515508
with_cmake=no
1548615509
fi
1548715510

15488-
if test "$with_cmake" == yes ; then
15511+
if test "$with_cmake" = yes ; then
1548915512
OPENJ9_ENABLE_CMAKE=true
1549015513
else
1549115514
OPENJ9_ENABLE_CMAKE=false
15515+
15516+
# Currently, mixedrefs mode is only available with CMake enabled
15517+
if test "x$OMR_MIXED_REFERENCES_MODE" != xoff ; then
15518+
as_fn_error $? "--with-mixedrefs=[static|dynamic] requires --with-cmake" "$LINENO" 5
15519+
fi
1549215520
fi
1549315521

1549415522

@@ -17648,7 +17676,7 @@ fi
1764817676

1764917677
FREEMARKER_JAR=
1765017678
if test "x$OPENJ9_ENABLE_CMAKE" != xtrue ; then
17651-
if test "x$with_freemarker_jar" == x -o "x$with_freemarker_jar" == xno ; then
17679+
if test "x$with_freemarker_jar" = x -o "x$with_freemarker_jar" = xno ; then
1765217680
printf "\n"
1765317681
printf "The FreeMarker library is required to build the OpenJ9 build tools\n"
1765417682
printf "and has to be provided during configure process.\n"

0 commit comments

Comments
 (0)