OpenJDK / jdk / hs
changeset 42758:e36bd90caec5
Merge
author | jwilhelm |
---|---|
date | Tue, 13 Dec 2016 02:04:19 +0100 |
parents | e72326db071c b35c88b07b78 |
children | 0ff64a5b3824 |
files | jdk/test/ProblemList.txt |
diffstat | 28 files changed, 430 insertions(+), 139 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/make/copy/Copy-java.base.gmk Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/make/copy/Copy-java.base.gmk Tue Dec 13 02:04:19 2016 +0100 @@ -100,8 +100,7 @@ # Allow override by ALT_JVMCFG_SRC if it exists JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JVMCFG_SRC)) endif -JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR) -JVMCFG := $(JVMCFG_DIR)/jvm.cfg +JVMCFG := $(LIB_DST_DIR)/jvm.cfg # To do: should this also support -zeroshark?
--- a/jdk/make/copy/Copy-java.desktop.gmk Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/make/copy/Copy-java.desktop.gmk Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2016, 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 @@ -64,7 +64,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) FREETYPE_TARGET_LIB := $(LIB_DST_DIR)/$(call SHARED_LIBRARY,freetype) else - FREETYPE_TARGET_LIB := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6 + FREETYPE_TARGET_LIB := $(LIB_DST_DIR)/$(call SHARED_LIBRARY,freetype).6 endif # We can't use $(install-file) in this rule because it preserves symbolic links and
--- a/jdk/make/launcher/Launcher-java.base.gmk Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/make/launcher/Launcher-java.base.gmk Tue Dec 13 02:04:19 2016 +0100 @@ -74,7 +74,7 @@ BUILD_JEXEC := BUILD_JEXEC_SRC := BUILD_JEXEC_INC := -BUILD_JEXEC_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR) +BUILD_JEXEC_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base # # UNHANDLED: @@ -138,7 +138,7 @@ BUILD_JSPAWNHELPER := BUILD_JSPAWNHELPER_SRC := $(JDK_TOPDIR)/src/java.base/unix/native/jspawnhelper JSPAWNHELPER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/unix/native/libjava -BUILD_JSPAWNHELPER_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR) +BUILD_JSPAWNHELPER_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base LINK_JSPAWNHELPER_OBJECTS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o BUILD_JSPAWNHELPER_LDFLAGS :=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/make/launcher/Launcher-jdk.aot.gmk Tue Dec 13 02:04:19 2016 +0100 @@ -0,0 +1,37 @@ +# +# Copyright (c) 2016, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include LauncherCommon.gmk + +$(eval $(call SetupBuildLauncher, jaotc, \ + MAIN_CLASS := jdk.tools.jaotc.Main, \ + JAVA_ARGS := -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI \ + -XX:+UseAOT \ + -Djvmci.UseProfilingInformation=false \ + -Dgraal.UseExceptionProbability=false \ + -Djvmci.Compiler=graal \ + --add-modules ALL-DEFAULT \ + , \ +))
--- a/jdk/make/launcher/LauncherCommon.gmk Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/make/launcher/LauncherCommon.gmk Tue Dec 13 02:04:19 2016 +0100 @@ -32,13 +32,13 @@ ifeq ($(OPENJDK_TARGET_OS), windows) DISABLE_MAPFILES := true endif - ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,/../lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) + ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,/../lib/jli) # Applications expect to be able to link against libjawt without invoking # System.loadLibrary("jawt") first. This was the behaviour described in the # devloper documentation of JAWT and what worked with OpenJDK6. ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), ) - ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,/../lib$(OPENJDK_TARGET_CPU_LIBDIR)) + ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,/../lib) endif endif @@ -190,9 +190,9 @@ $$(ORIGIN_ARG) \ $$($1_LDFLAGS), \ LDFLAGS_linux := \ - -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \ + -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli, \ LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \ - -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \ + -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli, \ MAPFILE := $$($1_MAPFILE), \ LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \ LIBS_unix := $$($1_LIBS_unix), \
--- a/jdk/make/lib/CoreLibraries.gmk Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/make/lib/CoreLibraries.gmk Tue Dec 13 02:04:19 2016 +0100 @@ -340,9 +340,6 @@ LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS)) -# Append defines depending on target platform -LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS) - ifneq ($(USE_EXTERNAL_LIBZ), true) LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) LIBJLI_EXTRA_FILES += \
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c Tue Dec 13 02:04:19 2016 +0100 @@ -171,8 +171,6 @@ * Main */ -#define GetArch() GetArchPath(CURRENT_DATA_MODEL) - /* Store the name of the executable once computed */ static char *execname = NULL; @@ -184,16 +182,6 @@ return execname; } -const char * -GetArchPath(int nbits) -{ - switch(nbits) { - default: - return LIBARCHNAME; - } -} - - /* * Exports the JNI interface from libjli * @@ -211,7 +199,7 @@ if (sExportedJNIFunctions != NULL) return sExportedJNIFunctions; char jrePath[PATH_MAX]; - jboolean gotJREPath = GetJREPath(jrePath, sizeof(jrePath), GetArch(), JNI_FALSE); + jboolean gotJREPath = GetJREPath(jrePath, sizeof(jrePath), JNI_FALSE); if (!gotJREPath) { JLI_ReportErrorMessage("Failed to GetJREPath()"); return NULL; @@ -229,7 +217,7 @@ } char jvmPath[PATH_MAX]; - jboolean gotJVMPath = GetJVMPath(jrePath, preferredJVM, jvmPath, sizeof(jvmPath), GetArch(), CURRENT_DATA_MODEL); + jboolean gotJVMPath = GetJVMPath(jrePath, preferredJVM, jvmPath, sizeof(jvmPath), CURRENT_DATA_MODEL); if (!gotJVMPath) { JLI_ReportErrorMessage("Failed to GetJVMPath()"); return NULL; @@ -390,7 +378,6 @@ /* Check data model flags, and exec process, if needed */ { - char *arch = (char *)GetArch(); /* like sparc or sparcv9 */ char * jvmtype = NULL; int argc = *pargc; char **argv = *pargv; @@ -462,7 +449,7 @@ jvmpath does not exist */ if (wanted == running) { /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { + if (!GetJREPath(jrepath, so_jrepath, JNI_FALSE) ) { JLI_ReportErrorMessage(JRE_ERROR1); exit(2); } @@ -481,7 +468,7 @@ exit(4); } - if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch, wanted)) { + if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, wanted)) { JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath); exit(4); } @@ -502,7 +489,7 @@ #if defined(DUAL_MODE) if (running != wanted) { /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, GetArchPath(wanted), JNI_TRUE)) { + if (!GetJREPath(jrepath, so_jrepath, JNI_TRUE)) { /* give up and let other code report error message */ JLI_ReportErrorMessage(JRE_ERROR2, wanted); exit(1); @@ -526,7 +513,7 @@ } /* exec child can do error checking on the existence of the path */ - jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, GetArchPath(wanted), wanted); + jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, wanted); } #else /* ! DUAL_MODE */ JLI_ReportErrorMessage(JRE_ERROR2, wanted); @@ -579,7 +566,7 @@ */ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, const char * arch, int bitsWanted) + char *jvmpath, jint jvmpathsize, int bitsWanted) { struct stat s; @@ -613,7 +600,7 @@ * Find path to JRE based on .exe's location or registry settings. */ static jboolean -GetJREPath(char *path, jint pathsize, const char * arch, jboolean speculative) +GetJREPath(char *path, jint pathsize, jboolean speculative) { char libjava[MAXPATHLEN]; @@ -841,7 +828,7 @@ void* SplashProcAddress(const char* name) { if (!hSplashLib) { char jrePath[PATH_MAX]; - if (!GetJREPath(jrePath, sizeof(jrePath), GetArch(), JNI_FALSE)) { + if (!GetJREPath(jrePath, sizeof(jrePath), JNI_FALSE)) { JLI_ReportErrorMessage(JRE_ERROR1); return NULL; }
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CipherBlockChaining.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CipherBlockChaining.java Tue Dec 13 02:04:19 2016 +0100 @@ -142,6 +142,9 @@ */ int encrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) { + if (plainLen <= 0) { + return plainLen; + } cryptBlockSizeCheck(plainLen); cryptNullAndBoundsCheck(plain, plainOffset, plainLen); cryptNullAndBoundsCheck(cipher, cipherOffset, plainLen); @@ -190,6 +193,9 @@ */ int decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) { + if (cipherLen <= 0) { + return cipherLen; + } cryptBlockSizeCheck(cipherLen); cryptNullAndBoundsCheck(cipher, cipherOffset, cipherLen); cryptNullAndBoundsCheck(plain, plainOffset, cipherLen); @@ -220,10 +226,6 @@ } private static void cryptNullAndBoundsCheck(byte[] array, int offset, int len) { - if (len <= 0) { - return; // not an error because cryptImpl/decryptImpl won't execute if len <= 0 - } - Objects.requireNonNull(array); if (offset < 0 || offset >= array.length) {
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java Tue Dec 13 02:04:19 2016 +0100 @@ -172,10 +172,12 @@ * are encrypted on demand. */ private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - - Objects.checkFromIndexSize(inOff, len, in.length); - Objects.checkFromIndexSize(outOff, len, out.length); - return implCrypt(in, inOff, len, out, outOff); + if (len == 0) { + return 0; + } + Objects.checkFromIndexSize(inOff, len, in.length); + Objects.checkFromIndexSize(outOff, len, out.length); + return implCrypt(in, inOff, len, out, outOff); } // Implementation of crpyt() method. Possibly replaced with a compiler intrinsic.
--- a/jdk/src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java Tue Dec 13 02:04:19 2016 +0100 @@ -157,6 +157,9 @@ // Method possible replaced with a compiler intrinsic. private static int encodeISOArray(char[] sa, int sp, byte[] da, int dp, int len) { + if (len <= 0) { + return 0; + } encodeISOArrayCheck(sa, sp, da, dp, len); return implEncodeISOArray(sa, sp, da, dp, len); } @@ -177,10 +180,6 @@ private static void encodeISOArrayCheck(char[] sa, int sp, byte[] da, int dp, int len) { - if (len <= 0) { - return; // not an error because encodeISOArrayImpl won't execute if len <= 0 - } - Objects.requireNonNull(sa); Objects.requireNonNull(da);
--- a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -109,13 +109,9 @@ private String helperPath(String javahome, String osArch) { switch (this) { case SOLARIS: - if (osArch.equals("x86")) { osArch = "i386"; } - else if (osArch.equals("x86_64")) { osArch = "amd64"; } // fall through... case LINUX: case AIX: - return javahome + "/lib/" + osArch + "/jspawnhelper"; - case BSD: return javahome + "/lib/jspawnhelper";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/java.base/unix/classes/module-info.java.extra Tue Dec 13 02:04:19 2016 +0100 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// jdk.vm.compiler uses Unsafe and VM classes from jdk.internal.misc +exports jdk.internal.misc to jdk.vm.compiler; +opens jdk.internal.misc to jdk.vm.compiler; + +// jdk.vm.compiler uses com.sun.crypto.provider to generate crypto intrinsics +opens com.sun.crypto.provider to jdk.vm.compiler; + +exports jdk.internal.module to jdk.vm.compiler; + +// AOT uses jdk.internal.misc.Unsafe +exports jdk.internal.misc to jdk.aot;
--- a/jdk/src/java.base/unix/native/libjli/java_md.h Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/unix/native/libjli/java_md.h Tue Dec 13 02:04:19 2016 +0100 @@ -54,10 +54,8 @@ const char *SetExecname(char **argv); const char *GetExecName(); static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, const char * arch, - int bitsWanted); -static jboolean GetJREPath(char *path, jint pathsize, const char * arch, - jboolean speculative); + char *jvmpath, jint jvmpathsize, int bitsWanted); +static jboolean GetJREPath(char *path, jint pathsize, jboolean speculative); #if defined(_AIX) #include "java_md_aix.h"
--- a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c Tue Dec 13 02:04:19 2016 +0100 @@ -52,9 +52,6 @@ #endif #ifdef __solaris__ -# ifndef LIBARCHNAME -# error "The macro LIBARCHNAME was not defined on the compile line" -# endif # include <sys/systeminfo.h> # include <sys/elf.h> # include <stdio.h> @@ -188,12 +185,13 @@ return JNI_FALSE; } /* - * contains a lib/$LIBARCHNAME/{server,client}/libjvm.so ? + * contains a lib/{server,client}/libjvm.so ? */ static jboolean ContainsLibJVM(const char *env) { - char clientPattern[PATH_MAX + 1]; - char serverPattern[PATH_MAX + 1]; + /* the usual suspects */ + char clientPattern[] = "lib/client"; + char serverPattern[] = "lib/server"; char *envpath; char *path; jboolean clientPatternFound; @@ -204,10 +202,6 @@ return JNI_FALSE; } - /* the usual suspects */ - JLI_Snprintf(clientPattern, PATH_MAX, "lib/%s/client", LIBARCHNAME); - JLI_Snprintf(serverPattern, PATH_MAX, "lib/%s/server", LIBARCHNAME); - /* to optimize for time, test if any of our usual suspects are present. */ clientPatternFound = JLI_StrStr(env, clientPattern) != NULL; serverPatternFound = JLI_StrStr(env, serverPattern) != NULL; @@ -322,7 +316,6 @@ /* Check data model flags, and exec process, if needed */ { - char *arch = LIBARCHNAME; /* like sparc or sparcv9 */ char * jvmtype = NULL; int argc = *pargc; char **argv = *pargv; @@ -408,12 +401,12 @@ jvmpath does not exist */ if (wanted == running) { /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { + if (!GetJREPath(jrepath, so_jrepath, JNI_FALSE) ) { JLI_ReportErrorMessage(JRE_ERROR1); exit(2); } - JLI_Snprintf(jvmcfg, so_jvmcfg, "%s%slib%s%s%sjvm.cfg", - jrepath, FILESEP, FILESEP, arch, FILESEP); + JLI_Snprintf(jvmcfg, so_jvmcfg, "%s%slib%s%sjvm.cfg", + jrepath, FILESEP, FILESEP, FILESEP); /* Find the specified JVM type */ if (ReadKnownVMs(jvmcfg, JNI_FALSE) < 1) { JLI_ReportErrorMessage(CFG_ERROR7); @@ -427,7 +420,7 @@ exit(4); } - if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch, 0 )) { + if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, 0 )) { JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath); exit(4); } @@ -457,8 +450,8 @@ * We will set the LD_LIBRARY_PATH as follows: * * o $JVMPATH (directory portion only) - * o $JRE/lib/$LIBARCHNAME - * o $JRE/../lib/$LIBARCHNAME + * o $JRE/lib + * o $JRE/../lib * * followed by the user's previous effective LD_LIBRARY_PATH, if * any. @@ -518,10 +511,10 @@ jvmpath = JLI_StringDup(jvmpath); new_runpath_size = ((runpath != NULL) ? JLI_StrLen(runpath) : 0) + - 2 * JLI_StrLen(jrepath) + 2 * JLI_StrLen(arch) + + 2 * JLI_StrLen(jrepath) + #ifdef AIX /* On AIX we additionally need 'jli' in the path because ld doesn't support $ORIGIN. */ - JLI_StrLen(jrepath) + JLI_StrLen(arch) + JLI_StrLen("/lib//jli:") + + JLI_StrLen(jrepath) + JLI_StrLen("/lib//jli:") + #endif JLI_StrLen(jvmpath) + 52; new_runpath = JLI_MemAlloc(new_runpath_size); @@ -539,17 +532,17 @@ sprintf(new_runpath, LD_LIBRARY_PATH "=" "%s:" - "%s/lib/%s:" + "%s/lib:" #ifdef AIX - "%s/lib/%s/jli:" /* Needed on AIX because ld doesn't support $ORIGIN. */ + "%s/lib/jli:" /* Needed on AIX because ld doesn't support $ORIGIN. */ #endif - "%s/../lib/%s", + "%s/../lib", jvmpath, - jrepath, arch, + jrepath, #ifdef AIX - jrepath, arch, + jrepath, #endif - jrepath, arch + jrepath ); @@ -638,14 +631,14 @@ */ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, const char * arch, int bitsWanted) + char *jvmpath, jint jvmpathsize, int bitsWanted) { struct stat s; if (JLI_StrChr(jvmtype, '/')) { JLI_Snprintf(jvmpath, jvmpathsize, "%s/" JVM_DLL, jvmtype); } else { - JLI_Snprintf(jvmpath, jvmpathsize, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype); + JLI_Snprintf(jvmpath, jvmpathsize, "%s/lib/%s/" JVM_DLL, jrepath, jvmtype); } JLI_TraceLauncher("Does `%s' exist ... ", jvmpath); @@ -663,14 +656,14 @@ * Find path to JRE based on .exe's location or registry settings. */ static jboolean -GetJREPath(char *path, jint pathsize, const char * arch, jboolean speculative) +GetJREPath(char *path, jint pathsize, jboolean speculative) { char libjava[MAXPATHLEN]; struct stat s; if (GetApplicationHome(path, pathsize)) { /* Is JRE co-located with the application? */ - JLI_Snprintf(libjava, sizeof(libjava), "%s/lib/%s/" JAVA_DLL, path, arch); + JLI_Snprintf(libjava, sizeof(libjava), "%s/lib/" JAVA_DLL, path); if (access(libjava, F_OK) == 0) { JLI_TraceLauncher("JRE path is %s\n", path); return JNI_TRUE; @@ -681,7 +674,7 @@ return JNI_FALSE; } /* Does the app ship a private JRE in <apphome>/jre directory? */ - JLI_Snprintf(libjava, sizeof(libjava), "%s/jre/lib/%s/" JAVA_DLL, path, arch); + JLI_Snprintf(libjava, sizeof(libjava), "%s/jre/lib/" JAVA_DLL, path); if (access(libjava, F_OK) == 0) { JLI_StrCat(path, "/jre"); JLI_TraceLauncher("JRE path is %s\n", path); @@ -690,7 +683,7 @@ } if (GetApplicationHomeFromDll(path, pathsize)) { - JLI_Snprintf(libjava, sizeof(libjava), "%s/lib/%s/" JAVA_DLL, path, arch); + JLI_Snprintf(libjava, sizeof(libjava), "%s/lib/" JAVA_DLL, path); if (stat(libjava, &s) == 0) { JLI_TraceLauncher("JRE path is %s\n", path); return JNI_TRUE; @@ -856,12 +849,12 @@ char jrePath[MAXPATHLEN]; char splashPath[MAXPATHLEN]; - if (!GetJREPath(jrePath, sizeof(jrePath), LIBARCHNAME, JNI_FALSE)) { + if (!GetJREPath(jrePath, sizeof(jrePath), JNI_FALSE)) { JLI_ReportErrorMessage(JRE_ERROR1); return NULL; } - ret = JLI_Snprintf(splashPath, sizeof(splashPath), "%s/lib/%s/%s", - jrePath, LIBARCHNAME, SPLASHSCREEN_SO); + ret = JLI_Snprintf(splashPath, sizeof(splashPath), "%s/lib/%s", + jrePath, SPLASHSCREEN_SO); if (ret >= (int) sizeof(splashPath)) { JLI_ReportErrorMessage(JRE_ERROR11);
--- a/jdk/src/java.base/windows/native/libjli/java_md.c Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.base/windows/native/libjli/java_md.c Tue Dec 13 02:04:19 2016 +0100 @@ -151,22 +151,6 @@ } /* - * Returns the arch path, to get the current arch use the - * macro GetArch, nbits here is ignored for now. - */ -const char * -GetArchPath(int nbits) -{ -#ifdef _M_AMD64 - return "amd64"; -#elif defined(_M_IA64) - return "ia64"; -#else - return "i386"; -#endif -} - -/* * */ void @@ -207,8 +191,8 @@ exit(2); } - JLI_Snprintf(jvmcfg, so_jvmcfg, "%s%slib%s%s%sjvm.cfg", - jrepath, FILESEP, FILESEP, (char*)GetArch(), FILESEP); + JLI_Snprintf(jvmcfg, so_jvmcfg, "%s%slib%sjvm.cfg", + jrepath, FILESEP, FILESEP); /* Find the specified JVM type */ if (ReadKnownVMs(jvmcfg, JNI_FALSE) < 1) {
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, 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 @@ -51,7 +51,9 @@ import com.sun.jmx.remote.util.ClassLogger; import com.sun.jmx.remote.util.EnvHelp; +import java.lang.reflect.UndeclaredThrowableException; import java.rmi.UnmarshalException; +import java.util.concurrent.RejectedExecutionException; public abstract class ClientNotifForwarder { @@ -559,10 +561,38 @@ } } } else { - executor.execute(this); + try { + executor.execute(this); + } catch (Exception e) { + if (isRejectedExecutionException(e)) { + // We reached here because the executor was shutdown. + // If executor was supplied by client, then it was shutdown + // abruptly or JMXConnector was shutdown along with executor + // while this thread was suspended at L564. + if (!(executor instanceof LinearExecutor)) { + // Spawn new executor that will do cleanup if JMXConnector is closed + // or keep notif system running otherwise + executor = new LinearExecutor(); + executor.execute(this); + } + } else { + throw e; + } + } } } + private boolean isRejectedExecutionException(Exception e) { + Throwable cause = e; + while (cause != null) { + if (cause instanceof RejectedExecutionException) { + return true; + } + cause = cause.getCause(); + } + return false; + } + void dispatchNotification(TargetedNotification tn, Integer myListenerID, Map<Integer, ClientListenerInfo> listeners) { @@ -866,7 +896,7 @@ // ------------------------------------------------- private final ClassLoader defaultClassLoader; - private final Executor executor; + private Executor executor; private final Map<Integer, ClientListenerInfo> infoList = new HashMap<Integer, ClientListenerInfo>();
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/MethodImpl.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/MethodImpl.java Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, 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 @@ -315,10 +315,14 @@ return; } Value nthArgValue = arguments.get(paramCount - 1); - if (nthArgValue == null) { + if (nthArgValue == null && argCount == paramCount) { + // We have one varargs parameter and it is null + // so we don't have to do anything. return; } - Type nthArgType = nthArgValue.type(); + // If the first varargs parameter is null, then don't + // access its type since it can't be an array. + Type nthArgType = (nthArgValue == null) ? null : nthArgValue.type(); if (nthArgType instanceof ArrayTypeImpl) { if (argCount == paramCount && ((ArrayTypeImpl)nthArgType).isAssignableTo(lastParamType)) {
--- a/jdk/test/ProblemList.txt Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/ProblemList.txt Tue Dec 13 02:04:19 2016 +0100 @@ -232,6 +232,8 @@ javax/sound/sampled/Mixers/DisabledAssertionCrash.java 7067310 generic-all +javax/sound/sampled/Clip/OpenNonIntegralNumberOfSampleframes.java 8168881 generic-all + ############################################################################ # jdk_imageio
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/test/com/sun/jdi/EvalArraysAsList.sh Tue Dec 13 02:04:19 2016 +0100 @@ -0,0 +1,85 @@ +#!/bin/sh +# +# Copyright (c) 2016, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# @test +# @bug 8160024 +# @summary jdb returns invalid argument count if first parameter to Arrays.asList is null +# +# @run shell/timeout=300 EvalArraysAsList.sh +# +# The test checks if evaluation of the expression java.util.Arrays.asList(null, "a") +# works normally and does not throw an IllegalArgumentException. + +classname=EvalArraysAsList + +createJavaFile() +{ + cat <<EOF > $classname.java.1 +public class $classname { + public static void main(String[] args) { + java.util.List<Object> l = java.util.Arrays.asList(null, "a"); + System.out.println("java.util.Arrays.asList(null, \"a\") returns: " + l); + return; // @1 breakpoint + } +} +EOF +} + +# drive jdb by sending cmds to it and examining its output +dojdbCmds() +{ + setBkpts @1 + runToBkpt @1 + + cmd eval "java.util.Arrays.asList(null, null)" + jdbFailIfPresent "IllegalArgumentException" 3 + + cmd eval "java.util.Arrays.asList(null, \"a\")" + jdbFailIfPresent "IllegalArgumentException" 3 + + cmd eval "java.util.Arrays.asList(\"a\", null)" + jdbFailIfPresent "IllegalArgumentException" 3 +} + + +mysetup() +{ + if [ -z "$TESTSRC" ] ; then + TESTSRC=. + fi + + for ii in . $TESTSRC $TESTSRC/.. ; do + if [ -r "$ii/ShellScaffold.sh" ] ; then + . $ii/ShellScaffold.sh + break + fi + done +} + +# You could replace this next line with the contents +# of ShellScaffold.sh and this script will run just the same. +mysetup + +runit +pass
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, 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 @@ -226,9 +226,10 @@ sm.grantPermission(new RuntimePermission("createClassLoader")); sm.grantPermission(new ReflectPermission("suppressAccessChecks")); sm.grantPermission(new java.util.logging.LoggingPermission("control", "")); - sm.grantPermission(new java.lang.RuntimePermission("exitVM.97")); + sm.grantPermission(new java.lang.RuntimePermission("exitVM.*")); sm.grantPermission(new java.lang.RuntimePermission("modifyThreadGroup")); sm.grantPermission(new java.lang.RuntimePermission("modifyThread")); + sm.grantPermission(new java.security.SecurityPermission("getProperty.jdk.jar.disabledAlgorithms")); for(MBeanOperationInfo opInfo : info.getOperations()) { Permission opPermission = new MBeanPermission(info.getClassName(), opInfo.getName(),
--- a/jdk/test/java/awt/JAWT/JAWT.sh Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/java/awt/JAWT/JAWT.sh Tue Dec 13 02:04:19 2016 +0100 @@ -122,7 +122,7 @@ # Skip unsupported platforms case `uname -m` in - arm* | ppc* ) + arm* | ppc* | s390* ) echo "Test passed. Not supported on current architecture." exit 0 ;;
--- a/jdk/test/java/awt/JAWT/Makefile.unix Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/java/awt/JAWT/Makefile.unix Tue Dec 13 02:04:19 2016 +0100 @@ -1,4 +1,4 @@ -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2016, 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 @@ -32,7 +32,7 @@ J_INC = $(TESTJAVA)/include INCLUDES = -I$(J_INC) -I$(J_INC)/$(SYST) -I. -LIBS = -L$(TESTJAVA)/lib/$(ARCH) -ljawt -lX11 +LIBS = -L$(TESTJAVA)/lib -ljawt -lX11 all: $(CLASSES) libmylib.so
--- a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -103,20 +103,13 @@ mbsc.invoke(mbean, "emitNotification", null, null); System.out.println("EmptyDomainNotificationTest-main: waiting notif..."); - final long stopTime = System.currentTimeMillis() + 2000; synchronized(li) { - long toWait = stopTime - System.currentTimeMillis(); - - while (li.received < 1 && toWait > 0) { - li.wait(toWait); - - toWait = stopTime - System.currentTimeMillis(); + while (li.received < 1) { + li.wait(); } } - if (li.received < 1) { - throw new RuntimeException("No notif received!"); - } else if (li.received > 1) { + if (li.received != 1) { throw new RuntimeException("Wait one notif but got: "+li.received); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2016, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + /* + * @test + * @bug 8141591 + * @summary Tests if notifications are received after executor is shutdown + * @author Harsha Wardhana B + * @modules java.management + * @run clean ExecutorShutdownTest + * @run build ExecutorShutdownTest + * @run main ExecutorShutdownTest + */ +import java.util.*; +import java.util.concurrent.*; +import javax.management.*; +import javax.management.remote.*; + +/* + When you create a JMXConnector client, you can supply a + "fetch-notifications Executor", which is a + java.util.concurrent.Executor that will be used each time the + connector client wants to call RMIConnection.fetchNotifications. + If such executor is not supplies, the connector client will fallback + on default LinearExecutor. This test checks if user supplied executor + is shutdown abruptly, LinearExecutor is used to handle notifications. + */ +public class ExecutorShutdownTest { + + private static final String EXECUTOR_PROPERTY + = "jmx.remote.x.fetch.notifications.executor"; + private static final String NOTIF_TYPE = "test.type"; + + public static void main(String[] args) throws Exception { + + // Start JMXConnector Server + JMXServiceURL url = new JMXServiceURL("rmi", null, 0); + MBeanServer mbs = MBeanServerFactory.newMBeanServer(); + ObjectName emitName = new ObjectName("blah:type=Emitter"); + mbs.registerMBean(new Emitter(), emitName); + JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(url, + null, + mbs); + cs.start(); + + // Create executor to provide to JMXConnector client + ExecutorService executor = Executors.newCachedThreadPool(); + Map<String, Executor> env = new HashMap<>(); + env.put(EXECUTOR_PROPERTY, executor); + JMXServiceURL addr = cs.getAddress(); + + try (JMXConnector cc = JMXConnectorFactory.connect(addr, env)) { + MBeanServerConnection mbsc = cc.getMBeanServerConnection(); + EmitterMBean emitter = (EmitterMBean) MBeanServerInvocationHandler.newProxyInstance(mbsc, + emitName, + EmitterMBean.class, + false); + SemaphoreListener listener = new SemaphoreListener(); + NotificationFilterSupport filter = new NotificationFilterSupport(); + filter.enableType(NOTIF_TYPE); + mbsc.addNotificationListener(emitName, listener, filter, null); + + final int NOTIF_COUNT = 3; + for (int i = 0; i < NOTIF_COUNT; i++) { + emitter.emit(); + listener.await(); + } + Thread.sleep(1); + listener.checkUnavailable(); + System.out.println("Got notifications with client provided executor"); + + // After shutting down executor, notifications are handled by linear executor + executor.shutdown(); + for (int i = 0; i < NOTIF_COUNT; i++) { + emitter.emit(); + listener.await(); + } + Thread.sleep(1); + listener.checkUnavailable(); + System.out.println("Got notifications with linear executor"); + } + cs.stop(); + System.out.println("TEST PASSED !!!"); + } + + /* Simple MBean that sends a notification every time we ask it to. */ + public static interface EmitterMBean { + + public void emit(); + } + + public static class Emitter + extends NotificationBroadcasterSupport implements EmitterMBean { + + public void emit() { + sendNotification(new Notification(NOTIF_TYPE, this, seq++)); + } + + private long seq = 1; + } + + /* Simple NotificationListener that allows you to wait until a + notification has been received. Since it uses a semaphore, you + can wait either before or after the notification has in fact + been received and it will work in either case. */ + private static class SemaphoreListener implements NotificationListener { + + void await() throws InterruptedException { + semaphore.acquire(); + } + + /* Ensure no extra notifications were received. If we can acquire + the semaphore, that means its release() method was called more + times than its acquire() method, which means there were too + many notifications. */ + void checkUnavailable() throws Exception { + if (semaphore.tryAcquire()) { + throw new Exception("Got extra notifications!"); + } + } + + public void handleNotification(Notification n, Object h) { + semaphore.release(); + } + + private final Semaphore semaphore = new Semaphore(0); + } +}
--- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -44,7 +44,7 @@ import jdk.testlibrary.OutputAnalyzer; import jdk.testlibrary.ProcessTools; import jdk.test.lib.apps.LingeredApp; -import jdk.testlibrary.Platform; +import jdk.test.lib.Platform; public class BasicLauncherTest { @@ -230,8 +230,7 @@ Arrays.asList(toolArgs)); } - public static void main(String[] args) - throws IOException { + public static void main(String[] args) throws Exception { if (!Platform.shouldSAAttach()) { // Silently skip the test if we don't have enough permissions to attach
--- a/jdk/test/sun/tools/jhsdb/HeapDumpTest.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/sun/tools/jhsdb/HeapDumpTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -41,7 +41,7 @@ import jdk.testlibrary.OutputAnalyzer; import jdk.testlibrary.ProcessTools; import jdk.test.lib.apps.LingeredApp; -import jdk.testlibrary.Platform; +import jdk.test.lib.Platform; public class HeapDumpTest { @@ -109,8 +109,7 @@ dump.delete(); } - public static void main(String[] args) - throws IOException { + public static void main(String[] args) throws Exception { if (!Platform.shouldSAAttach()) { // Silently skip the test if we don't have enough permissions to attach
--- a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -30,7 +30,7 @@ import jdk.test.lib.apps.LingeredApp; import jdk.testlibrary.Utils; -import jdk.testlibrary.Platform; +import jdk.test.lib.Platform; /* * @test
--- a/jdk/test/tools/launcher/RunpathTest.java Sun Dec 11 21:55:03 2016 -0800 +++ b/jdk/test/tools/launcher/RunpathTest.java Tue Dec 13 02:04:19 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -64,7 +64,7 @@ } void testRpath() { - String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib/" + getJreArch() + ".*"; + String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib.*"; elfCheck(javaCmd, expectedRpath); }