diff --git a/.hgtags b/.hgtags index 0f7e00d2016..fed35de2f35 100644 --- a/.hgtags +++ b/.hgtags @@ -460,7 +460,8 @@ a2008587c13fa05fa2dbfcb09fe987576fbedfd1 jdk-10+32 bbd692ad4fa300ecca7939ffbe3b1d5e52a28cc6 jdk-10+33 89deac44e51517841491ba86ff44aa82a5ca96b3 jdk-10+34 d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35 -cb54a299aa91419cb7caef3992592e7b22488163 jdk-10+36 +0ee20aad71c4f33c426372b4c8bcc1235ce2ec08 jdk-11+0 +959f2f7cbaa6d2ee45d50029744efb219721576c jdk-10+36 4f830b447edf04fb4a52151a5ad44d9bb60723cd jdk-10+37 e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38 5b834ec962366e00d4445352a999a3ac14e26f64 jdk-10+39 diff --git a/make/Main.gmk b/make/Main.gmk index 9e4917b4553..0dc06bd98ef 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -637,7 +637,7 @@ else # Declare dependencies between hotspot-* targets $(foreach v, $(JVM_VARIANTS), \ $(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \ - $(eval hotspot-$v-libs: hotspot-$v-gensrc) \ + $(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \ ) hotspot-ide-project: hotspot exploded-image @@ -691,8 +691,9 @@ else jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc # The swing beans need to have java base properly generated to avoid errors - # in javadoc. - java.desktop-gensrc-src: java.base-gensrc + # in javadoc. The X11 wrappers need the java.base include files to have been + # copied and processed. + java.desktop-gensrc-src: java.base-gensrc java.base-copy # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler # needs classes from the current JDK. diff --git a/make/autoconf/buildjdk-spec.gmk.in b/make/autoconf/buildjdk-spec.gmk.in index aceaef7c452..b01d00b7c35 100644 --- a/make/autoconf/buildjdk-spec.gmk.in +++ b/make/autoconf/buildjdk-spec.gmk.in @@ -55,6 +55,7 @@ OPENJDK_TARGET_CPU_ARCH := @OPENJDK_BUILD_CPU_ARCH@ OPENJDK_TARGET_CPU_BITS := @OPENJDK_BUILD_CPU_BITS@ OPENJDK_TARGET_CPU_ENDIAN := @OPENJDK_BUILD_CPU_ENDIAN@ OPENJDK_TARGET_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@ +OPENJDK_TARGET_OS_INCLUDE_SUBDIR := @OPENJDK_BUILD_OS_INCLUDE_SUBDIR@ HOTSPOT_TARGET_OS := @HOTSPOT_BUILD_OS@ HOTSPOT_TARGET_OS_TYPE := @HOTSPOT_BUILD_OS_TYPE@ diff --git a/make/autoconf/flags.m4 b/make/autoconf/flags.m4 index b1c2982aa65..85a014bdbd5 100644 --- a/make/autoconf/flags.m4 +++ b/make/autoconf/flags.m4 @@ -1162,9 +1162,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER], # Setup some hard coded includes $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \ -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ - -I${TOPDIR}/src/java.base/share/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_$1_OS/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_$1_OS_TYPE/native/include \ + -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I${TOPDIR}/src/java.base/share/native/libjava \ -I${TOPDIR}/src/java.base/$OPENJDK_$1_OS_TYPE/native/libjava \ -I${TOPDIR}/src/hotspot/share/include \ diff --git a/make/autoconf/generated-configure.sh b/make/autoconf/generated-configure.sh index 3381ec75b7c..c762c36d07b 100644 --- a/make/autoconf/generated-configure.sh +++ b/make/autoconf/generated-configure.sh @@ -886,6 +886,8 @@ JAVA BOOT_JDK JAVA_CHECK JAVAC_CHECK +VERSION_CLASSFILE_MINOR +VERSION_CLASSFILE_MAJOR VENDOR_VERSION_STRING VERSION_DATE VERSION_IS_GA @@ -967,6 +969,7 @@ JDK_VARIANT USERNAME TOPDIR PATH_SEP +OPENJDK_BUILD_OS_INCLUDE_SUBDIR HOTSPOT_BUILD_CPU_DEFINE HOTSPOT_BUILD_CPU_ARCH HOTSPOT_BUILD_CPU @@ -977,6 +980,7 @@ OPENJDK_BUILD_CPU_OSARCH OPENJDK_BUILD_CPU_ISADIR OPENJDK_BUILD_CPU_LEGACY_LIB OPENJDK_BUILD_CPU_LEGACY +OPENJDK_TARGET_OS_INCLUDE_SUBDIR HOTSPOT_TARGET_CPU_DEFINE HOTSPOT_TARGET_CPU_ARCH HOTSPOT_TARGET_CPU @@ -16303,6 +16307,14 @@ $as_echo "$COMPILE_TYPE" >&6; } fi + # For historical reasons, the OS include directories have odd names. + OPENJDK_TARGET_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + OPENJDK_TARGET_OS_INCLUDE_SUBDIR="win32" + elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + OPENJDK_TARGET_OS_INCLUDE_SUBDIR="darwin" + fi + # Also store the legacy naming of the cpu. @@ -16454,6 +16466,14 @@ $as_echo "$COMPILE_TYPE" >&6; } fi + # For historical reasons, the OS include directories have odd names. + OPENJDK_BUILD_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + OPENJDK_BUILD_OS_INCLUDE_SUBDIR="win32" + elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + OPENJDK_BUILD_OS_INCLUDE_SUBDIR="darwin" + fi + @@ -25459,6 +25479,10 @@ fi VENDOR_VERSION_STRING="$with_vendor_version_string" fi + # We could define --with flags for these, if really needed + VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR" + VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version string" >&5 $as_echo_n "checking for version string... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_STRING" >&5 @@ -25480,6 +25504,9 @@ $as_echo "$VERSION_STRING" >&6; } + + + ############################################################################### # # Setup BootJDK, used to bootstrap the build. @@ -52752,9 +52779,7 @@ fi # Setup some hard coded includes COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ - -I${TOPDIR}/src/java.base/share/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include \ + -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I${TOPDIR}/src/java.base/share/native/libjava \ -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \ -I${TOPDIR}/src/hotspot/share/include \ @@ -53635,9 +53660,7 @@ fi # Setup some hard coded includes OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK \ -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ - -I${TOPDIR}/src/java.base/share/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS/native/include \ - -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS_TYPE/native/include \ + -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I${TOPDIR}/src/java.base/share/native/libjava \ -I${TOPDIR}/src/java.base/$OPENJDK_BUILD_OS_TYPE/native/libjava \ -I${TOPDIR}/src/hotspot/share/include \ diff --git a/make/autoconf/jdk-version.m4 b/make/autoconf/jdk-version.m4 index c2e300e861a..a3024a3c45a 100644 --- a/make/autoconf/jdk-version.m4 +++ b/make/autoconf/jdk-version.m4 @@ -342,6 +342,10 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], VENDOR_VERSION_STRING="$with_vendor_version_string" fi + # We could define --with flags for these, if really needed + VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR" + VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR" + AC_MSG_CHECKING([for version string]) AC_MSG_RESULT([$VERSION_STRING]) @@ -359,4 +363,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], AC_SUBST(VERSION_IS_GA) AC_SUBST(VERSION_DATE) AC_SUBST(VENDOR_VERSION_STRING) + AC_SUBST(VERSION_CLASSFILE_MAJOR) + AC_SUBST(VERSION_CLASSFILE_MINOR) + ]) diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4 index f62f94daace..654ce9b2b4e 100644 --- a/make/autoconf/platform.m4 +++ b/make/autoconf/platform.m4 @@ -478,6 +478,14 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], fi AC_SUBST(HOTSPOT_$1_CPU_DEFINE) + # For historical reasons, the OS include directories have odd names. + OPENJDK_$1_OS_INCLUDE_SUBDIR="$OPENJDK_TARGET_OS" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + OPENJDK_$1_OS_INCLUDE_SUBDIR="win32" + elif test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + OPENJDK_$1_OS_INCLUDE_SUBDIR="darwin" + fi + AC_SUBST(OPENJDK_$1_OS_INCLUDE_SUBDIR) ]) AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index c41d0b164d1..4fa633f26c9 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -78,6 +78,7 @@ OPENJDK_TARGET_CPU_ISADIR:=@OPENJDK_TARGET_CPU_ISADIR@ OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@ OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@ OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@ +OPENJDK_TARGET_OS_INCLUDE_SUBIDR:=@OPENJDK_TARGET_OS_INCLUDE_SUBDIR@ HOTSPOT_TARGET_OS := @HOTSPOT_TARGET_OS@ HOTSPOT_TARGET_OS_TYPE := @HOTSPOT_TARGET_OS_TYPE@ @@ -100,6 +101,8 @@ OPENJDK_BUILD_CPU_ARCH:=@OPENJDK_BUILD_CPU_ARCH@ OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@ +OPENJDK_BUILD_OS_INCLUDE_SUBIDR:=@OPENJDK_TARGET_OS_INCLUDE_SUBDIR@ + # Target platform value in ModuleTarget class file attribute. OPENJDK_MODULE_TARGET_PLATFORM:=@OPENJDK_MODULE_TARGET_PLATFORM@ @@ -175,6 +178,10 @@ VERSION_DATE := @VERSION_DATE@ # Vendor version string VENDOR_VERSION_STRING := @VENDOR_VERSION_STRING@ +# Class-file version +VERSION_CLASSFILE_MAJOR := @VERSION_CLASSFILE_MAJOR@ +VERSION_CLASSFILE_MINOR := @VERSION_CLASSFILE_MINOR@ + # Convenience CFLAGS settings for passing version information into native programs. VERSION_CFLAGS := \ -DVERSION_FEATURE=$(VERSION_FEATURE) \ @@ -190,6 +197,8 @@ VERSION_CFLAGS := \ -DVERSION_SPECIFICATION='"$(VERSION_SPECIFICATION)"' \ -DVERSION_DATE='"$(VERSION_DATE)"' \ -DVENDOR_VERSION_STRING='"$(VENDOR_VERSION_STRING)"' \ + -DVERSION_CLASSFILE_MAJOR=$(VERSION_CLASSFILE_MAJOR) \ + -DVERSION_CLASSFILE_MINOR=$(VERSION_CLASSFILE_MINOR) \ # # Platform naming variables @@ -576,6 +585,8 @@ INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES)) INTERIM_LANGTOOLS_ADD_EXPORTS := \ --add-exports java.base/sun.reflect.annotation=jdk.compiler.interim \ + --add-exports java.base/jdk.internal.jmod=jdk.compiler.interim \ + --add-exports java.base/jdk.internal.misc=jdk.compiler.interim \ # INTERIM_LANGTOOLS_MODULES_COMMA := $(strip $(subst $(SPACE),$(COMMA),$(strip \ $(INTERIM_LANGTOOLS_MODULES)))) diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers index 60d565c1805..fb748470c00 100644 --- a/make/autoconf/version-numbers +++ b/make/autoconf/version-numbers @@ -30,6 +30,8 @@ DEFAULT_VERSION_INTERIM=0 DEFAULT_VERSION_UPDATE=0 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_DATE=2018-03-20 +DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" +DEFAULT_VERSION_CLASSFILE_MINOR=0 LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK diff --git a/make/common/SetupJavaCompilers.gmk b/make/common/SetupJavaCompilers.gmk index 72bc7e442b7..02b6e442f67 100644 --- a/make/common/SetupJavaCompilers.gmk +++ b/make/common/SetupJavaCompilers.gmk @@ -69,7 +69,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \ JVM := $(JAVA_JAVAC), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -source 10 -target 10 --doclint-format html5 \ + FLAGS := -source 11 -target 11 --doclint-format html5 \ -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) @@ -79,7 +79,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \ JVM := $(JAVA_JAVAC), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -source 10 -target 10 \ + FLAGS := -source 11 -target 11 \ -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 5066599a924..d01fdaeaa16 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -829,7 +829,7 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "javare", revision: "4.2", - build_number: "b10", + build_number: "b11", checksum_file: "MD5_VALUES", file: "jtreg_bin-4.2.zip", environment_name: "JT_HOME", diff --git a/make/copy/Copy-java.base.gmk b/make/copy/Copy-java.base.gmk index 74759879179..096f6c0e903 100644 --- a/make/copy/Copy-java.base.gmk +++ b/make/copy/Copy-java.base.gmk @@ -24,6 +24,7 @@ # include CopyCommon.gmk +include TextFileProcessing.gmk $(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk)) @@ -244,3 +245,16 @@ ifeq ($(ENABLE_LIBFFI_BUNDLING), true) endif ################################################################################ +# Generate classfile_constants.h + +$(eval $(call SetupTextFileProcessing, CREATE_CLASSFILE_CONSTANTS_H, \ + SOURCE_FILES := $(TOPDIR)/src/java.base/share/native/include/classfile_constants.h.template, \ + OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/modules_include/java.base/classfile_constants.h, \ + REPLACEMENTS := \ + @@VERSION_CLASSFILE_MAJOR@@ => $(VERSION_CLASSFILE_MAJOR) ; \ + @@VERSION_CLASSFILE_MINOR@@ => $(VERSION_CLASSFILE_MINOR) ; , \ +)) + +TARGETS += $(CREATE_CLASSFILE_CONSTANTS_H) + +################################################################################ diff --git a/make/copy/CopyCommon.gmk b/make/copy/CopyCommon.gmk index 2956e9ddf92..6d4cdbaf747 100644 --- a/make/copy/CopyCommon.gmk +++ b/make/copy/CopyCommon.gmk @@ -39,20 +39,12 @@ ifneq ($(wildcard $(INCLUDE_SOURCE_DIR)/*), ) $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \ SRC := $(INCLUDE_SOURCE_DIR), \ DEST := $(INCLUDE_TARGET_DIR), \ - FILES := $(shell $(FIND) $(INCLUDE_SOURCE_DIR) -type f), \ + FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_DIR))), \ )) TARGETS += $(COPY_EXPORTED_INCLUDE) endif -# For historical reasons, the OS include directories have odd names. -INCLUDE_TARGET_OS_SUBDIR := $(OPENJDK_TARGET_OS) -ifeq ($(OPENJDK_TARGET_OS), windows) - INCLUDE_TARGET_OS_SUBDIR := win32 -else ifeq ($(OPENJDK_TARGET_OS), macosx) - INCLUDE_TARGET_OS_SUBDIR := darwin -endif - # Use the most specific of OS and OS_TYPE. INCLUDE_SOURCE_OS_DIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/native/include ifeq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), ) @@ -62,8 +54,8 @@ endif ifneq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), ) $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \ SRC := $(INCLUDE_SOURCE_OS_DIR), \ - DEST := $(INCLUDE_TARGET_DIR)/$(INCLUDE_TARGET_OS_SUBDIR), \ - FILES := $(shell $(FIND) $(INCLUDE_SOURCE_OS_DIR) -type f), \ + DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \ + FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_OS_DIR))), \ )) TARGETS += $(COPY_EXPORTED_INCLUDE_OS) diff --git a/make/gensrc/GensrcX11Wrappers.gmk b/make/gensrc/GensrcX11Wrappers.gmk index e506c5c01ff..ca95d0edae9 100644 --- a/make/gensrc/GensrcX11Wrappers.gmk +++ b/make/gensrc/GensrcX11Wrappers.gmk @@ -92,10 +92,10 @@ ifneq ($(COMPILE_TYPE), cross) endif SIZER_CFLAGS := \ - -I${TOPDIR}/src/hotspot/share/include \ - -I${TOPDIR}/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ - -I$(TOPDIR)/src/java.base/share/native/include \ - -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \ + -I$(TOPDIR)/src/hotspot/share/include \ + -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I$(TOPDIR)/src/java.base/share/native/libjava \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \ diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk index 77ee5d99df1..7be0c043f4a 100644 --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -59,8 +59,8 @@ JVM_CFLAGS_INCLUDES += \ -I$(TOPDIR)/src/hotspot/share/precompiled \ -I$(TOPDIR)/src/hotspot/share/include \ -I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \ - -I$(TOPDIR)/src/java.base/share/native/include \ - -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ + -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ -I$(TOPDIR)/src/java.base/share/native/libjimage \ # diff --git a/make/mapfiles/libjava/mapfile-vers b/make/mapfiles/libjava/mapfile-vers index 8b68c02469e..4ee3bc1d72f 100644 --- a/make/mapfiles/libjava/mapfile-vers +++ b/make/mapfiles/libjava/mapfile-vers @@ -258,7 +258,6 @@ SUNWprivate_1.1 { Java_jdk_internal_reflect_NativeConstructorAccessorImpl_newInstance0; Java_jdk_internal_reflect_NativeMethodAccessorImpl_invoke0; Java_jdk_internal_reflect_Reflection_getCallerClass__; - Java_jdk_internal_reflect_Reflection_getCallerClass__I; Java_jdk_internal_reflect_Reflection_getClassAccessFlags; Java_jdk_internal_misc_VM_latestUserDefinedLoader0; Java_jdk_internal_misc_VM_getuid; diff --git a/make/mapfiles/libjava/reorder-sparc b/make/mapfiles/libjava/reorder-sparc index 990ca32b6fb..43f1afda6b1 100644 --- a/make/mapfiles/libjava/reorder-sparc +++ b/make/mapfiles/libjava/reorder-sparc @@ -27,7 +27,6 @@ text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; text: .text%Java_sun_reflect_Reflection_getCallerClass__; -text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_Object_getClass; text: .text%Java_sun_reflect_Reflection_getClassAccessFlags; diff --git a/make/mapfiles/libjava/reorder-sparcv9 b/make/mapfiles/libjava/reorder-sparcv9 index 4e3ce84b862..3e480bb7682 100644 --- a/make/mapfiles/libjava/reorder-sparcv9 +++ b/make/mapfiles/libjava/reorder-sparcv9 @@ -26,7 +26,6 @@ text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; text: .text%Java_sun_reflect_Reflection_getCallerClass__; -text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_java_lang_StringUTF16_isBigEndian; diff --git a/make/mapfiles/libjava/reorder-x86 b/make/mapfiles/libjava/reorder-x86 index de28893a4d2..f294a93c4ba 100644 --- a/make/mapfiles/libjava/reorder-x86 +++ b/make/mapfiles/libjava/reorder-x86 @@ -27,7 +27,6 @@ text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; text: .text%Java_sun_reflect_Reflection_getCallerClass__; -text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_java_lang_StringUTF16_isBigEndian; diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 0b1e086f3a9..0a295cfbb46 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -5844,8 +5844,8 @@ operand immPollPage() operand immByteMapBase() %{ // Get base of card map - predicate((jbyte*)n->get_ptr() == - ((CardTableModRefBS*)(Universe::heap()->barrier_set()))->byte_map_base); + predicate(Universe::heap()->barrier_set()->is_a(BarrierSet::CardTableModRef) && + (jbyte*)n->get_ptr() == ((CardTableModRefBS*)(Universe::heap()->barrier_set()))->byte_map_base); match(ConP); op_cost(0); diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 2a9766f5143..a92e19ab8c6 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -848,7 +848,7 @@ public: // architecture. In debug mode we shrink it in order to test // trampolines, but not so small that branches in the interpreter // are out of range. - static const unsigned long branch_range = INCLUDE_JVMCI ? 128 * M : NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + static const unsigned long branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); static bool reachable_from_branch_at(address branch, address target) { return uabs(target - branch) < branch_range; diff --git a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp index 3059ad37bc6..09860aa0708 100644 --- a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp @@ -71,6 +71,13 @@ int CompiledStaticCall::to_interp_stub_size() { return 7 * NativeInstruction::instruction_size; } +int CompiledStaticCall::to_trampoline_stub_size() { + // Somewhat pessimistically, we count 3 instructions here (although + // there are only two) because we sometimes emit an alignment nop. + // Trampoline stubs are always word aligned. + return 3 * NativeInstruction::instruction_size + wordSize; +} + // Relocation entries for call stub, compiled java to interpreter. int CompiledStaticCall::reloc_to_interp_stub() { return 4; // 3 in emit_to_interp_stub + 1 in emit_call diff --git a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp index bebd5ae8ca9..9e36f607234 100644 --- a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp @@ -109,7 +109,7 @@ void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong forei TRACE_jvmci_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst)); } -void CodeInstaller::pd_relocate_JavaMethod(Handle hotspot_method, jint pc_offset, TRAPS) { +void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, Handle hotspot_method, jint pc_offset, TRAPS) { #ifdef ASSERT Method* method = NULL; // we need to check, this might also be an unresolved method @@ -124,22 +124,22 @@ void CodeInstaller::pd_relocate_JavaMethod(Handle hotspot_method, jint pc_offset case INVOKEINTERFACE: { assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface"); NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); - call->set_destination(SharedRuntime::get_resolve_virtual_call_stub()); _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc)); + call->trampoline_jump(cbuf, SharedRuntime::get_resolve_virtual_call_stub()); break; } case INVOKESTATIC: { assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic"); NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); - call->set_destination(SharedRuntime::get_resolve_static_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::static_call_type); + call->trampoline_jump(cbuf, SharedRuntime::get_resolve_static_call_stub()); break; } case INVOKESPECIAL: { assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial"); NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); - call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type); + call->trampoline_jump(cbuf, SharedRuntime::get_resolve_opt_virtual_call_stub()); break; } default: diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index c15f9fb5f45..077bc595875 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -801,7 +801,7 @@ address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset, assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline"); end_a_stub(); - return stub; + return stub_start_addr; } address MacroAssembler::ic_call(address entry, jint method_index) { diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp index 6a313273ea6..98672792a32 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp @@ -367,3 +367,24 @@ void NativeCallTrampolineStub::set_destination(address new_destination) { set_ptr_at(data_offset, new_destination); OrderAccess::release(); } + +// Generate a trampoline for a branch to dest. If there's no need for a +// trampoline, simply patch the call directly to dest. +address NativeCall::trampoline_jump(CodeBuffer &cbuf, address dest) { + MacroAssembler a(&cbuf); + address stub = NULL; + + if (a.far_branches() + && ! is_NativeCallTrampolineStub_at(instruction_address() + displacement())) { + stub = a.emit_trampoline_stub(instruction_address() - cbuf.insts()->start(), dest); + } + + if (stub == NULL) { + // If we generated no stub, patch this call directly to dest. + // This will happen if we don't need far branches or if there + // already was a trampoline. + set_destination(dest); + } + + return stub; +} diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp index a3a6d6a1302..da61fcf75d1 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp @@ -61,7 +61,7 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { return uint_at(0); } - bool is_blr() const { return (encoding() & 0xfffffc1f) == 0xd63f0000; } + bool is_blr() const { return (encoding() & 0xff9ffc1f) == 0xd61f0000; } // blr(register) or br(register) bool is_adr_aligned() const { return (encoding() & 0xff000000) == 0x10000000; } // adr Xn,