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

Add a configure option to enable OpenJDK MethodHandles #28

Merged
merged 1 commit into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ else
SPEC_SED_SCRIPT += $(call SedDisable,opt_valhallaValueTypes)
endif

# Adjust OpenJDK MethodHandles enablement flags.
ifeq (true,$(OPENJ9_ENABLE_OPENJDK_METHODHANDLES))
FEATURE_SED_SCRIPT += $(call SedEnable,opt_openjdkMethodhandle)
FEATURE_SED_SCRIPT += $(call SedDisable,opt_methodHandle)
else # OPENJ9_ENABLE_OPENJDK_METHODHANDLES
FEATURE_SED_SCRIPT += $(call SedEnable,opt_methodHandle)
FEATURE_SED_SCRIPT += $(call SedDisable,opt_openjdkMethodhandle)
endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES

# Disable windows rebase.
SPEC_SED_SCRIPT += $(call SedDisable,uma_windowsRebase)

Expand Down Expand Up @@ -426,6 +435,14 @@ ifeq (true,$(OPENJ9_ENABLE_CMAKE))
CMAKE_ARGS += -DJ9VM_OPT_VALHALLA_VALUE_TYPES=OFF
endif # OPENJ9_ENABLE_INLINE_TYPES

ifeq (true,$(OPENJ9_ENABLE_OPENJDK_METHODHANDLES))
CMAKE_ARGS += -DJ9VM_OPT_OPENJDK_METHODHANDLE=ON
CMAKE_ARGS += -DJ9VM_OPT_METHOD_HANDLE=OFF
else # OPENJ9_ENABLE_OPENJDK_METHODHANDLES
CMAKE_ARGS += -DJ9VM_OPT_METHOD_HANDLE=ON
CMAKE_ARGS += -DJ9VM_OPT_OPENJDK_METHODHANDLE=OFF
endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES

$(OUTPUTDIR)/vm/cmake.stamp :
@$(MKDIR) -p $(@D)
cd $(@D) && $(CMAKE) $(CMAKE_ARGS) $(OPENJ9_TOPDIR)
Expand Down Expand Up @@ -479,6 +496,12 @@ AllJclSource = $(call recur_wildcard,$(OPENJ9_TOPDIR)/jcl/src,*.java)

JPP_DEST := $(SUPPORT_OUTPUTDIR)/j9jcl_sources

JPP_TAGS := PLATFORM-$(OPENJ9_PLATFORM_CODE)

ifeq (true,$(OPENJ9_ENABLE_OPENJDK_METHODHANDLES))
JPP_TAGS := $(JPP_TAGS);OPENJDK_METHODHANDLES
endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES

$(J9JCL_SOURCES_DONEFILE) : $(AllJclSource)
@$(ECHO) Generating J9JCL sources
@$(BOOT_JDK)/bin/java \
Expand All @@ -492,7 +515,7 @@ $(J9JCL_SOURCES_DONEFILE) : $(AllJclSource)
-xml jpp_configuration.xml \
-dest "$(call FixPath,$(JPP_DEST))" \
-macro:define "com.ibm.oti.vm.library.version=29" \
-tag:define "PLATFORM-$(OPENJ9_PLATFORM_CODE)"
-tag:define "$(JPP_TAGS)"
@$(MKDIR) -p $(@D)
@$(TOUCH) $@

Expand Down
21 changes: 21 additions & 0 deletions closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK],
OPENJ9_CONFIGURE_WARNINGS
OPENJ9_CONFIGURE_JITSERVER
OPENJ9_CONFIGURE_INLINE_TYPES
OPENJ9_CONFIGURE_OPENJDK_METHODHANDLES
OPENJ9_THIRD_PARTY_REQUIREMENTS
OPENJ9_CHECK_NASM_VERSION
])
Expand Down Expand Up @@ -319,6 +320,26 @@ AC_DEFUN([OPENJ9_CONFIGURE_JITSERVER],
AC_SUBST(OPENJ9_ENABLE_JITSERVER)
])

AC_DEFUN([OPENJ9_CONFIGURE_OPENJDK_METHODHANDLES],
[
AC_MSG_CHECKING([for openjdk-methodhandles])
AC_ARG_ENABLE([openjdk-methodhandles], [AS_HELP_STRING([--enable-openjdk-methodhandles], [enable support for OpenJDK MethodHandles @<:@disabled@:>@])])
OPENJ9_ENABLE_OPENJDK_METHODHANDLES=false

if test "x$enable_openjdk_methodhandles" = xyes ; then
AC_MSG_RESULT([yes (explicitly enabled)])
OPENJ9_ENABLE_OPENJDK_METHODHANDLES=true
elif test "x$enable_openjdk_methodhandles" = xno ; then
AC_MSG_RESULT([no (explicitly disabled)])
elif test "x$enable_openjdk_methodhandles" = x ; then
AC_MSG_RESULT([no (default)])
else
AC_MSG_ERROR([--enable-openjdk-methodhandles accepts no argument])
fi

AC_SUBST(OPENJ9_ENABLE_OPENJDK_METHODHANDLES)
])

AC_DEFUN([OPENJ9_PLATFORM_SETUP],
[
AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs],
Expand Down
3 changes: 3 additions & 0 deletions closed/autoconf/custom-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ OPENJ9_ENABLE_JITSERVER := @OPENJ9_ENABLE_JITSERVER@
# Inline-Types
OPENJ9_ENABLE_INLINE_TYPES := @OPENJ9_ENABLE_INLINE_TYPES@

# OpenJDK MethodHandles
OPENJ9_ENABLE_OPENJDK_METHODHANDLES := @OPENJ9_ENABLE_OPENJDK_METHODHANDLES@

# for constructing version output
COMPILER_VERSION_STRING := @COMPILER_VERSION_STRING@
USERNAME := @USERNAME@
Expand Down