Mercurial > hg > icedtea8
changeset 2694:63318a602543
PR3079: Provide option to build Shenandoah on x86_64
2016-07-21 Andrew John Hughes <gnu.andrew@redhat.com>
PR3079: Provide option to build Shenandoah on x86_64
* INSTALL: Mention Shenandoah under HotSpot builds.
* Makefile.am:
(ICEDTEA_PATCHES): Add IcedTea HotSpot patches
for use in alt-HotSpot (i.e. Shenandoah) builds.
* NEWS: Updated. Move this and other new features
to the top under "New features".
* acinclude.m4:
(IT_ENABLE_ZERO_BUILD): Fix name of native port
macro.
(IT_WITH_HOTSPOT_BUILD): Make DEFUN_ONCE.
(IT_ARCH_HAS_NATIVE_HOTSPOT_PORT): Use clearer
name. Use host_cpu in configure output so it's clear
what value is being checked.
(IT_HSBUILD_WORKS_ON_THIS_ARCH): Check that HSBUILD
is applicable to the architecture being used.
At present, this stops Shenandoah being built on
anything but x86_64.
* configure.ac: Invoke IT_HSBUILD_WORKS_ON_THIS_ARCH
rather than IT_WITH_HOTSPOT_BUILD (now a dependency
of that macro).
* hotspot.map.in: Add Shenandoah drop, taken from
aarch64-shenandoah-jdk8u92-b14 in
aarch64-port/jdk8u-shenandoah.
* patches/hotspot/shenandoah/6425769-pr2859.patch,
* patches/hotspot/shenandoah/8038392-rh1064383.patch,
* patches/hotspot/shenandoah/8041658.patch,
* patches/hotspot/shenandoah/8087218-pr2740.patch,
* patches/hotspot/shenandoah/8145096-pr2854.patch,
* patches/hotspot/shenandoah/8148752-pr2943.patch,
* patches/hotspot/shenandoah/8154210.patch,
* patches/hotspot/shenandoah/8158260-pr2991-rh1341258.patch,
* patches/hotspot/shenandoah/8159244-pr3074.patch,
* patches/hotspot/shenandoah/crash_dump.patch,
* patches/hotspot/shenandoah/no_devirt.patch,
* patches/hotspot/shenandoah/pr1368.patch,
* patches/hotspot/shenandoah/pr1748.patch,
* patches/hotspot/shenandoah/pr1869.patch,
* patches/hotspot/shenandoah/pr1942.patch,
* patches/hotspot/shenandoah/pr1975.patch,
* patches/hotspot/shenandoah/pr2777.patch,
* patches/hotspot/shenandoah/werror.patch:
Patches applied to the main IcedTea HotSpot tree
which need to also be applied to any alternate HotSpot
being built.
* scripts/create_tarballs.sh:
Add script used to create drop tarballs, most recently
the Shenandoah one.
* scripts/gen_changeset_and_sha256sums.sh:
Update to latest version which handles HotSpot-only
drop creation.
line wrap: on
line diff
--- a/ChangeLog Mon Jul 18 06:27:50 2016 +0100 +++ b/ChangeLog Thu Jul 21 22:45:04 2016 +0100 @@ -1,3 +1,57 @@ +2016-07-21 Andrew John Hughes <gnu.andrew@redhat.com> + + PR3079: Provide option to build Shenandoah on x86_64 + * INSTALL: Mention Shenandoah under HotSpot builds. + * Makefile.am: + (ICEDTEA_PATCHES): Add IcedTea HotSpot patches + for use in alt-HotSpot (i.e. Shenandoah) builds. + * NEWS: Updated. Move this and other new features + to the top under "New features". + * acinclude.m4: + (IT_ENABLE_ZERO_BUILD): Fix name of native port + macro. + (IT_WITH_HOTSPOT_BUILD): Make DEFUN_ONCE. + (IT_ARCH_HAS_NATIVE_HOTSPOT_PORT): Use clearer + name. Use host_cpu in configure output so it's clear + what value is being checked. + (IT_HSBUILD_WORKS_ON_THIS_ARCH): Check that HSBUILD + is applicable to the architecture being used. + At present, this stops Shenandoah being built on + anything but x86_64. + * configure.ac: Invoke IT_HSBUILD_WORKS_ON_THIS_ARCH + rather than IT_WITH_HOTSPOT_BUILD (now a dependency + of that macro). + * hotspot.map.in: Add Shenandoah drop, taken from + aarch64-shenandoah-jdk8u92-b14 in + aarch64-port/jdk8u-shenandoah. + * patches/hotspot/shenandoah/6425769-pr2859.patch, + * patches/hotspot/shenandoah/8038392-rh1064383.patch, + * patches/hotspot/shenandoah/8041658.patch, + * patches/hotspot/shenandoah/8087218-pr2740.patch, + * patches/hotspot/shenandoah/8145096-pr2854.patch, + * patches/hotspot/shenandoah/8148752-pr2943.patch, + * patches/hotspot/shenandoah/8154210.patch, + * patches/hotspot/shenandoah/8158260-pr2991-rh1341258.patch, + * patches/hotspot/shenandoah/8159244-pr3074.patch, + * patches/hotspot/shenandoah/crash_dump.patch, + * patches/hotspot/shenandoah/no_devirt.patch, + * patches/hotspot/shenandoah/pr1368.patch, + * patches/hotspot/shenandoah/pr1748.patch, + * patches/hotspot/shenandoah/pr1869.patch, + * patches/hotspot/shenandoah/pr1942.patch, + * patches/hotspot/shenandoah/pr1975.patch, + * patches/hotspot/shenandoah/pr2777.patch, + * patches/hotspot/shenandoah/werror.patch: + Patches applied to the main IcedTea HotSpot tree + which need to also be applied to any alternate HotSpot + being built. + * scripts/create_tarballs.sh: + Add script used to create drop tarballs, most recently + the Shenandoah one. + * scripts/gen_changeset_and_sha256sums.sh: + Update to latest version which handles HotSpot-only + drop creation. + 2016-07-17 Andrew John Hughes <gnu.andrew@redhat.com> PR3096: Remove dead
--- a/INSTALL Mon Jul 18 06:27:50 2016 +0100 +++ b/INSTALL Thu Jul 21 22:45:04 2016 +0100 @@ -344,8 +344,13 @@ download stage and just verifies that the zip's MD5 sum matches that of the requested build. -Currently, IcedTea7 only supports the 'original' HotSpot provided as -part of the upstream IcedTea forest. +Currently, IcedTea 3.x supports the 'default' HotSpot tree, which is +part of the IcedTea forest for the particular minor release series +being used, and the 'shenandoah' HotSpot tree, which provides a +backport of Shenandoah (http://openjdk.java.net/projects/shenandoah/) +to OpenJDK 8 and is taken from: + +http://hg.openjdk.java.net/aarch64-port/jdk8u-shenandoah/hotspot Building Additional Virtual Machines ====================================
--- a/Makefile.am Mon Jul 18 06:27:50 2016 +0100 +++ b/Makefile.am Thu Jul 21 22:45:04 2016 +0100 @@ -337,6 +337,28 @@ # Conditional patches +if WITH_ALT_HSBUILD +ICEDTEA_PATCHES += \ + patches/hotspot/shenandoah/6425769-pr2859.patch \ + patches/hotspot/shenandoah/8038392-rh1064383.patch \ + patches/hotspot/shenandoah/8041658.patch \ + patches/hotspot/shenandoah/8087218-pr2740.patch \ + patches/hotspot/shenandoah/8145096-pr2854.patch \ + patches/hotspot/shenandoah/8148752-pr2943.patch \ + patches/hotspot/shenandoah/8154210.patch \ + patches/hotspot/shenandoah/8158260-pr2991-rh1341258.patch \ + patches/hotspot/shenandoah/8159244-pr3074.patch \ + patches/hotspot/shenandoah/crash_dump.patch \ + patches/hotspot/shenandoah/no_devirt.patch \ + patches/hotspot/shenandoah/pr1368.patch \ + patches/hotspot/shenandoah/pr1748.patch \ + patches/hotspot/shenandoah/pr1869.patch \ + patches/hotspot/shenandoah/pr1942.patch \ + patches/hotspot/shenandoah/pr1975.patch \ + patches/hotspot/shenandoah/pr2777.patch \ + patches/hotspot/shenandoah/werror.patch +endif + if BUILD_CACAO ICEDTEA_PATCHES += \ patches/cacao/launcher.patch
--- a/NEWS Mon Jul 18 06:27:50 2016 +0100 +++ b/NEWS Thu Jul 21 22:45:04 2016 +0100 @@ -12,6 +12,11 @@ New in release 3.1.0 (2016-05-XX): +* New features + - S8145547, PR1061: [AWT/Swing] Conditional support for GTK 3 on Linux + - PR2821: Support building OpenJDK with --disable-headful + - PR2931, G478960: Provide Infinality Support via fontconfig + - PR3079: Provide option to build Shenandoah on x86_64 * Import of OpenJDK 8 u92 build 14 - S6869327: Add new C2 flag to keep safepoints in counted loops. - S8022865: [TESTBUG] Compressed Oops testing needs to be revised @@ -167,7 +172,6 @@ - S8137571, PR1061: Linux HiDPI Graphics support - S8142406, PR1061: [TEST] MultiResolution image: need test to cover the case when @2x image is corrupted - S8145188, PR2945: No LocalVariableTable generated for the entire JDK - - S8145547, PR1061: [AWT/Swing] Conditional support for GTK 3 on Linux - S8150258, PR1061: [TEST] HiDPI: create a test for multiresolution menu items icons - S8150724, PR1061: [TEST] HiDPI: create a test for multiresolution icons - S8150844, PR1061: [hidpi] [macosx] -Dsun.java2d.uiScale should be taken into account for OS X @@ -180,9 +184,7 @@ - S8159690, PR3077: [TESTBUG] Mark headful tests with @key headful. * Bug fixes - PR1958: GTKLookAndFeel does not honor gtk-alternative-button-order - - PR2821: Support building OpenJDK with --disable-headful - PR2822: Feed LIBS & CFLAGS into configure rather than make to avoid re-discovery by OpenJDK configure - - PR2931, G478960: Provide Infinality Support via fontconfig - PR2932: Support ccache in a non-automagic manner - PR2964: Set system defaults based on OS - PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings
--- a/acinclude.m4 Mon Jul 18 06:27:50 2016 +0100 +++ b/acinclude.m4 Thu Jul 21 22:45:04 2016 +0100 @@ -607,7 +607,7 @@ AC_REQUIRE([IT_ENABLE_CACAO]) AC_REQUIRE([IT_ENABLE_JAMVM]) AC_REQUIRE([IT_ENABLE_SHARK]) - AC_REQUIRE([IT_HAS_NATIVE_HOTSPOT_PORT]) + AC_REQUIRE([IT_ARCH_HAS_NATIVE_HOTSPOT_PORT]) AC_MSG_CHECKING([whether to use the zero-assembler port]) use_zero=no AC_ARG_ENABLE([zero], @@ -827,7 +827,7 @@ AC_SUBST(VERSION_SUFFIX, $version_suffix) ]) -AC_DEFUN([IT_WITH_HOTSPOT_BUILD], +AC_DEFUN_ONCE([IT_WITH_HOTSPOT_BUILD], [ DEFAULT_BUILD="default" AC_MSG_CHECKING([which HotSpot build to use]) @@ -2027,9 +2027,9 @@ fi ]) -AC_DEFUN_ONCE([IT_HAS_NATIVE_HOTSPOT_PORT], +AC_DEFUN_ONCE([IT_ARCH_HAS_NATIVE_HOTSPOT_PORT], [ - AC_MSG_CHECKING([if a native HotSpot port is available for this architecture]) + AC_MSG_CHECKING([if a native HotSpot port is available for ${host_cpu}]) has_native_hotspot_port=yes; case "${host_cpu}" in aarch64) ;; @@ -2464,3 +2464,19 @@ AC_SUBST(NO_CCACHE_PATH) ]) +AC_DEFUN_ONCE([IT_HSBUILD_WORKS_ON_THIS_ARCH], +[ + AC_REQUIRE([IT_WITH_HOTSPOT_BUILD]) + AC_MSG_CHECKING([if HotSpot build ${HSBUILD} works on ${host_cpu}]) + has_working_hotspot=yes; + if test "x${HSBUILD}" = "xshenandoah"; then + case "${host_cpu}" in + x86_64) ;; + *) has_working_hotspot=no ; + esac + fi + AC_MSG_RESULT([$has_working_hotspot]) + if test "x$has_working_hotspot" = "xno"; then + AC_MSG_ERROR([${HSBUILD} is not supported on this platform.]) + fi +])
--- a/configure.ac Mon Jul 18 06:27:50 2016 +0100 +++ b/configure.ac Thu Jul 21 22:45:04 2016 +0100 @@ -48,7 +48,7 @@ IT_CHECK_FOR_MERCURIAL IT_OBTAIN_HG_REVISIONS IT_CHECK_FOR_RMDIR -IT_WITH_HOTSPOT_BUILD +IT_HSBUILD_WORKS_ON_THIS_ARCH IT_CHECK_GCC_VERSION IT_FIND_NUMBER_OF_PROCESSORS IT_CP_SUPPORTS_REFLINK
--- a/hotspot.map.in Mon Jul 18 06:27:50 2016 +0100 +++ b/hotspot.map.in Thu Jul 21 22:45:04 2016 +0100 @@ -1,2 +1,3 @@ # version url changeset md5sum default drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ ea6933324a7a 2fe149bb8b212f973c013bae36fcc6b589f88b3fb0886c48ef3921f85e216a78 +shenandoah drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ ec2e71f375b1 3a4579daab230b7cf8f05074a686e3a4a76184d87d6bc277d735543ad683b38e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/6425769-pr2859.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,50 @@ +# HG changeset patch +# User sgehwolf +# Date 1450425347 -3600 +# Fri Dec 18 08:55:47 2015 +0100 +# Node ID 9a57d01ddf0309b4250ad6767dd4cc26b5c8626f +# Parent 5f2728295878fc80d8d14b4304abe9629e6893cd +6425769, PR2859: Allow specifying an address to bind JMX remote connector +Reviewed-by: jbachorik, dfuchs + +diff -r 5f2728295878 -r 9a57d01ddf03 src/share/vm/services/diagnosticCommand.cpp +--- openjdk/hotspot/src/share/vm/services/diagnosticCommand.cpp Fri Apr 01 04:06:33 2016 +0100 ++++ openjdk/hotspot/src/share/vm/services/diagnosticCommand.cpp Fri Dec 18 08:55:47 2015 +0100 +@@ -437,6 +437,10 @@ + ("config.file", + "set com.sun.management.config.file", "STRING", false), + ++ _jmxremote_host ++ ("jmxremote.host", ++ "set com.sun.management.jmxremote.host", "STRING", false), ++ + _jmxremote_port + ("jmxremote.port", + "set com.sun.management.jmxremote.port", "STRING", false), +@@ -516,6 +520,7 @@ + + { + _dcmdparser.add_dcmd_option(&_config_file); ++ _dcmdparser.add_dcmd_option(&_jmxremote_host); + _dcmdparser.add_dcmd_option(&_jmxremote_port); + _dcmdparser.add_dcmd_option(&_jmxremote_rmi_port); + _dcmdparser.add_dcmd_option(&_jmxremote_ssl); +@@ -586,6 +591,7 @@ + } + + PUT_OPTION(_config_file); ++ PUT_OPTION(_jmxremote_host); + PUT_OPTION(_jmxremote_port); + PUT_OPTION(_jmxremote_rmi_port); + PUT_OPTION(_jmxremote_ssl); +diff -r 5f2728295878 -r 9a57d01ddf03 src/share/vm/services/diagnosticCommand.hpp +--- openjdk/hotspot/src/share/vm/services/diagnosticCommand.hpp Fri Apr 01 04:06:33 2016 +0100 ++++ openjdk/hotspot/src/share/vm/services/diagnosticCommand.hpp Fri Dec 18 08:55:47 2015 +0100 +@@ -280,6 +280,7 @@ + // com.sun.management is omitted + + DCmdArgument<char *> _config_file; ++ DCmdArgument<char *> _jmxremote_host; + DCmdArgument<char *> _jmxremote_port; + DCmdArgument<char *> _jmxremote_rmi_port; + DCmdArgument<char *> _jmxremote_ssl;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8038392-rh1064383.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,79 @@ +# HG changeset patch +# User andrew +# Date 1400254787 -3600 +# Fri May 16 16:39:47 2014 +0100 +# Node ID c2767d7216058484f87920557a3f9282506e5ce5 +# Parent 2b4f89de39c2c4fd09f927adacb3781454dbee44 +8038392: Generating prelink cache breaks JAVA 'jinfo' utility normal behavior +Summary: See RH1064383 (https://bugzilla.redhat.com/show_bug.cgi?id=1064383) +Contributed-by: Carlos Santos <casantos@redhat.com> + +diff -r 2b4f89de39c2 -r c2767d721605 agent/src/os/linux/ps_proc.c +--- openjdk/hotspot/agent/src/os/linux/ps_proc.c Thu Apr 24 16:21:06 2014 +0100 ++++ openjdk/hotspot/agent/src/os/linux/ps_proc.c Fri May 16 16:39:47 2014 +0100 +@@ -263,7 +263,7 @@ + + static bool read_lib_info(struct ps_prochandle* ph) { + char fname[32]; +- char buf[256]; ++ char buf[PATH_MAX]; + FILE *fp = NULL; + + sprintf(fname, "/proc/%d/maps", ph->pid); +@@ -273,10 +273,52 @@ + return false; + } + +- while(fgets_no_cr(buf, 256, fp)){ +- char * word[6]; +- int nwords = split_n_str(buf, 6, word, ' ', '\0'); +- if (nwords > 5 && find_lib(ph, word[5]) == false) { ++ while(fgets_no_cr(buf, PATH_MAX, fp)){ ++ char * word[7]; ++ int nwords = split_n_str(buf, 7, word, ' ', '\0'); ++ ++ if (nwords < 6) { ++ // not a shared library entry. ignore. ++ continue; ++ } ++ ++ if (word[5][0] == '[') { ++ // not a shared library entry. ignore. ++ if (strncmp(word[5],"[stack",6) == 0) { ++ continue; ++ } ++ if (strncmp(word[5],"[heap]",6) == 0) { ++ continue; ++ } ++ ++ // SA don't handle VDSO ++ if (strncmp(word[5],"[vdso]",6) == 0) { ++ continue; ++ } ++ if (strncmp(word[5],"[vsyscall]",6) == 0) { ++ continue; ++ } ++ } ++ ++ if (nwords > 6) { ++ // prelink altered mapfile when the program is running. ++ // Entries like one below have to be skipped ++ // /lib64/libc-2.15.so (deleted) ++ // SO name in entries like one below have to be stripped. ++ // /lib64/libpthread-2.15.so.#prelink#.EECVts ++ char *s = strstr(word[5],".#prelink#"); ++ if (s == NULL) { ++ // No prelink keyword. skip deleted library ++ print_debug("skip shared object %s deleted by prelink\n", word[5]); ++ continue; ++ } ++ ++ // Fall through ++ print_debug("rectifing shared object name %s changed by prelink\n", word[5]); ++ *s = 0; ++ } ++ ++ if (find_lib(ph, word[5]) == false) { + intptr_t base; + lib_info* lib; + #ifdef _LP64
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8041658.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,22 @@ +# HG changeset patch +# User andrew +# Date 1398287189 -3600 +# Wed Apr 23 22:06:29 2014 +0100 +# Node ID 6cb711fa264d25f3592471a81a5b865c505a9fd7 +# Parent a8b6c290873cc30d96137bd29724638600317f92 +8041658: Use of -fdevirtualize on macroAssembler_x86.o (via -O2) with gcc 4.9.0 creates broken VM +Summary: -fno-devirtualize should be passed when compiling this file. + +diff -r a8b6c290873c -r 6cb711fa264d make/linux/makefiles/gcc.make +--- openjdk/hotspot/make/linux/makefiles/gcc.make Wed Apr 23 21:15:09 2014 +0100 ++++ openjdk/hotspot/make/linux/makefiles/gcc.make Wed Apr 23 22:06:29 2014 +0100 +@@ -266,6 +266,9 @@ + ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) + OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) + endif ++ ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 9), 1) ++ OPT_CFLAGS/macroAssembler_x86.o += -fno-devirtualize ++ endif + endif + + # Flags for generating make dependency flags.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8087218-pr2740.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,64 @@ +# HG changeset patch +# User vlivanov +# Date 1447818025 0 +# Wed Nov 18 03:40:25 2015 +0000 +# Node ID cbdd812ea25e27919983c363fd416b492846e426 +# Parent 3b05ef40e997e8234f396a55cf238e9b01472f12 +8087218, PR2740: Constant fold loads from final instance fields in VM anonymous classes +Reviewed-by: jrose, rbackman + +diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciField.cpp openjdk/hotspot/src/share/vm/ci/ciField.cpp +--- openjdk.orig/hotspot/src/share/vm/ci/ciField.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciField.cpp 2016-07-21 03:29:23.922520659 +0100 +@@ -187,6 +187,10 @@ + // Even if general trusting is disabled, trust system-built closures in these packages. + if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke")) + return true; ++ // Trust VM anonymous classes. They are private API (sun.misc.Unsafe) and can't be serialized, ++ // so there is no hacking of finals going on with them. ++ if (holder->is_anonymous()) ++ return true; + // Trust Atomic*FieldUpdaters: they are very important for performance, and make up one + // more reason not to use Unsafe, if their final fields are trusted. See more in JDK-8140483. + if (holder->name() == ciSymbol::java_util_concurrent_atomic_AtomicIntegerFieldUpdater_Impl() || +diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciInstanceKlass.cpp openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +--- openjdk.orig/hotspot/src/share/vm/ci/ciInstanceKlass.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp 2016-07-21 03:29:04.678838046 +0100 +@@ -59,6 +59,7 @@ + _nonstatic_field_size = ik->nonstatic_field_size(); + _has_nonstatic_fields = ik->has_nonstatic_fields(); + _has_default_methods = ik->has_default_methods(); ++ _is_anonymous = ik->is_anonymous(); + _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: + + _implementor = NULL; // we will fill these lazily +@@ -101,6 +102,7 @@ + _nonstatic_field_size = -1; + _has_nonstatic_fields = false; + _nonstatic_fields = NULL; ++ _is_anonymous = false; + _loader = loader; + _protection_domain = protection_domain; + _is_shared = false; +diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciInstanceKlass.hpp openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +--- openjdk.orig/hotspot/src/share/vm/ci/ciInstanceKlass.hpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp 2016-07-21 03:29:04.678838046 +0100 +@@ -53,6 +53,7 @@ + bool _has_subklass; + bool _has_nonstatic_fields; + bool _has_default_methods; ++ bool _is_anonymous; + + ciFlags _flags; + jint _nonstatic_field_size; +@@ -177,6 +178,10 @@ + return _has_default_methods; + } + ++ bool is_anonymous() { ++ return _is_anonymous; ++ } ++ + ciInstanceKlass* get_canonical_holder(int offset); + ciField* get_field_by_offset(int field_offset, bool is_static); + ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8145096-pr2854.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,281 @@ +# HG changeset patch +# User aph +# Date 1459479993 -3600 +# Fri Apr 01 04:06:33 2016 +0100 +# Node ID 5f2728295878fc80d8d14b4304abe9629e6893cd +# Parent 2d14547e0dfb815e39edde22c092286a22d5b993 +8145096, PR2854: Undefined behaviour in HotSpot +Summary: Fix some integer overflows +Reviewed-by: jrose, kvn, kbarrett, adinn, iklam + +diff -r 2d14547e0dfb -r 5f2728295878 src/os/posix/vm/os_posix.cpp +--- openjdk/hotspot/src/os/posix/vm/os_posix.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/os/posix/vm/os_posix.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -594,7 +594,11 @@ + strncpy(buffer, "none", size); + + const struct { +- int i; ++ // NB: i is an unsigned int here because SA_RESETHAND is on some ++ // systems 0x80000000, which is implicitly unsigned. Assignining ++ // it to an int field would be an overflow in unsigned-to-signed ++ // conversion. ++ unsigned int i; + const char* s; + } flaginfo [] = { + { SA_NOCLDSTOP, "SA_NOCLDSTOP" }, +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/opto/addnode.cpp +--- openjdk/hotspot/src/share/vm/opto/addnode.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/addnode.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -344,8 +344,8 @@ + const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const { + const TypeInt *r0 = t0->is_int(); // Handy access + const TypeInt *r1 = t1->is_int(); +- int lo = r0->_lo + r1->_lo; +- int hi = r0->_hi + r1->_hi; ++ int lo = java_add(r0->_lo, r1->_lo); ++ int hi = java_add(r0->_hi, r1->_hi); + if( !(r0->is_con() && r1->is_con()) ) { + // Not both constants, compute approximate result + if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { +@@ -462,8 +462,8 @@ + const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const { + const TypeLong *r0 = t0->is_long(); // Handy access + const TypeLong *r1 = t1->is_long(); +- jlong lo = r0->_lo + r1->_lo; +- jlong hi = r0->_hi + r1->_hi; ++ jlong lo = java_add(r0->_lo, r1->_lo); ++ jlong hi = java_add(r0->_hi, r1->_hi); + if( !(r0->is_con() && r1->is_con()) ) { + // Not both constants, compute approximate result + if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/opto/loopTransform.cpp +--- openjdk/hotspot/src/share/vm/opto/loopTransform.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/loopTransform.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -1310,8 +1310,8 @@ + limit = new (C) Opaque2Node( C, limit ); + register_new_node( limit, opaq_ctrl ); + } +- if (stride_con > 0 && ((limit_type->_lo - stride_con) < limit_type->_lo) || +- stride_con < 0 && ((limit_type->_hi - stride_con) > limit_type->_hi)) { ++ if (stride_con > 0 && (java_subtract(limit_type->_lo, stride_con) < limit_type->_lo) || ++ stride_con < 0 && (java_subtract(limit_type->_hi, stride_con) > limit_type->_hi)) { + // No underflow. + new_limit = new (C) SubINode(limit, stride); + } else { +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/opto/mulnode.cpp +--- openjdk/hotspot/src/share/vm/opto/mulnode.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/mulnode.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -244,13 +244,13 @@ + double d = (double)hi1; + + // Compute all endpoints & check for overflow +- int32 A = lo0*lo1; ++ int32 A = java_multiply(lo0, lo1); + if( (double)A != a*c ) return TypeInt::INT; // Overflow? +- int32 B = lo0*hi1; ++ int32 B = java_multiply(lo0, hi1); + if( (double)B != a*d ) return TypeInt::INT; // Overflow? +- int32 C = hi0*lo1; ++ int32 C = java_multiply(hi0, lo1); + if( (double)C != b*c ) return TypeInt::INT; // Overflow? +- int32 D = hi0*hi1; ++ int32 D = java_multiply(hi0, hi1); + if( (double)D != b*d ) return TypeInt::INT; // Overflow? + + if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints +@@ -340,13 +340,13 @@ + double d = (double)hi1; + + // Compute all endpoints & check for overflow +- jlong A = lo0*lo1; ++ jlong A = java_multiply(lo0, lo1); + if( (double)A != a*c ) return TypeLong::LONG; // Overflow? +- jlong B = lo0*hi1; ++ jlong B = java_multiply(lo0, hi1); + if( (double)B != a*d ) return TypeLong::LONG; // Overflow? +- jlong C = hi0*lo1; ++ jlong C = java_multiply(hi0, lo1); + if( (double)C != b*c ) return TypeLong::LONG; // Overflow? +- jlong D = hi0*hi1; ++ jlong D = java_multiply(hi0, hi1); + if( (double)D != b*d ) return TypeLong::LONG; // Overflow? + + if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints +@@ -573,7 +573,8 @@ + // Masking off high bits which are always zero is useless. + const TypeLong* t1 = phase->type( in(1) )->isa_long(); + if (t1 != NULL && t1->_lo >= 0) { +- jlong t1_support = ((jlong)1 << (1 + log2_long(t1->_hi))) - 1; ++ int bit_count = log2_long(t1->_hi) + 1; ++ jlong t1_support = jlong(max_julong >> (BitsPerJavaLong - bit_count)); + if ((t1_support & con) == t1_support) + return usr; + } +@@ -801,7 +802,7 @@ + + // Check for ((x & ((CONST64(1)<<(64-c0))-1)) << c0) which ANDs off high bits + // before shifting them away. +- const jlong bits_mask = ((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) - CONST64(1); ++ const jlong bits_mask = jlong(max_julong >> con); + if( add1_op == Op_AndL && + phase->type(add1->in(2)) == TypeLong::make( bits_mask ) ) + return new (phase->C) LShiftLNode( add1->in(1), in(2) ); +@@ -1253,7 +1254,7 @@ + if ( con == 0 ) return NULL; // let Identity() handle a 0 shift count + // note: mask computation below does not work for 0 shift count + // We'll be wanting the right-shift amount as a mask of that many bits +- const jlong mask = (((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) -1); ++ const jlong mask = jlong(max_julong >> con); + + // Check for ((x << z) + Y) >>> z. Replace with x + con>>>z + // The idiom for rounding to a power of 2 is "(Q+(2^z-1)) >>> z". +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/opto/subnode.cpp +--- openjdk/hotspot/src/share/vm/opto/subnode.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/subnode.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -252,8 +252,8 @@ + const Type *SubINode::sub( const Type *t1, const Type *t2 ) const { + const TypeInt *r0 = t1->is_int(); // Handy access + const TypeInt *r1 = t2->is_int(); +- int32 lo = r0->_lo - r1->_hi; +- int32 hi = r0->_hi - r1->_lo; ++ int32 lo = java_subtract(r0->_lo, r1->_hi); ++ int32 hi = java_subtract(r0->_hi, r1->_lo); + + // We next check for 32-bit overflow. + // If that happens, we just assume all integers are possible. +@@ -361,8 +361,8 @@ + const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const { + const TypeLong *r0 = t1->is_long(); // Handy access + const TypeLong *r1 = t2->is_long(); +- jlong lo = r0->_lo - r1->_hi; +- jlong hi = r0->_hi - r1->_lo; ++ jlong lo = java_subtract(r0->_lo, r1->_hi); ++ jlong hi = java_subtract(r0->_hi, r1->_lo); + + // We next check for 32-bit overflow. + // If that happens, we just assume all integers are possible. +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/opto/type.cpp +--- openjdk/hotspot/src/share/vm/opto/type.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/type.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -1317,8 +1317,8 @@ + + // The new type narrows the old type, so look for a "death march". + // See comments on PhaseTransform::saturate. +- juint nrange = _hi - _lo; +- juint orange = ohi - olo; ++ juint nrange = (juint)_hi - _lo; ++ juint orange = (juint)ohi - olo; + if (nrange < max_juint - 1 && nrange > (orange >> 1) + (SMALLINT*2)) { + // Use the new type only if the range shrinks a lot. + // We do not want the optimizer computing 2^31 point by point. +@@ -1351,7 +1351,7 @@ + //------------------------------hash------------------------------------------- + // Type-specific hashing function. + int TypeInt::hash(void) const { +- return _lo+_hi+_widen+(int)Type::Int; ++ return java_add(java_add(_lo, _hi), java_add(_widen, (int)Type::Int)); + } + + //------------------------------is_finite-------------------------------------- +@@ -1532,7 +1532,7 @@ + // If neither endpoint is extremal yet, push out the endpoint + // which is closer to its respective limit. + if (_lo >= 0 || // easy common case +- (julong)(_lo - min) >= (julong)(max - _hi)) { ++ ((julong)_lo - min) >= ((julong)max - _hi)) { + // Try to widen to an unsigned range type of 32/63 bits: + if (max >= max_juint && _hi < max_juint) + return make(_lo, max_juint, WidenMax); +@@ -2296,7 +2296,7 @@ + //------------------------------hash------------------------------------------- + // Type-specific hashing function. + int TypePtr::hash(void) const { +- return _ptr + _offset; ++ return java_add(_ptr, _offset); + } + + //------------------------------dump2------------------------------------------ +@@ -2877,12 +2877,9 @@ + // Type-specific hashing function. + int TypeOopPtr::hash(void) const { + return +- (const_oop() ? const_oop()->hash() : 0) + +- _klass_is_exact + +- _instance_id + +- hash_speculative() + +- _inline_depth + +- TypePtr::hash(); ++ java_add(java_add(const_oop() ? const_oop()->hash() : 0, _klass_is_exact), ++ java_add(_instance_id, java_add(hash_speculative(), ++ java_add(_inline_depth, TypePtr::hash())))); + } + + //------------------------------dump2------------------------------------------ +@@ -3608,7 +3605,7 @@ + //------------------------------hash------------------------------------------- + // Type-specific hashing function. + int TypeInstPtr::hash(void) const { +- int hash = klass()->hash() + TypeOopPtr::hash(); ++ int hash = java_add(klass()->hash(), TypeOopPtr::hash()); + return hash; + } + +@@ -4503,7 +4500,7 @@ + //------------------------------hash------------------------------------------- + // Type-specific hashing function. + int TypeKlassPtr::hash(void) const { +- return klass()->hash() + TypePtr::hash(); ++ return java_add(klass()->hash(), TypePtr::hash()); + } + + //------------------------------singleton-------------------------------------- +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/runtime/advancedThresholdPolicy.cpp +--- openjdk/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp Fri Apr 01 04:06:33 2016 +0100 +@@ -131,7 +131,8 @@ + } + + double AdvancedThresholdPolicy::weight(Method* method) { +- return (method->rate() + 1) * ((method->invocation_count() + 1) * (method->backedge_count() + 1)); ++ return (double)(method->rate() + 1) * ++ (method->invocation_count() + 1) * (method->backedge_count() + 1); + } + + // Apply heuristics and return true if x should be compiled before y +diff -r 2d14547e0dfb -r 5f2728295878 src/share/vm/utilities/globalDefinitions.hpp +--- openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Mar 30 04:49:01 2016 +0100 ++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp Fri Apr 01 04:06:33 2016 +0100 +@@ -1405,6 +1405,32 @@ + + #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) + ++//---------------------------------------------------------------------------------------------------- ++// Sum and product which can never overflow: they wrap, just like the ++// Java operations. Note that we don't intend these to be used for ++// general-purpose arithmetic: their purpose is to emulate Java ++// operations. ++ ++// The goal of this code to avoid undefined or implementation-defined ++// behaviour. The use of an lvalue to reference cast is explicitly ++// permitted by Lvalues and rvalues [basic.lval]. [Section 3.10 Para ++// 15 in C++03] ++#define JAVA_INTEGER_OP(OP, NAME, TYPE, UNSIGNED_TYPE) \ ++inline TYPE NAME (TYPE in1, TYPE in2) { \ ++ UNSIGNED_TYPE ures = static_cast<UNSIGNED_TYPE>(in1); \ ++ ures OP ## = static_cast<UNSIGNED_TYPE>(in2); \ ++ return reinterpret_cast<TYPE&>(ures); \ ++} ++ ++JAVA_INTEGER_OP(+, java_add, jint, juint) ++JAVA_INTEGER_OP(-, java_subtract, jint, juint) ++JAVA_INTEGER_OP(*, java_multiply, jint, juint) ++JAVA_INTEGER_OP(+, java_add, jlong, julong) ++JAVA_INTEGER_OP(-, java_subtract, jlong, julong) ++JAVA_INTEGER_OP(*, java_multiply, jlong, julong) ++ ++#undef JAVA_INTEGER_OP ++ + // Dereference vptr + // All C++ compilers that we know of have the vtbl pointer in the first + // word. If there are exceptions, this function needs to be made compiler
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8148752-pr2943.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,114 @@ +# HG changeset patch +# User thartmann +# Date 1455606693 -3600 +# Tue Feb 16 08:11:33 2016 +0100 +# Node ID 76eca5cf31500ecb1d1807685729a7ea5c3780e7 +# Parent a298e2a6f83a411385da1fed5b09c3ee52c71c31 +8148752, PR2943: Compiled StringBuilder code throws StringIndexOutOfBoundsException +Summary: Fixed handling of long/double MH arguments in GraphBuilder::try_method_handle_inline(). +Reviewed-by: roland, shade, vlivanov, kvn, twisti + +diff -r a298e2a6f83a -r 76eca5cf3150 src/share/vm/opto/callGenerator.cpp +--- openjdk/hotspot/src/share/vm/opto/callGenerator.cpp Wed Apr 20 04:04:43 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/callGenerator.cpp Tue Feb 16 08:11:33 2016 +0100 +@@ -829,17 +829,18 @@ + } + } + // Cast reference arguments to its type. +- for (int i = 0; i < signature->count(); i++) { ++ for (int i = 0, j = 0; i < signature->count(); i++) { + ciType* t = signature->type_at(i); + if (t->is_klass()) { +- Node* arg = kit.argument(receiver_skip + i); ++ Node* arg = kit.argument(receiver_skip + j); + const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr(); + const Type* sig_type = TypeOopPtr::make_from_klass(t->as_klass()); + if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { + Node* cast_obj = gvn.transform(new (C) CheckCastPPNode(kit.control(), arg, sig_type)); +- kit.set_argument(receiver_skip + i, cast_obj); ++ kit.set_argument(receiver_skip + j, cast_obj); + } + } ++ j += t->size(); // long and double take two slots + } + + // Try to get the most accurate receiver type +diff -r a298e2a6f83a -r 76eca5cf3150 test/compiler/jsr292/LongReferenceCastingTest.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/jsr292/LongReferenceCastingTest.java Tue Feb 16 08:11:33 2016 +0100 +@@ -0,0 +1,75 @@ ++/* ++ * 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. ++ * ++ */ ++ ++import java.lang.invoke.*; ++ ++/** ++ * @test ++ * @bug 8148752 ++ * @summary Test correct casting of MH arguments during inlining. ++ * @run main LongReferenceCastingTest ++ */ ++public class LongReferenceCastingTest { ++ static final String MY_STRING = "myString"; ++ static final MethodHandle MH; ++ ++ static { ++ try { ++ MethodHandles.Lookup lookup = MethodHandles.lookup(); ++ MethodType mt = MethodType.methodType(String.class, long.class, Object.class, String.class); ++ MH = lookup.findVirtual(LongReferenceCastingTest.class, "myMethod", mt); ++ } catch (Exception e) { ++ throw new Error(e); ++ } ++ } ++ ++ public String myMethod(long l, Object o, String s) { ++ // The long argument occupies two stack slots, causing C2 to treat it as ++ // two arguments and casting the fist one two long and the second one to Object. ++ // As a result, Object o is casted to String and the o.toString() call is ++ // inlined as String::toString(). We fail at runtime because 'o' is not a String. ++ return o.toString(); ++ } ++ ++ public String toString() { ++ return MY_STRING; ++ } ++ ++ public static void main(String[] args) throws Exception { ++ LongReferenceCastingTest test = new LongReferenceCastingTest(); ++ try { ++ for (int i = 0; i < 20_000; ++i) { ++ if (!test.invoke().equals(MY_STRING)) { ++ throw new RuntimeException("Invalid string"); ++ } ++ } ++ } catch (Throwable t) { ++ throw new RuntimeException("Test failed", t); ++ } ++ } ++ ++ public String invoke() throws Throwable { ++ return (String) MH.invokeExact(this, 0L, (Object)this, MY_STRING); ++ } ++}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8154210.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,47 @@ +# HG changeset patch +# User aph +# Date 1461121375 -3600 +# Wed Apr 20 04:02:55 2016 +0100 +# Node ID 5605c859f0ec47d6f507cc83e783554a4210ccf6 +# Parent 7458e5178c8646a9b4f76ac3d13b222abed3f16f +8154210: Zero: Better byte behaviour +Summary: Complete support for 8132051 on Zero and fix failure on 64-bit big-endian systems +Reviewed-by: andrew, chrisphi + +diff -r 7458e5178c86 -r 5605c859f0ec src/cpu/zero/vm/cppInterpreter_zero.cpp +--- openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue May 17 03:03:36 2016 +0100 ++++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed Apr 20 04:02:55 2016 +0100 +@@ -220,9 +220,16 @@ + // Push our result + for (int i = 0; i < result_slots; i++) { + // Adjust result to smaller +- intptr_t res = result[-i]; ++ union { ++ intptr_t res; ++ jint res_jint; ++ }; ++ res = result[-i]; + if (result_slots == 1) { +- res = narrow(method->result_type(), res); ++ BasicType t = method->result_type(); ++ if (is_subword_type(t)) { ++ res_jint = (jint)narrow(t, res_jint); ++ } + } + stack->push(res); + } +diff -r 7458e5178c86 -r 5605c859f0ec src/share/vm/interpreter/bytecodeInterpreter.cpp +--- openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Tue May 17 03:03:36 2016 +0100 ++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Wed Apr 20 04:02:55 2016 +0100 +@@ -593,8 +593,9 @@ + /* 0xDC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + + /* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +-/* 0xE4 */ &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, &&opc_return_register_finalizer, +-/* 0xE8 */ &&opc_invokehandle,&&opc_default, &&opc_default, &&opc_default, ++/* 0xE4 */ &&opc_default, &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, ++/* 0xE8 */ &&opc_return_register_finalizer, ++ &&opc_invokehandle, &&opc_default, &&opc_default, + /* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + + /* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8158260-pr2991-rh1341258.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,510 @@ +# HG changeset patch +# User simonis +# Date 1466155884 -7200 +# Fri Jun 17 11:31:24 2016 +0200 +# Node ID 4b40867e627dd9043bc67a4795caa9834ef69478 +# Parent 3fc29347b27fdd2075e6ec6d80bb26ab2bf667c1 +8158260, PR2991, RH1341258: PPC64: unaligned Unsafe.getInt can lead to the generation of illegal instructions +Summary: Adjust instruction generation. Includes portions of 8026049 for test case. +Reviewed-by: goetz +Contributed-by: gromero@linux.vnet.ibm.com, horii@jp.ibm.com + +diff -r 3fc29347b27f -r 4b40867e627d src/cpu/aarch64/vm/vm_version_aarch64.cpp +--- openjdk/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp Fri Jun 17 11:31:24 2016 +0200 +@@ -1,6 +1,6 @@ + /* +- * Copyright (c) 2013, Red Hat Inc. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. ++ * Copyright (c) 2015, Red Hat Inc. All rights reserved. + * All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * +@@ -232,6 +232,11 @@ + UsePopCountInstruction = true; + } + ++ // This machine allows unaligned memory accesses ++ if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { ++ FLAG_SET_DEFAULT(UseUnalignedAccesses, true); ++ } ++ + #ifdef COMPILER2 + if (FLAG_IS_DEFAULT(OptoScheduling)) { + OptoScheduling = true; +diff -r 3fc29347b27f -r 4b40867e627d src/cpu/ppc/vm/ppc.ad +--- openjdk/hotspot/src/cpu/ppc/vm/ppc.ad Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/ppc/vm/ppc.ad Fri Jun 17 11:31:24 2016 +0200 +@@ -5461,7 +5461,7 @@ + %} + + // Match loading integer and casting it to long. +-instruct loadI2L(iRegLdst dst, memory mem) %{ ++instruct loadI2L(iRegLdst dst, memoryAlg4 mem) %{ + match(Set dst (ConvI2L (LoadI mem))); + predicate(_kids[0]->_leaf->as_Load()->is_unordered()); + ins_cost(MEMORY_REF_COST); +@@ -5477,7 +5477,7 @@ + %} + + // Match loading integer and casting it to long - acquire. +-instruct loadI2L_ac(iRegLdst dst, memory mem) %{ ++instruct loadI2L_ac(iRegLdst dst, memoryAlg4 mem) %{ + match(Set dst (ConvI2L (LoadI mem))); + ins_cost(3*MEMORY_REF_COST); + +diff -r 3fc29347b27f -r 4b40867e627d src/cpu/ppc/vm/vm_version_ppc.cpp +--- openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp Fri Jun 17 11:31:24 2016 +0200 +@@ -1,6 +1,6 @@ + /* +- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +- * Copyright 2012, 2014 SAP AG. All rights reserved. ++ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. ++ * Copyright 2012, 2015 SAP AG. 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 +@@ -177,6 +177,10 @@ + FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); + } + ++ // This machine allows unaligned memory accesses ++ if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { ++ FLAG_SET_DEFAULT(UseUnalignedAccesses, true); ++ } + } + + void VM_Version::print_features() { +diff -r 3fc29347b27f -r 4b40867e627d src/cpu/sparc/vm/vm_version_sparc.cpp +--- openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Fri Jun 17 11:31:24 2016 +0200 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2015, 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 +@@ -361,6 +361,13 @@ + (cache_line_size > ContendedPaddingWidth)) + ContendedPaddingWidth = cache_line_size; + ++ // This machine does not allow unaligned memory accesses ++ if (UseUnalignedAccesses) { ++ if (!FLAG_IS_DEFAULT(UseUnalignedAccesses)) ++ warning("Unaligned memory access is not available on this CPU"); ++ FLAG_SET_DEFAULT(UseUnalignedAccesses, false); ++ } ++ + #ifndef PRODUCT + if (PrintMiscellaneous && Verbose) { + tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size()); +diff -r 3fc29347b27f -r 4b40867e627d src/cpu/x86/vm/vm_version_x86.cpp +--- openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Fri Jun 17 11:31:24 2016 +0200 +@@ -994,6 +994,11 @@ + (cache_line_size > ContendedPaddingWidth)) + ContendedPaddingWidth = cache_line_size; + ++ // This machine allows unaligned memory accesses ++ if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { ++ FLAG_SET_DEFAULT(UseUnalignedAccesses, true); ++ } ++ + #ifndef PRODUCT + if (PrintMiscellaneous && Verbose) { + tty->print_cr("Logical CPUs per core: %u", +diff -r 3fc29347b27f -r 4b40867e627d src/cpu/zero/vm/vm_version_zero.cpp +--- openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp Fri Jun 17 11:31:24 2016 +0200 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * +@@ -36,4 +36,11 @@ + # include "os_bsd.inline.hpp" + #endif + +-// This file is intentionally empty ++ ++void VM_Version::initialize() { ++ // This machine does not allow unaligned memory accesses ++ if (! FLAG_IS_DEFAULT(UseUnalignedAccesses)) { ++ warning("Unaligned memory access is not available on this CPU"); ++ FLAG_SET_DEFAULT(UseUnalignedAccesses, false); ++ } ++} +diff -r 3fc29347b27f -r 4b40867e627d src/share/vm/prims/unsafe.cpp +--- openjdk/hotspot/src/share/vm/prims/unsafe.cpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp Fri Jun 17 11:31:24 2016 +0200 +@@ -393,6 +393,24 @@ + + #endif // not SUPPORTS_NATIVE_CX8 + ++UNSAFE_ENTRY(jboolean, Unsafe_isBigEndian0(JNIEnv *env, jobject unsafe)) ++ UnsafeWrapper("Unsafe_IsBigEndian0"); ++ { ++#ifdef VM_LITTLE_ENDIAN ++ return false; ++#else ++ return true; ++#endif ++ } ++UNSAFE_END ++ ++UNSAFE_ENTRY(jint, Unsafe_unalignedAccess0(JNIEnv *env, jobject unsafe)) ++ UnsafeWrapper("Unsafe_UnalignedAccess0"); ++ { ++ return UseUnalignedAccesses; ++ } ++UNSAFE_END ++ + #define DEFINE_GETSETOOP(jboolean, Boolean) \ + \ + UNSAFE_ENTRY(jboolean, Unsafe_Get##Boolean##140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) \ +@@ -1704,6 +1722,9 @@ + {CC"loadFence", CC"()V", FN_PTR(Unsafe_LoadFence)}, + {CC"storeFence", CC"()V", FN_PTR(Unsafe_StoreFence)}, + {CC"fullFence", CC"()V", FN_PTR(Unsafe_FullFence)}, ++ ++ {CC"isBigEndian0", CC"()Z", FN_PTR(Unsafe_isBigEndian0)}, ++ {CC"unalignedAccess0", CC"()Z", FN_PTR(Unsafe_unalignedAccess0)} + }; + + #undef CC +diff -r 3fc29347b27f -r 4b40867e627d src/share/vm/runtime/globals.hpp +--- openjdk/hotspot/src/share/vm/runtime/globals.hpp Fri May 20 19:42:15 2016 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp Fri Jun 17 11:31:24 2016 +0200 +@@ -3961,6 +3961,9 @@ + product(bool, UseLockedTracing, false, \ + "Use locked-tracing when doing event-based tracing") \ + \ ++ diagnostic(bool, UseUnalignedAccesses, false, \ ++ "Use unaligned memory accesses in sun.misc.Unsafe") \ ++ \ + product_pd(bool, PreserveFramePointer, \ + "Use the FP register for holding the frame pointer " \ + "and not as a general purpose register.") +diff -r 3fc29347b27f -r 4b40867e627d test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java Fri Jun 17 11:31:24 2016 +0200 +@@ -0,0 +1,315 @@ ++/* ++ * Copyright (c) 2016 SAP SE. 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 8158260 ++ * @summary Test unaligned Unsafe accesses ++ * @modules java.base/jdk.internal.misc ++ * @run main/othervm -Diters=20000 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation JdkInternalMiscUnsafeUnalignedAccess ++ * @author volker.simonis@gmail.com ++ */ ++ ++import java.lang.reflect.Field; ++import java.nio.ByteOrder; ++import sun.misc.Unsafe; ++ ++public class JdkInternalMiscUnsafeUnalignedAccess { ++ static final int ITERS = Integer.getInteger("iters", 20_000); ++ private static final boolean BIG_ENDIAN = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN); ++ private static final Unsafe UNSAFE; ++ private static final int SIZE = 1024; ++ private static long memory; ++ ++ static { ++ try { ++ Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe"); ++ unsafeField.setAccessible(true); ++ UNSAFE = (Unsafe) unsafeField.get(null); ++ } ++ catch (Exception e) { ++ throw new RuntimeException("Unable to get Unsafe instance.", e); ++ } ++ } ++ ++ static int getInt_0() { ++ return UNSAFE.getInt(memory + 0); ++ } ++ static int getInt_1() { ++ return UNSAFE.getInt(memory + 1); ++ } ++ static int getInt_4() { ++ return UNSAFE.getInt(memory + 4); ++ } ++ static int getInt_17() { ++ return UNSAFE.getInt(memory + 17); ++ } ++ ++ static long getIntAsLong_0() { ++ return UNSAFE.getInt(memory + 0); ++ } ++ static long getIntAsLong_1() { ++ return UNSAFE.getInt(memory + 1); ++ } ++ static long getIntAsLong_4() { ++ return UNSAFE.getInt(memory + 4); ++ } ++ static long getIntAsLong_17() { ++ return UNSAFE.getInt(memory + 17); ++ } ++ ++ static long getLong_0() { ++ return UNSAFE.getLong(memory + 0); ++ } ++ static long getLong_1() { ++ return UNSAFE.getLong(memory + 1); ++ } ++ static long getLong_4() { ++ return UNSAFE.getLong(memory + 4); ++ } ++ static long getLong_8() { ++ return UNSAFE.getLong(memory + 8); ++ } ++ static long getLong_17() { ++ return UNSAFE.getLong(memory + 17); ++ } ++ ++ static void putInt_0(int i) { ++ UNSAFE.putInt(memory + 0, i); ++ } ++ static void putInt_1(int i) { ++ UNSAFE.putInt(memory + 1, i); ++ } ++ static void putInt_4(int i) { ++ UNSAFE.putInt(memory + 4, i); ++ } ++ static void putInt_17(int i) { ++ UNSAFE.putInt(memory + 17, i); ++ } ++ ++ static void putLong_0(long l) { ++ UNSAFE.putLong(memory + 0, l); ++ } ++ static void putLong_1(long l) { ++ UNSAFE.putLong(memory + 1, l); ++ } ++ static void putLong_4(long l) { ++ UNSAFE.putLong(memory + 4, l); ++ } ++ static void putLong_8(long l) { ++ UNSAFE.putLong(memory + 8, l); ++ } ++ static void putLong_17(long l) { ++ UNSAFE.putLong(memory + 17, l); ++ } ++ ++ public static void main(String[] args) throws Exception { ++ ++ if (!UNSAFE.unalignedAccess()) { ++ System.out.println("Platform is not supporting unaligned access - nothing to test."); ++ return; ++ } ++ ++ memory = UNSAFE.allocateMemory(SIZE); ++ ++ UNSAFE.putInt(memory + 0, 0x00112233); ++ UNSAFE.putInt(memory + 4, 0x44556677); ++ UNSAFE.putInt(memory + 8, 0x8899aabb); ++ UNSAFE.putInt(memory + 12, 0xccddeeff); ++ UNSAFE.putInt(memory + 16, 0x01234567); ++ UNSAFE.putInt(memory + 20, 0x89abcdef); ++ UNSAFE.putInt(memory + 24, 0x01234567); ++ ++ // Unsafe.getInt() ++ int res; ++ for (int i = 0; i < ITERS; i++) { ++ res = getInt_0(); ++ if (res != 0x00112233) { ++ throw new Exception(res + " != 0x00112233"); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ res = getInt_1(); ++ if (res != (BIG_ENDIAN ? 0x11223344 : 0x77001122)) { ++ throw new Exception(res + " != " + (BIG_ENDIAN ? 0x11223344 : 0x77001122)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ res = getInt_4(); ++ if (res != 0x44556677) { ++ throw new Exception(res + " != 0x44556677"); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ res = getInt_17(); ++ if (res != (BIG_ENDIAN ? 0x23456789 : 0xef012345)) { ++ throw new Exception(res + " != " + (BIG_ENDIAN ? 0x23456789 : 0xef012345)); ++ } ++ } ++ ++ // (long)Unsafe.getInt() ++ long lres; ++ for (int i = 0; i < ITERS; i++) { ++ lres = getIntAsLong_0(); ++ if (lres != (long)0x00112233) { ++ throw new Exception(lres + " != 0x00112233"); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getIntAsLong_1(); ++ if (lres != (BIG_ENDIAN ? (long)0x11223344 : (long)0x77001122)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? (long)0x11223344 : (long)0x77001122)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getIntAsLong_4(); ++ if (lres != (long)0x44556677) { ++ throw new Exception(lres + " != 0x44556677"); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getIntAsLong_17(); ++ if (lres != (BIG_ENDIAN ? (long)0x23456789 : (long)0xef012345)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? (long)0x23456789 : (long)0xef012345)); ++ } ++ } ++ ++ // Unsafe.getLong() ++ for (int i = 0; i < ITERS; i++) { ++ lres = getLong_0(); ++ if (lres != (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getLong_1(); ++ if (lres != (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getLong_4(); ++ if (lres != (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getLong_8(); ++ if (lres != (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ lres = getLong_17(); ++ if (lres != (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L)); ++ } ++ } ++ ++ // Unsafe.putInt() ++ for (int i = 0; i < ITERS; i++) { ++ putInt_0(0x00112233); ++ res = getInt_0(); ++ if (res != 0x00112233) { ++ throw new Exception(res + " != 0x00112233"); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putInt_1(BIG_ENDIAN ? 0x11223344 : 0x77001122); ++ res = getInt_1(); ++ if (res != (BIG_ENDIAN ? 0x11223344 : 0x77001122)) { ++ throw new Exception(res + " != " + (BIG_ENDIAN ? 0x11223344 : 0x77001122)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putInt_4(0x44556677); ++ res = getInt_4(); ++ if (res != 0x44556677) { ++ throw new Exception(res + " != 0x44556677"); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putInt_17(BIG_ENDIAN ? 0x23456789 : 0xef012345); ++ res = getInt_17(); ++ if (res != (BIG_ENDIAN ? 0x23456789 : 0xef012345)) { ++ throw new Exception(res + " != " + (BIG_ENDIAN ? 0x23456789 : 0xef012345)); ++ } ++ } ++ ++ ++ // Unsafe.putLong() ++ for (int i = 0; i < ITERS; i++) { ++ putLong_0(BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L); ++ lres = getLong_0(); ++ if (lres != (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x0011223344556677L : 0x4455667700112233L)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putLong_1(BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L); ++ lres = getLong_1(); ++ if (lres != (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x1122334455667788L : 0xbb44556677001122L)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putLong_4(BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L); ++ lres = getLong_4(); ++ if (lres != (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x445566778899aabbL : 0x8899aabb44556677L)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putLong_8(BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL); ++ lres = getLong_8(); ++ if (lres != (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x8899aabbccddeeffL : 0xccddeeff8899aabbL)); ++ } ++ } ++ ++ for (int i = 0; i < ITERS; i++) { ++ putLong_17(BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L); ++ lres = getLong_17(); ++ if (lres != (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L)) { ++ throw new Exception(lres + " != " + (BIG_ENDIAN ? 0x23456789abcdef01L : 0x6789abcdef012345L)); ++ } ++ } ++ } ++ ++}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/8159244-pr3074.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,115 @@ +# HG changeset patch +# User thartmann +# Date 1468206230 -3600 +# Mon Jul 11 04:03:50 2016 +0100 +# Node ID 7c89f7f3f2c57d64970cc2ae3a81d24765830118 +# Parent 4b40867e627dd9043bc67a4795caa9834ef69478 +8159244, PR3074: Partially initialized string object created by C2's string concat optimization may escape +Summary: Emit release barrier after String creation to prevent partially initialized object from escaping. +Reviewed-by: kvn + +diff -r 4b40867e627d -r 7c89f7f3f2c5 src/share/vm/opto/stringopts.cpp +--- openjdk/hotspot/src/share/vm/opto/stringopts.cpp Fri Jun 17 11:31:24 2016 +0200 ++++ openjdk/hotspot/src/share/vm/opto/stringopts.cpp Mon Jul 11 04:03:50 2016 +0100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2009, 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 +@@ -1640,6 +1640,12 @@ + kit.store_String_length(kit.control(), result, length); + } + kit.store_String_value(kit.control(), result, char_array); ++ ++ // The value field is final. Emit a barrier here to ensure that the effect ++ // of the initialization is committed to memory before any code publishes ++ // a reference to the newly constructed object (see Parse::do_exits()). ++ assert(AllocateNode::Ideal_allocation(result, _gvn) != NULL, "should be newly allocated"); ++ kit.insert_mem_bar(Op_MemBarRelease, result); + } else { + result = C->top(); + } +diff -r 4b40867e627d -r 7c89f7f3f2c5 test/compiler/stringopts/TestStringObjectInitialization.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/hotspot/test/compiler/stringopts/TestStringObjectInitialization.java Mon Jul 11 04:03:50 2016 +0100 +@@ -0,0 +1,78 @@ ++/* ++ * 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. ++ */ ++ ++ ++import java.util.Arrays; ++ ++/* ++ * @test ++ * @bug 8159244 ++ * @requires vm.gc == "Parallel" | vm.gc == "null" ++ * @summary Verifies that no partially initialized String object escapes from ++ * C2's String concat optimization in a highly concurrent setting. ++ * This test triggers the bug in about 1 out of 10 runs. ++ * @compile -XDstringConcat=inline TestStringObjectInitialization.java ++ * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-CompactStrings ++ * -XX:-UseG1GC -XX:+UseParallelGC TestStringObjectInitialization ++ */ ++public class TestStringObjectInitialization { ++ ++ String myString; ++ ++ public static void main(String[] args) throws Exception { ++ TestStringObjectInitialization t = new TestStringObjectInitialization(); ++ // Create some threads that concurrently update 'myString' ++ for (int i = 0; i < 100; ++i) { ++ (new Thread(new Runner(t))).start(); ++ } ++ Thread last = new Thread(new Runner(t)); ++ last.start(); ++ last.join(); ++ } ++ ++ private void add(String message) { ++ // String escapes to other threads here ++ myString += message; ++ } ++ ++ public void run(String s, String[] sArray) { ++ // Trigger C2's string concatenation optimization ++ add(s + Arrays.toString(sArray) + " const "); ++ } ++} ++ ++class Runner implements Runnable { ++ private TestStringObjectInitialization test; ++ ++ public Runner(TestStringObjectInitialization t) { ++ test = t; ++ } ++ ++ public void run(){ ++ String[] array = {"a", "b", "c"}; ++ for (int i = 0; i < 10000; ++i) { ++ test.run("a", array); ++ } ++ } ++} ++
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/crash_dump.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,65 @@ +# HG changeset patch +# User andrew +# Date 1273843189 -3600 +# Fri May 14 14:19:49 2010 +0100 +# Node ID 468593ef6b33c2adc6a8f1ddd3b642b62faafcb2 +# Parent e431f9da7dc99624f01c0d57d2b4e89d4a778010 +Include DERIVATIVE_ID and DISTRIBUTION_ID in crash dump. Use IcedTea bug URL. + +diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make +--- openjdk.orig/hotspot/make/linux/makefiles/vm.make 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/make/linux/makefiles/vm.make 2016-07-21 03:41:10.642865322 +0100 +@@ -90,6 +90,14 @@ + BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" + VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" + ++ifdef DERIVATIVE_ID ++CPPFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\"" ++endif ++ ++ifdef DISTRIBUTION_ID ++CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\"" ++endif ++ + CXXFLAGS = \ + ${SYSDEFS} \ + ${INCLUDES} \ +diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp 2016-07-21 03:39:33.780462719 +0100 +@@ -67,7 +67,7 @@ + #endif // INCLUDE_ALL_GCS + + // Note: This is a special bug reporting site for the JVM +-#define DEFAULT_VENDOR_URL_BUG "http://bugreport.java.com/bugreport/crash.jsp" ++#define DEFAULT_VENDOR_URL_BUG "http://icedtea.classpath.org/bugzilla" + #define DEFAULT_JAVA_LAUNCHER "generic" + + // Disable options not supported in this release, with a warning if they +diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp openjdk/hotspot/src/share/vm/utilities/vmError.cpp +--- openjdk.orig/hotspot/src/share/vm/utilities/vmError.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp 2016-07-21 03:39:14.800775724 +0100 +@@ -197,7 +197,8 @@ + + static void print_bug_submit_message(outputStream *out, Thread *thread) { + if (out == NULL) return; +- out->print_raw_cr("# If you would like to submit a bug report, please visit:"); ++ out->print_raw_cr("# If you would like to submit a bug report, please include"); ++ out->print_raw_cr("# instructions on how to reproduce the bug and visit:"); + out->print_raw ("# "); + out->print_raw_cr(Arguments::java_vendor_url_bug()); + // If the crash is in native code, encourage user to submit a bug to the +@@ -470,6 +471,13 @@ + UseCompressedOops ? "compressed oops" : "" + ); + ++#ifdef DERIVATIVE_ID ++ st->print_cr("# Derivative: %s", DERIVATIVE_ID); ++#endif ++#ifdef DISTRIBUTION_ID ++ st->print_cr("# Distribution: %s", DISTRIBUTION_ID); ++#endif ++ + STEP(60, "(printing problematic frame)") + + // Print current frame if we have a context (i.e. it's a crash)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/no_devirt.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,20 @@ +# HG changeset patch +# User andrew +# Date 1398352866 -3600 +# Thu Apr 24 16:21:06 2014 +0100 +# Node ID 2b4f89de39c2c4fd09f927adacb3781454dbee44 +# Parent 6cb711fa264d25f3592471a81a5b865c505a9fd7 +Extend 8041658 to all files in the HotSpot build. + +diff -r 6cb711fa264d -r 2b4f89de39c2 make/linux/makefiles/gcc.make +--- openjdk/hotspot/make/linux/makefiles/gcc.make Wed Apr 23 22:06:29 2014 +0100 ++++ openjdk/hotspot/make/linux/makefiles/gcc.make Thu Apr 24 16:21:06 2014 +0100 +@@ -267,7 +267,7 @@ + OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) + endif + ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 9), 1) +- OPT_CFLAGS/macroAssembler_x86.o += -fno-devirtualize ++ OPT_CFLAGS += -fno-devirtualize + endif + endif +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/pr1368.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,674 @@ +# HG changeset patch +# User andrew +# Date 1452532602 0 +# Mon Jan 11 17:16:42 2016 +0000 +# Node ID be477dd4629d2155bde02047cc81ca4f8b657a49 +# Parent e04f994581e23e89757774cd2033413bc650a831 +PR1368: Ensure debug data is available for all libraries and binaries without redundant files + +diff -r e04f994581e2 -r be477dd4629d make/aix/makefiles/defs.make +--- openjdk/hotspot/make/aix/makefiles/defs.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/aix/makefiles/defs.make Mon Jan 11 17:16:42 2016 +0000 +@@ -186,12 +186,14 @@ + # client and server subdirectories have symbolic links to ../libjsig.so + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) + #ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++#ifneq ($(STRIP_POLICY),no_strip) + # ifeq ($(ZIP_DEBUGINFO_FILES),1) + # EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz + # else + # EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + # endif + #endif ++#endif + EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server + EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client + EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal +@@ -200,24 +202,28 @@ + EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) + # ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++# ifneq ($(STRIP_POLICY),no_strip) + # ifeq ($(ZIP_DEBUGINFO_FILES),1) + # EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz + # else + # EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo + # endif + # endif ++# endif + endif + + ifeq ($(JVM_VARIANT_CLIENT),true) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) + # ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++# ifneq ($(STRIP_POLICY),no_strip) + # ifeq ($(ZIP_DEBUGINFO_FILES),1) + # EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz + # else + # EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo + # endif + # endif ++# endif + endif + + # Serviceability Binaries +diff -r e04f994581e2 -r be477dd4629d make/aix/makefiles/jsig.make +--- openjdk/hotspot/make/aix/makefiles/jsig.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/aix/makefiles/jsig.make Mon Jan 11 17:16:42 2016 +0000 +@@ -60,6 +60,7 @@ + $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl + + #ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++#ifneq ($(STRIP_POLICY),no_strip) + # $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) + # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ + # ifeq ($(STRIP_POLICY),all_strip) +@@ -75,6 +76,7 @@ + # $(RM) $(LIBJSIG_DEBUGINFO) + # endif + #endif ++#endif + + install_jsig: $(LIBJSIG) + @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" +diff -r e04f994581e2 -r be477dd4629d make/aix/makefiles/saproc.make +--- openjdk/hotspot/make/aix/makefiles/saproc.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/aix/makefiles/saproc.make Mon Jan 11 17:16:42 2016 +0000 +@@ -88,8 +88,10 @@ + -o $@ \ + -lthread_db + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -99,8 +101,10 @@ + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) + $(RM) $(LIBSAPROC_DEBUGINFO) ++ endif + endif + endif + +diff -r e04f994581e2 -r be477dd4629d make/aix/makefiles/vm.make +--- openjdk/hotspot/make/aix/makefiles/vm.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/aix/makefiles/vm.make Mon Jan 11 17:16:42 2016 +0000 +@@ -330,6 +330,7 @@ + # } + + #ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++#ifneq ($(STRIP_POLICY),no_strip) + # $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) + # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ + # ifeq ($(STRIP_POLICY),all_strip) +@@ -345,6 +346,7 @@ + # $(RM) $(LIBJVM_DEBUGINFO) + # endif + #endif ++#endif + + DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR) + DEST_JVM = $(DEST_SUBDIR)/$(LIBJVM) +diff -r e04f994581e2 -r be477dd4629d make/bsd/makefiles/defs.make +--- openjdk/hotspot/make/bsd/makefiles/defs.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/bsd/makefiles/defs.make Mon Jan 11 17:16:42 2016 +0000 +@@ -269,6 +269,7 @@ + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz + else +@@ -279,6 +280,7 @@ + endif + endif + endif ++endif + + EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server + EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client +@@ -289,6 +291,7 @@ + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz + else +@@ -299,6 +302,7 @@ + endif + endif + endif ++ endif + endif + + ifeq ($(JVM_VARIANT_CLIENT),true) +@@ -306,6 +310,7 @@ + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz + else +@@ -316,6 +321,7 @@ + endif + endif + endif ++ endif + endif + + ifeq ($(JVM_VARIANT_MINIMAL1),true) +@@ -329,6 +335,7 @@ + $(EXPORT_LIB_DIR)/sa-jdi.jar + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + else +@@ -346,6 +353,7 @@ + $(EXPORT_LIB_DIR)/sa-jdi.jar + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + else +@@ -356,6 +364,7 @@ + endif + endif + endif ++endif + + ADD_SA_BINARIES/ppc = + ADD_SA_BINARIES/ia64 = +@@ -398,6 +407,7 @@ + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/Xusage.txt + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/Xusage.txt + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.diz + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.diz +@@ -410,6 +420,7 @@ + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM + endif + endif ++ endif + + endif + endif +diff -r e04f994581e2 -r be477dd4629d make/bsd/makefiles/jsig.make +--- openjdk/hotspot/make/bsd/makefiles/jsig.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/bsd/makefiles/jsig.make Mon Jan 11 17:16:42 2016 +0000 +@@ -64,6 +64,7 @@ + $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ + $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) +@@ -87,6 +88,7 @@ + endif + endif + endif ++endif + + install_jsig: $(LIBJSIG) + @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" +diff -r e04f994581e2 -r be477dd4629d make/bsd/makefiles/saproc.make +--- openjdk/hotspot/make/bsd/makefiles/saproc.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/bsd/makefiles/saproc.make Mon Jan 11 17:16:42 2016 +0000 +@@ -137,6 +137,7 @@ + -o $@ \ + $(SALIBS) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) +@@ -160,6 +161,7 @@ + endif + endif + endif ++endif + + install_saproc: $(BUILDLIBSAPROC) + @echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)" +diff -r e04f994581e2 -r be477dd4629d make/bsd/makefiles/vm.make +--- openjdk/hotspot/make/bsd/makefiles/vm.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/bsd/makefiles/vm.make Mon Jan 11 17:16:42 2016 +0000 +@@ -342,6 +342,7 @@ + } + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) +@@ -365,6 +366,7 @@ + endif + endif + endif ++endif + + DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR) + DEST_JVM = $(DEST_SUBDIR)/$(LIBJVM) +diff -r e04f994581e2 -r be477dd4629d make/linux/makefiles/defs.make +--- openjdk/hotspot/make/linux/makefiles/defs.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/linux/makefiles/defs.make Mon Jan 11 17:16:42 2016 +0000 +@@ -252,12 +252,14 @@ + # client and server subdirectories have symbolic links to ../libjsig.so + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz + else + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + endif + endif ++endif + EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server + EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client + EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal +@@ -266,24 +268,28 @@ + EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz + else + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo + endif + endif ++ endif + endif + + ifeq ($(JVM_VARIANT_CLIENT),true) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz + else + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo + endif + endif ++ endif + endif + + ifeq ($(JVM_VARIANT_MINIMAL1),true) +@@ -291,12 +297,14 @@ + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz + else + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo + endif + endif ++ endif + endif + + # Serviceability Binaries +@@ -308,6 +316,7 @@ + ADD_SA_BINARIES/aarch64 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ + $(EXPORT_LIB_DIR)/sa-jdi.jar + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz +@@ -316,6 +325,7 @@ + ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + endif + endif ++endif + ADD_SA_BINARIES/ppc = + ADD_SA_BINARIES/ia64 = + ADD_SA_BINARIES/arm = +diff -r e04f994581e2 -r be477dd4629d make/linux/makefiles/jsig.make +--- openjdk/hotspot/make/linux/makefiles/jsig.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/linux/makefiles/jsig.make Mon Jan 11 17:16:42 2016 +0000 +@@ -56,8 +56,10 @@ + $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ + $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -66,10 +68,12 @@ + # implied else here is no stripping at all + endif + endif ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) + $(RM) $(LIBJSIG_DEBUGINFO) + endif ++ endif + endif + + install_jsig: $(LIBJSIG) +diff -r e04f994581e2 -r be477dd4629d make/linux/makefiles/saproc.make +--- openjdk/hotspot/make/linux/makefiles/saproc.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/linux/makefiles/saproc.make Mon Jan 11 17:16:42 2016 +0000 +@@ -98,8 +98,10 @@ + -o $@ \ + -lthread_db + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -109,8 +111,10 @@ + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) + $(RM) $(LIBSAPROC_DEBUGINFO) ++ endif + endif + endif + +diff -r e04f994581e2 -r be477dd4629d make/linux/makefiles/vm.make +--- openjdk/hotspot/make/linux/makefiles/vm.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/linux/makefiles/vm.make Mon Jan 11 17:16:42 2016 +0000 +@@ -417,8 +417,10 @@ + } + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -427,10 +429,12 @@ + # implied else here is no stripping at all + endif + endif ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) + $(RM) $(LIBJVM_DEBUGINFO) + endif ++ endif + endif + + DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR) +diff -r e04f994581e2 -r be477dd4629d make/solaris/makefiles/defs.make +--- openjdk/hotspot/make/solaris/makefiles/defs.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/solaris/makefiles/defs.make Mon Jan 11 17:16:42 2016 +0000 +@@ -226,12 +226,14 @@ + # client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz + else + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + endif + endif ++endif + + EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server + EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client +@@ -246,6 +248,7 @@ + EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) + endif + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.diz +@@ -264,6 +267,7 @@ + endif + endif + endif ++ endif + endif + ifeq ($(JVM_VARIANT_CLIENT),true) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt +@@ -275,6 +279,7 @@ + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) + endif + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.diz +@@ -293,10 +298,12 @@ + endif + endif + endif ++ endif + endif + + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + else +diff -r e04f994581e2 -r be477dd4629d make/solaris/makefiles/jsig.make +--- openjdk/hotspot/make/solaris/makefiles/jsig.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/solaris/makefiles/jsig.make Mon Jan 11 17:16:42 2016 +0000 +@@ -52,8 +52,10 @@ + $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ + $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -62,10 +64,12 @@ + # implied else here is no stripping at all + endif + endif ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) + $(RM) $(LIBJSIG_DEBUGINFO) + endif ++ endif + endif + + install_jsig: $(LIBJSIG) +diff -r e04f994581e2 -r be477dd4629d make/solaris/makefiles/saproc.make +--- openjdk/hotspot/make/solaris/makefiles/saproc.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/solaris/makefiles/saproc.make Mon Jan 11 17:16:42 2016 +0000 +@@ -121,8 +121,10 @@ + -c -o $(SADISOBJ) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -132,8 +134,10 @@ + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) + $(RM) $(LIBSAPROC_DEBUGINFO) ++ endif + endif + endif + +diff -r e04f994581e2 -r be477dd4629d make/solaris/makefiles/vm.make +--- openjdk/hotspot/make/solaris/makefiles/vm.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/solaris/makefiles/vm.make Mon Jan 11 17:16:42 2016 +0000 +@@ -307,8 +307,10 @@ + $(QUIETLY) $(LINK_LIB.CXX/POST_HOOK) + $(QUIETLY) rm -f $@.1 && ln -s $@ $@.1 + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ ++ endif + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else +@@ -317,10 +319,12 @@ + # implied else here is no stripping at all + endif + endif ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) + $(RM) $(LIBJVM_DEBUGINFO) + endif ++ endif + endif + endif # filter -sbfast -xsbfast + +diff -r e04f994581e2 -r be477dd4629d make/windows/makefiles/debug.make +--- openjdk/hotspot/make/windows/makefiles/debug.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/windows/makefiles/debug.make Mon Jan 11 17:16:42 2016 +0000 +@@ -60,11 +60,13 @@ + $(MT) /manifest $@.manifest /outputresource:$@;#2 + !endif + !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" ++!if "$(STRIP_POLICY)" != "no_strip" + !if "$(ZIP_DEBUGINFO_FILES)" == "1" + $(ZIPEXE) -q $*.diz $*.map $*.pdb + $(RM) $*.map $*.pdb + !endif + !endif ++!endif + + !include $(WorkSpace)/make/windows/makefiles/shared.make + !include $(WorkSpace)/make/windows/makefiles/sa.make +diff -r e04f994581e2 -r be477dd4629d make/windows/makefiles/defs.make +--- openjdk/hotspot/make/windows/makefiles/defs.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/windows/makefiles/defs.make Mon Jan 11 17:16:42 2016 +0000 +@@ -253,6 +253,7 @@ + EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.diz + else +@@ -260,11 +261,13 @@ + EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map + endif + endif ++ endif + endif + ifeq ($(JVM_VARIANT_CLIENT),true) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.diz + else +@@ -272,6 +275,7 @@ + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map + endif + endif ++ endif + endif + + EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib +@@ -279,6 +283,7 @@ + ifeq ($(BUILD_WIN_SA), 1) + EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX) + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ++ ifneq ($(STRIP_POLICY),no_strip) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.diz + else +@@ -286,6 +291,7 @@ + EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map + endif + endif ++ endif + EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar + # Must pass this down to nmake. + MAKE_ARGS += BUILD_WIN_SA=1 +diff -r e04f994581e2 -r be477dd4629d make/windows/makefiles/fastdebug.make +--- openjdk/hotspot/make/windows/makefiles/fastdebug.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/windows/makefiles/fastdebug.make Mon Jan 11 17:16:42 2016 +0000 +@@ -59,11 +59,13 @@ + $(MT) /manifest $@.manifest /outputresource:$@;#2 + !endif + !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" ++!if "$(STRIP_POLICY)" != "no_strip" + !if "$(ZIP_DEBUGINFO_FILES)" == "1" + $(ZIPEXE) -q $*.diz $*.map $*.pdb + $(RM) $*.map $*.pdb + !endif + !endif ++!endif + + !include $(WorkSpace)/make/windows/makefiles/shared.make + !include $(WorkSpace)/make/windows/makefiles/sa.make +diff -r e04f994581e2 -r be477dd4629d make/windows/makefiles/product.make +--- openjdk/hotspot/make/windows/makefiles/product.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/windows/makefiles/product.make Mon Jan 11 17:16:42 2016 +0000 +@@ -62,11 +62,13 @@ + $(MT) /manifest $@.manifest /outputresource:$@;#2 + !endif + !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" ++!if "$(STRIP_POLICY)" != "no_strip" + !if "$(ZIP_DEBUGINFO_FILES)" == "1" + $(ZIPEXE) -q $*.diz $*.map $*.pdb + $(RM) $*.map $*.pdb + !endif + !endif ++!endif + + !include $(WorkSpace)/make/windows/makefiles/shared.make + !include $(WorkSpace)/make/windows/makefiles/sa.make +diff -r e04f994581e2 -r be477dd4629d make/windows/makefiles/sa.make +--- openjdk/hotspot/make/windows/makefiles/sa.make Tue Dec 08 03:10:43 2015 +0000 ++++ openjdk/hotspot/make/windows/makefiles/sa.make Mon Jan 11 17:16:42 2016 +0000 +@@ -152,11 +152,13 @@ + $(MT) -manifest $(@F).manifest -outputresource:$(@F);#2 + !endif + !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" ++!if "$(STRIP_POLICY)" != "no_strip" + !if "$(ZIP_DEBUGINFO_FILES)" == "1" + $(ZIPEXE) -q $*.diz $*.map $*.pdb + $(RM) $*.map $*.pdb + !endif + !endif ++!endif + -@rm -f $*.obj + + cleanall :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/pr1748.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,73 @@ +# HG changeset patch +# User andrew +# Date 1398284109 -3600 +# Wed Apr 23 21:15:09 2014 +0100 +# Node ID a8b6c290873cc30d96137bd29724638600317f92 +# Parent 5e956adabf368a0f3292ce5b9ee79db79bfe92f2 +PR1748: Allow clang to be used to build + +diff -r 5e956adabf36 -r a8b6c290873c make/linux/makefiles/gcc.make +--- openjdk/hotspot/make/linux/makefiles/gcc.make Tue Apr 22 19:50:45 2014 +0100 ++++ openjdk/hotspot/make/linux/makefiles/gcc.make Wed Apr 23 21:15:09 2014 +0100 +@@ -212,7 +212,7 @@ + WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses + WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare + WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess +- WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body ++ WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body -Qunused-arguments -Wno-uninitialized + endif + + WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value +diff -r 5e956adabf36 -r a8b6c290873c src/cpu/x86/vm/templateTable_x86_64.cpp +--- openjdk/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Tue Apr 22 19:50:45 2014 +0100 ++++ openjdk/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Wed Apr 23 21:15:09 2014 +0100 +@@ -107,10 +107,6 @@ + return Address(rsp, Interpreter::expr_offset_in_bytes(2)); + } + +-static inline Address at_tos_p3() { +- return Address(rsp, Interpreter::expr_offset_in_bytes(3)); +-} +- + // Condition conversion + static Assembler::Condition j_not(TemplateTable::Condition cc) { + switch (cc) { +diff -r 5e956adabf36 -r a8b6c290873c src/share/vm/prims/jvmtiTagMap.cpp +--- openjdk/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Tue Apr 22 19:50:45 2014 +0100 ++++ openjdk/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Wed Apr 23 21:15:09 2014 +0100 +@@ -2791,6 +2791,7 @@ + } + + // verify that a static oop field is in range ++#ifdef ASSERT + static inline bool verify_static_oop(InstanceKlass* ik, + oop mirror, int offset) { + address obj_p = (address)mirror + offset; +@@ -2804,6 +2805,7 @@ + return false; + } + } ++#endif + + // a class references its super class, interfaces, class loader, ... + // and finally its static fields +diff -r 5e956adabf36 -r a8b6c290873c src/share/vm/runtime/mutex.cpp +--- openjdk/hotspot/src/share/vm/runtime/mutex.cpp Tue Apr 22 19:50:45 2014 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/mutex.cpp Wed Apr 23 21:15:09 2014 +0100 +@@ -280,16 +280,6 @@ + return x & 0x7FFFFFFF ; + } + +-static inline jint MarsagliaXOR (jint * const a) { +- jint x = *a ; +- if (x == 0) x = UNS(a)|1 ; +- x ^= x << 6; +- x ^= ((unsigned)x) >> 21; +- x ^= x << 7 ; +- *a = x ; +- return x & 0x7FFFFFFF ; +-} +- + static int Stall (int its) { + static volatile jint rv = 1 ; + volatile int OnFrame = 0 ;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/pr1869.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,33 @@ +# HG changeset patch +# User andrew +# Date 1405461315 -3600 +# Tue Jul 15 22:55:15 2014 +0100 +# Node ID 967ae4d849eb20b4b63c399bc3f376dfc0f9d2cc +# Parent 84854c983fd81cf1a1598f8c069a2db010abc05c +PR1869: Avoid x86 workaround when running Zero rather than a JIT +Contributed-by: Matthias Klose <doko@ubuntu.com> + +diff -r 84854c983fd8 -r 967ae4d849eb src/os/linux/vm/os_linux.cpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp Wed May 27 15:22:21 2015 +0100 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp Tue Jul 15 22:55:15 2014 +0100 +@@ -4861,7 +4861,7 @@ + + Linux::capture_initial_stack(JavaThread::stack_size_at_create()); + +-#if defined(IA32) ++#if defined(IA32) && !defined(ZERO) + workaround_expand_exec_shield_cs_limit(); + #endif + +diff -r 84854c983fd8 -r 967ae4d849eb src/os_cpu/linux_x86/vm/os_linux_x86.cpp +--- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed May 27 15:22:21 2015 +0100 ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Tue Jul 15 22:55:15 2014 +0100 +@@ -890,7 +890,7 @@ + * updates (JDK-8023956). + */ + void os::workaround_expand_exec_shield_cs_limit() { +-#if defined(IA32) ++#if defined(IA32) && !defined(ZERO) + size_t page_size = os::vm_page_size(); + /* + * Take the highest VA the OS will give us and exec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/pr1942.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,80 @@ +# HG changeset patch +# User andrew +# Date 1408661670 -3600 +# Thu Aug 21 23:54:30 2014 +0100 +# Node ID 877471da7fbbe69d029b990b77a70e7fcf3d02ed +# Parent 22d29c372fc4271930e4169a66818f67e27cf6e8 +PR1942: Bug reports lack IcedTea version & distribution packaging information + +diff -Nru openjdk.orig/hotspot/make/linux/makefiles/buildtree.make openjdk/hotspot/make/linux/makefiles/buildtree.make +--- openjdk.orig/hotspot/make/linux/makefiles/buildtree.make 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/make/linux/makefiles/buildtree.make 2016-07-21 04:02:40.321948126 +0100 +@@ -221,6 +221,8 @@ + echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \ + echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ + echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ ++ echo "DERIVATIVE_ID = $(DERIVATIVE_ID)"; \ ++ echo "DISTRIBUTION_ID = $(DISTRIBUTION_ID)"; \ + echo "OPENJDK = $(OPENJDK)"; \ + echo "$(LP64_SETTING/$(DATA_MODE))"; \ + echo; \ +diff -Nru openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make +--- openjdk.orig/hotspot/make/linux/makefiles/vm.make 2016-07-21 03:58:43.517786089 +0100 ++++ openjdk/hotspot/make/linux/makefiles/vm.make 2016-07-21 04:03:18.853320721 +0100 +@@ -91,11 +91,11 @@ + VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" + + ifdef DERIVATIVE_ID +-CPPFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\"" ++CXXFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\"" + endif + + ifdef DISTRIBUTION_ID +-CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\"" ++CXXFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\"" + endif + + CXXFLAGS = \ +diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/vm.make openjdk/hotspot/make/solaris/makefiles/vm.make +--- openjdk.orig/hotspot/make/solaris/makefiles/vm.make 2016-07-21 03:58:43.973778706 +0100 ++++ openjdk/hotspot/make/solaris/makefiles/vm.make 2016-07-21 04:04:14.804409599 +0100 +@@ -85,6 +85,10 @@ + ${HS_LIB_ARCH} \ + ${VM_DISTRO} + ++ifdef DERIVATIVE_ID ++CXXFLAGS += -DDERIVATIVE_ID="\"$(DERIVATIVE_ID)\"" ++endif ++ + # This is VERY important! The version define must only be supplied to vm_version.o + # If not, ccache will not re-use the cache at all, since the version string might contain + # a time and date. +@@ -100,6 +104,10 @@ + CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 + endif # ifneq ($(LP64), 1) + ++ifdef DISTRIBUTION_ID ++CXXFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\"" ++endif ++ + # CFLAGS_WARN holds compiler options to suppress/enable warnings. + CFLAGS += $(CFLAGS_WARN) + +diff -Nru openjdk.orig/hotspot/make/windows/makefiles/vm.make openjdk/hotspot/make/windows/makefiles/vm.make +--- openjdk.orig/hotspot/make/windows/makefiles/vm.make 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/make/windows/makefiles/vm.make 2016-07-21 04:04:46.347895899 +0100 +@@ -67,6 +67,14 @@ + # Define that so jni.h is on correct side + CXX_FLAGS=$(CXX_FLAGS) /D "_JNI_IMPLEMENTATION_" + ++!ifdef DERIVATIVE_ID ++CXX_FLAGS = $(CPP_FLAGS) /D "DERIVATIVE_ID=\"$(DERIVATIVE_ID)\"" ++!endif ++ ++!ifdef DISTRIBUTION_ID ++CXX_FLAGS = $(CPP_FLAGS) /D "DISTRIBUTION_ID=\"$(DISTRIBUTION_ID)\"" ++!endif ++ + !if "$(BUILDARCH)" == "ia64" + STACK_SIZE="/STACK:1048576,262144" + !else
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/pr1975.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,397 @@ +# HG changeset patch +# User andrew +# Date 1433440378 -3600 +# Thu Jun 04 18:52:58 2015 +0100 +# Node ID 74654e3651a912ce5b8d61a2604e78264b13eace +# Parent 9b0cf2504591dc6d53765cb4e987651027ee7650 +PR1975: SystemTap probes for the garbage collector. +Contributed-by: Lukas Berk <lberk@redhat.com> + +diff -Nru openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp openjdk/hotspot/src/share/vm/compiler/oopMap.cpp +--- openjdk.orig/hotspot/src/share/vm/compiler/oopMap.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/compiler/oopMap.cpp 2016-07-21 04:08:08.504603049 +0100 +@@ -33,9 +33,13 @@ + #include "memory/resourceArea.hpp" + #include "runtime/frame.inline.hpp" + #include "runtime/signature.hpp" ++#include "utilities/dtrace.hpp" + #ifdef COMPILER1 + #include "c1/c1_Defs.hpp" + #endif ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL1(provider, gc__collection__delete, *uintptr_t); ++#endif /* !USDT2 */ + + // OopMapStream + +@@ -664,6 +668,9 @@ + " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: " INTX_FORMAT ")", + p2i(derived_loc), p2i((address)*derived_loc), p2i((address)base), offset); + } ++#ifndef USDT2 ++ HS_DTRACE_PROBE1(hotspot, gc__collection__delete, entry); ++#endif /* !USDT2 */ + + // Delete entry + delete entry; +diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -63,6 +63,12 @@ + #include "runtime/vmThread.hpp" + #include "services/memoryService.hpp" + #include "services/runtimeService.hpp" ++#include "utilities/dtrace.hpp" ++ ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool); ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool); ++#endif /* !USDT2 */ + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + +@@ -1674,7 +1680,13 @@ + size_t size, + bool tlab) + { ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, tlab); ++#endif /* !USDT2 */ + collector()->collect(full, clear_all_soft_refs, size, tlab); ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, tlab); ++#endif /* !USDT2 */ + } + + void CMSCollector::collect(bool full, +diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -51,8 +51,13 @@ + #include "runtime/thread.hpp" + #include "runtime/vmThread.hpp" + #include "utilities/copy.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/events.hpp" + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__begin, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__G1__end, *uintptr_t, *uintptr_t); ++ #endif /* !USDT2 */ + class HeapRegion; + + void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, +@@ -86,6 +91,9 @@ + // The marking doesn't preserve the marks of biased objects. + BiasedLocking::preserve_marks(); + ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__G1__begin, &sh, sh->gc_cause()); ++#endif /* !USDT2 */ + mark_sweep_phase1(marked_for_unloading, clear_all_softrefs); + + mark_sweep_phase2(); +@@ -101,6 +109,9 @@ + BiasedLocking::restore_marks(); + GenMarkSweep::deallocate_stacks(); + ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__G1__end, &sh, sh->gc_cause()); ++#endif /* !USDT2 */ + // "free at last gc" is calculated from these. + // CHF: cheating for now!!! + // Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity()); +diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -43,8 +43,14 @@ + #include "runtime/java.hpp" + #include "runtime/vmThread.hpp" + #include "services/memTracker.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/vmError.hpp" + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge__heap__begin, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__parscavenge__heap__end, *uintptr_t, *uintptr_t); ++#endif /* !USDT2 */ ++ + PSYoungGen* ParallelScavengeHeap::_young_gen = NULL; + PSOldGen* ParallelScavengeHeap::_old_gen = NULL; + PSAdaptiveSizePolicy* ParallelScavengeHeap::_size_policy = NULL; +@@ -531,7 +537,13 @@ + } + + VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge__heap__begin, &op, cause); ++#endif /* !USDT2 */ + VMThread::execute(&op); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__parscavenge__heap__end, &op, cause); ++#endif /* !USDT2 */ + } + + void ParallelScavengeHeap::oop_iterate(ExtendedOopClosure* cl) { +diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -56,6 +56,7 @@ + #include "services/management.hpp" + #include "services/memoryService.hpp" + #include "services/memTracker.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/events.hpp" + #include "utilities/stack.inline.hpp" + +@@ -63,6 +64,12 @@ + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__ParallelCompact__clear, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__parallel__collect, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__move, *uintptr_t, *uintptr_t, *uintptr_t, *uintptr_t); ++#endif /* !USDT2 */ ++ + // All sizes are in HeapWords. + const size_t ParallelCompactData::Log2RegionSize = 16; // 64K words + const size_t ParallelCompactData::RegionSize = (size_t)1 << Log2RegionSize; +@@ -453,6 +460,9 @@ + + void ParallelCompactData::clear() + { ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__ParallelCompact__clear, &_region_data, _region_data->data_location()); ++#endif /* !USDT2 */ + memset(_region_data, 0, _region_vspace->committed_size()); + memset(_block_data, 0, _block_vspace->committed_size()); + } +@@ -1978,6 +1988,9 @@ + "should be in vm thread"); + + ParallelScavengeHeap* heap = gc_heap(); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__parallel__collect, heap, heap->gc_cause()); ++#endif /* !USDT2 */ + GCCause::Cause gc_cause = heap->gc_cause(); + assert(!heap->is_gc_active(), "not reentrant"); + +@@ -3269,6 +3282,9 @@ + // past the end of the partial object entering the region (if any). + HeapWord* const dest_addr = sd.partial_obj_end(dp_region); + HeapWord* const new_top = _space_info[space_id].new_top(); ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__move, &beg_addr, &end_addr, &dest_addr, &new_top); ++#endif /* !USDT2 */ + assert(new_top >= dest_addr, "bad new_top value"); + const size_t words = pointer_delta(new_top, dest_addr); + +diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -54,10 +54,20 @@ + #include "runtime/vmThread.hpp" + #include "runtime/vm_operations.hpp" + #include "services/memoryService.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/stack.inline.hpp" + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__begin, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSScavenge__end, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__begin, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSParallelCompact__end, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__begin, *uintptr_t, *uintptr_t); ++ HS_DTRACE_PROBE_DECL2(provider, gc__collection__PSMarkSweep__end, *uintptr_t, *uintptr_t); ++#endif /* !USDT2 */ ++ + HeapWord* PSScavenge::_to_space_top_before_gc = NULL; + int PSScavenge::_consecutive_skipped_scavenges = 0; + ReferenceProcessor* PSScavenge::_ref_processor = NULL; +@@ -229,7 +239,13 @@ + PSAdaptiveSizePolicy* policy = heap->size_policy(); + IsGCActiveMark mark; + ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__begin, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + const bool scavenge_done = PSScavenge::invoke_no_policy(); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSScavenge__end, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + const bool need_full_gc = !scavenge_done || + policy->should_full_GC(heap->old_gen()->free_in_bytes()); + bool full_gc_done = false; +@@ -246,9 +262,21 @@ + const bool clear_all_softrefs = cp->should_clear_all_soft_refs(); + + if (UseParallelOldGC) { ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__begin, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSParallelCompact__end, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + } else { ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__begin, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs); ++#ifndef USDT2 ++ HS_DTRACE_PROBE2(hotspot, gc__collection__PSMarkSweep__end, &heap, heap->gc_cause()); ++#endif /* !USDT2 */ + } + } + +diff -Nru openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +--- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -54,6 +54,12 @@ + #include "utilities/copy.hpp" + #include "utilities/globalDefinitions.hpp" + #include "utilities/workgroup.hpp" ++#include "utilities/dtrace.hpp" ++ ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__begin, bool, bool, size_t, bool); ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__parnew__end, bool, bool, size_t, bool); ++#endif /* !USDT2 */ + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + +@@ -914,6 +920,9 @@ + bool clear_all_soft_refs, + size_t size, + bool is_tlab) { ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__begin, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ + assert(full || size > 0, "otherwise we don't want to collect"); + + GenCollectedHeap* gch = GenCollectedHeap::heap(); +@@ -1064,6 +1073,10 @@ + gch->print_heap_change(gch_prev_used); + } + ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__parnew__end, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ ++ + if (PrintGCDetails && ParallelGCVerbose) { + TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats()); + TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats()); +diff -Nru openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp +--- openjdk.orig/hotspot/src/share/vm/memory/defNewGeneration.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -45,10 +45,16 @@ + #include "runtime/prefetch.inline.hpp" + #include "runtime/thread.inline.hpp" + #include "utilities/copy.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/stack.inline.hpp" + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__begin, bool, bool, size_t, bool); ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__defnew__end, bool, bool, size_t, bool); ++#endif /* !USDT2 */ ++ + // + // DefNewGeneration functions. + +@@ -561,6 +567,9 @@ + bool clear_all_soft_refs, + size_t size, + bool is_tlab) { ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__begin, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ + assert(full || size > 0, "otherwise we don't want to collect"); + + GenCollectedHeap* gch = GenCollectedHeap::heap(); +@@ -709,6 +718,10 @@ + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; + update_time_of_last_gc(now); + ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__defnew__end, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ ++ + gch->trace_heap_after_gc(&gc_tracer); + gc_tracer.report_tenuring_threshold(tenuring_threshold()); + +diff -Nru openjdk.orig/hotspot/src/share/vm/memory/generation.cpp openjdk/hotspot/src/share/vm/memory/generation.cpp +--- openjdk.orig/hotspot/src/share/vm/memory/generation.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/memory/generation.cpp 2016-07-21 04:08:08.508602985 +0100 +@@ -41,10 +41,16 @@ + #include "oops/oop.inline.hpp" + #include "runtime/java.hpp" + #include "utilities/copy.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/events.hpp" + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__begin, bool, bool, size_t, bool); ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__contig__end, bool, bool, size_t, bool); ++#endif /* !USDT2 */ ++ + Generation::Generation(ReservedSpace rs, size_t initial_size, int level) : + _level(level), + _ref_processor(NULL) { +@@ -636,7 +642,13 @@ + SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer(); + gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start()); + ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__contig__begin, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ + GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs); ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__contig__end, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ + + gc_timer->register_gc_end(); + +diff -Nru openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp +--- openjdk.orig/hotspot/src/share/vm/memory/tenuredGeneration.cpp 2016-05-12 21:03:31.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/memory/tenuredGeneration.cpp 2016-07-21 04:08:38.520114048 +0100 +@@ -32,11 +32,17 @@ + #include "memory/tenuredGeneration.hpp" + #include "oops/oop.inline.hpp" + #include "runtime/java.hpp" ++#include "utilities/dtrace.hpp" + #include "utilities/macros.hpp" + #if INCLUDE_ALL_GCS + #include "gc_implementation/shared/parGCAllocBuffer.hpp" + #endif + ++#ifndef USDT2 ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__begin, bool, bool, size_t, bool); ++ HS_DTRACE_PROBE_DECL4(provider, gc__collection__tenured__end, bool, bool, size_t, bool); ++#endif /* !USDT2 */ ++ + TenuredGeneration::TenuredGeneration(ReservedSpace rs, + size_t initial_byte_size, int level, + GenRemSet* remset) : +@@ -154,8 +160,14 @@ + size_t size, + bool is_tlab) { + retire_alloc_buffers_before_full_gc(); ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__begin, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ + OneContigSpaceCardGeneration::collect(full, clear_all_soft_refs, + size, is_tlab); ++#ifndef USDT2 ++ HS_DTRACE_PROBE4(hotspot, gc__collection__tenured__end, full, clear_all_soft_refs, size, is_tlab); ++#endif /* !USDT2 */ + } + + void TenuredGeneration::compute_new_size() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/pr2777.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,299 @@ +# HG changeset patch +# User andrew +# Date 1453949410 0 +# Thu Jan 28 02:50:10 2016 +0000 +# Node ID c313c4782bb33aa4ea49f1342c54b3138af418a1 +# Parent be477dd4629d2155bde02047cc81ca4f8b657a49 +PR2777: Fix MAX/MIN template usage on s390 +Summary: The templates can't be used without casting on s390 as size_t != uintx + +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -2659,7 +2659,7 @@ + if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { + size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks); + n_blks += CMSOldPLABReactivityFactor*multiple*n_blks; +- n_blks = MIN2(n_blks, CMSOldPLABMax); ++ n_blks = MIN2(n_blks, (size_t) CMSOldPLABMax); + } + assert(n_blks > 0, "Error"); + _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl); +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -963,7 +963,7 @@ + if (free_percentage < desired_free_percentage) { + size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); + assert(desired_capacity >= capacity(), "invalid expansion size"); +- size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes); ++ size_t expand_bytes = MAX2(desired_capacity - capacity(), (size_t) MinHeapDeltaBytes); + if (PrintGCDetails && Verbose) { + size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); + gclog_or_tty->print_cr("\nFrom compute_new_size: "); +@@ -6589,7 +6589,7 @@ + HeapWord* curAddr = _markBitMap.startWord(); + while (curAddr < _markBitMap.endWord()) { + size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr); +- MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining)); ++ MemRegion chunk(curAddr, MIN2((size_t) CMSBitMapYieldQuantum, remaining)); + _markBitMap.clear_large_range(chunk); + if (ConcurrentMarkSweepThread::should_yield() && + !foregroundGCIsActive() && +@@ -6887,7 +6887,7 @@ + return; + } + // Double capacity if possible +- size_t new_capacity = MIN2(_capacity*2, MarkStackSizeMax); ++ size_t new_capacity = MIN2(_capacity*2, (size_t) MarkStackSizeMax); + // Do not give up existing stack until we have managed to + // get the double capacity that we desired. + ReservedSpace rs(ReservedSpace::allocation_align_size_up( +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/g1/concurrentMark.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -3903,7 +3903,7 @@ + // of things to do) or totally (at the very end). + size_t target_size; + if (partially) { +- target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize); ++ target_size = MIN2((size_t)_task_queue->max_elems()/3, (size_t) GCDrainStackTargetSize); + } else { + target_size = 0; + } +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -1726,7 +1726,7 @@ + + verify_region_sets_optional(); + +- size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); ++ size_t expand_bytes = MAX2(word_size * HeapWordSize, (size_t) MinHeapDeltaBytes); + ergo_verbose1(ErgoHeapSizing, + "attempt heap expansion", + ergo_format_reason("allocation request failed") +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp Thu Jan 28 02:50:10 2016 +0000 +@@ -89,7 +89,7 @@ + void pretouch_internal(size_t start_page, size_t end_page); + + // Returns the index of the page which contains the given address. +- uintptr_t addr_to_page_index(char* addr) const; ++ size_t addr_to_page_index(char* addr) const; + // Returns the address of the given page index. + char* page_start(size_t index) const; + +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -38,7 +38,7 @@ + _cancel(false), + _empty(true), + _dropped(0) { +- _nqueues = MAX2(ParallelGCThreads, (size_t)1); ++ _nqueues = MAX2((size_t) ParallelGCThreads, (size_t)1); + _queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC); + for (size_t i = 0; i < _nqueues; i++) { + new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size); +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -110,7 +110,7 @@ + }; + + G1StringDedupEntryCache::G1StringDedupEntryCache() { +- _nlists = MAX2(ParallelGCThreads, (size_t)1); ++ _nlists = MAX2((size_t) ParallelGCThreads, (size_t)1); + _lists = PaddedArray<G1StringDedupEntryFreeList, mtGC>::create_unfreeable((uint)_nlists); + } + +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/g1/heapRegion.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -108,7 +108,7 @@ + uintx region_size = G1HeapRegionSize; + if (FLAG_IS_DEFAULT(G1HeapRegionSize)) { + size_t average_heap_size = (initial_heap_size + max_heap_size) / 2; +- region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(), ++ region_size = MAX2((uintx) (average_heap_size / HeapRegionBounds::target_number()), + (uintx) HeapRegionBounds::min_size()); + } + +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -200,7 +200,7 @@ + const size_t num_overflow_elems = of_stack->size(); + const size_t space_available = queue->max_elems() - queue->size(); + const size_t num_take_elems = MIN3(space_available / 4, +- ParGCDesiredObjsFromOverflowList, ++ (size_t) ParGCDesiredObjsFromOverflowList, + num_overflow_elems); + // Transfer the most recent num_take_elems from the overflow + // stack to our work queue. +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +--- openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -920,8 +920,8 @@ + void PSParallelCompact::initialize_dead_wood_limiter() + { + const size_t max = 100; +- _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0; +- _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0; ++ _dwl_mean = double(MIN2((size_t) ParallelOldDeadWoodLimiterMean, max)) / 100.0; ++ _dwl_std_dev = double(MIN2((size_t) ParallelOldDeadWoodLimiterStdDev, max)) / 100.0; + _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev); + DEBUG_ONLY(_dwl_initialized = true;) + _dwl_adjustment = normal_distribution(1.0); +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/memory/collectorPolicy.cpp +--- openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -385,7 +385,7 @@ + uintx calculated_size = NewSize + OldSize; + double shrink_factor = (double) MaxHeapSize / calculated_size; + uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment); +- FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size)); ++ FLAG_SET_ERGO(uintx, NewSize, MAX2((uintx) young_gen_size_lower_bound(), smaller_new_size)); + _initial_gen0_size = NewSize; + + // OldSize is already aligned because above we aligned MaxHeapSize to +@@ -423,7 +423,7 @@ + + // Determine maximum size of gen0 + +- size_t max_new_size = 0; ++ uintx max_new_size = 0; + if (!FLAG_IS_DEFAULT(MaxNewSize)) { + max_new_size = MaxNewSize; + } else { +@@ -448,7 +448,7 @@ + _initial_gen0_size = max_new_size; + _max_gen0_size = max_new_size; + } else { +- size_t desired_new_size = 0; ++ uintx desired_new_size = 0; + if (FLAG_IS_CMDLINE(NewSize)) { + // If NewSize is set on the command line, we must use it as + // the initial size and it also makes sense to use it as the +@@ -461,7 +461,7 @@ + // limit, but use NewRatio to calculate the initial size. + _min_gen0_size = NewSize; + desired_new_size = +- MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize); ++ MAX2((uintx) (scale_by_NewRatio_aligned(_initial_heap_byte_size)), NewSize); + max_new_size = MAX2(max_new_size, NewSize); + } else { + // For the case where NewSize is the default, use NewRatio +@@ -469,9 +469,9 @@ + // Use the default NewSize as the floor for these values. If + // NewRatio is overly large, the resulting sizes can be too + // small. +- _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), NewSize); ++ _min_gen0_size = MAX2((uintx) (scale_by_NewRatio_aligned(_min_heap_byte_size)), NewSize); + desired_new_size = +- MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize); ++ MAX2((uintx) (scale_by_NewRatio_aligned(_initial_heap_byte_size)), NewSize); + } + + assert(_min_gen0_size > 0, "Sanity check"); +@@ -573,7 +573,7 @@ + } else { + // It's been explicitly set on the command line. Use the + // OldSize and then determine the consequences. +- _min_gen1_size = MIN2(OldSize, _min_heap_byte_size - _min_gen0_size); ++ _min_gen1_size = MIN2(OldSize, (uintx) (_min_heap_byte_size - _min_gen0_size)); + _initial_gen1_size = OldSize; + + // If the user has explicitly set an OldSize that is inconsistent +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/memory/metaspace.cpp +--- openjdk/hotspot/src/share/vm/memory/metaspace.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/memory/metaspace.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -1455,7 +1455,7 @@ + + void MetaspaceGC::post_initialize() { + // Reset the high-water mark once the VM initialization is done. +- _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize); ++ _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), (size_t) MetaspaceSize); + } + + bool MetaspaceGC::can_expand(size_t word_size, bool is_class) { +@@ -1515,7 +1515,7 @@ + (size_t)MIN2(min_tmp, double(max_uintx)); + // Don't shrink less than the initial generation size + minimum_desired_capacity = MAX2(minimum_desired_capacity, +- MetaspaceSize); ++ (size_t) MetaspaceSize); + + if (PrintGCDetails && Verbose) { + gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: "); +@@ -1573,7 +1573,7 @@ + const double max_tmp = used_after_gc / minimum_used_percentage; + size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); + maximum_desired_capacity = MAX2(maximum_desired_capacity, +- MetaspaceSize); ++ (size_t) MetaspaceSize); + if (PrintGCDetails && Verbose) { + gclog_or_tty->print_cr(" " + " maximum_free_percentage: %6.2f" +@@ -3285,7 +3285,7 @@ + // on the medium chunk list. The next chunk will be small and progress + // from there. This size calculated by -version. + _first_class_chunk_word_size = MIN2((size_t)MediumChunk*6, +- (CompressedClassSpaceSize/BytesPerWord)*2); ++ (size_t) ((CompressedClassSpaceSize/BytesPerWord)*2)); + _first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size); + // Arbitrarily set the initial virtual space to a multiple + // of the boot class loader size. +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/oops/objArrayKlass.inline.hpp +--- openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp Thu Jan 28 02:50:10 2016 +0000 +@@ -48,7 +48,7 @@ + const size_t beg_index = size_t(index); + assert(beg_index < len || len == 0, "index too large"); + +- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); ++ const size_t stride = MIN2(len - beg_index, (size_t) ObjArrayMarkingStride); + const size_t end_index = beg_index + stride; + T* const base = (T*)a->base(); + T* const beg = base + beg_index; +@@ -82,7 +82,7 @@ + const size_t beg_index = size_t(index); + assert(beg_index < len || len == 0, "index too large"); + +- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); ++ const size_t stride = MIN2(len - beg_index, (size_t) ObjArrayMarkingStride); + const size_t end_index = beg_index + stride; + T* const base = (T*)a->base(); + T* const beg = base + beg_index; +diff -r be477dd4629d -r c313c4782bb3 src/share/vm/runtime/arguments.cpp +--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp Mon Jan 11 17:16:42 2016 +0000 ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp Thu Jan 28 02:50:10 2016 +0000 +@@ -1264,7 +1264,7 @@ + (ParallelGCThreads == 0 ? 1 : ParallelGCThreads); + const size_t preferred_max_new_size_unaligned = + MIN2(max_heap/(NewRatio+1), ScaleForWordSize(young_gen_per_worker * parallel_gc_threads)); +- size_t preferred_max_new_size = ++ uintx preferred_max_new_size = (uintx) + align_size_up(preferred_max_new_size_unaligned, os::vm_page_size()); + + // Unless explicitly requested otherwise, size young gen +@@ -1295,7 +1295,7 @@ + " max_heap: " SIZE_FORMAT, + min_heap_size(), InitialHeapSize, max_heap); + } +- size_t min_new = preferred_max_new_size; ++ uintx min_new = preferred_max_new_size; + if (FLAG_IS_CMDLINE(NewSize)) { + min_new = NewSize; + } +@@ -1314,7 +1314,7 @@ + // so it's NewRatio x of NewSize. + if (FLAG_IS_DEFAULT(OldSize)) { + if (max_heap > NewSize) { +- FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize)); ++ FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, (uintx) (max_heap - NewSize))); + if (PrintGCDetails && Verbose) { + // Too early to use gclog_or_tty + tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/shenandoah/werror.patch Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,51 @@ +# HG changeset patch +# User andrew +# Date 1408489026 -3600 +# Tue Aug 19 23:57:06 2014 +0100 +# Node ID 22d29c372fc4271930e4169a66818f67e27cf6e8 +# Parent c75d6ce2e98b901b31ac84dbbb59667e03beb9d5 +Merge jdk8u20-b23 + +diff -r c75d6ce2e98b -r 22d29c372fc4 make/linux/makefiles/gcc.make +--- openjdk/hotspot/make/linux/makefiles/gcc.make Tue Aug 19 22:31:00 2014 +0100 ++++ openjdk/hotspot/make/linux/makefiles/gcc.make Tue Aug 19 23:57:06 2014 +0100 +@@ -206,7 +206,9 @@ + endif + + # Compiler warnings are treated as errors ++ifneq ($(COMPILER_WARNINGS_FATAL),false) + WARNINGS_ARE_ERRORS = -Werror ++endif + + ifeq ($(USE_CLANG), true) + # However we need to clean the code up before we can unrestrictedly enable this option with Clang +diff -r c75d6ce2e98b -r 22d29c372fc4 make/solaris/makefiles/adlc.make +--- openjdk/hotspot/make/solaris/makefiles/adlc.make Tue Aug 19 22:31:00 2014 +0100 ++++ openjdk/hotspot/make/solaris/makefiles/adlc.make Tue Aug 19 23:57:06 2014 +0100 +@@ -73,8 +73,10 @@ + + # CFLAGS_WARN holds compiler options to suppress/enable warnings. + # Compiler warnings are treated as errors +-ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) +- CFLAGS_WARN = +w -errwarn ++ifneq ($(COMPILER_WARNINGS_FATAL),false) ++ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) ++ CFLAGS_WARN = +w -errwarn ++ endif + endif + CFLAGS += $(CFLAGS_WARN) + +diff -r c75d6ce2e98b -r 22d29c372fc4 make/solaris/makefiles/gcc.make +--- openjdk/hotspot/make/solaris/makefiles/gcc.make Tue Aug 19 22:31:00 2014 +0100 ++++ openjdk/hotspot/make/solaris/makefiles/gcc.make Tue Aug 19 23:57:06 2014 +0100 +@@ -116,7 +116,9 @@ + + + # Compiler warnings are treated as errors +-WARNINGS_ARE_ERRORS = -Werror ++ifneq ($(COMPILER_WARNINGS_FATAL),false) ++WARNINGS_ARE_ERRORS = -Werror ++endif + # Enable these warnings. See 'info gcc' about details on these options + WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef + CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/create_tarballs.sh Thu Jul 21 22:45:04 2016 +0100 @@ -0,0 +1,121 @@ +#!/bin/bash + +# Copyright (C) 2016 Red Hat, Inc. +# Written by Andrew John Hughes <gnu.andrew@redhat.com>. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +CHECKOUT_DIR=$1 +DOWNLOAD_DIR=$2 +TAG=$3 +HOTSPOT=$4 +RUNNING_DIR=$(dirname $0) +DOWNLOAD_URL=http://icedtea.classpath.org/download/drops + +echo "PWD: $PWD" +echo "DOWNLOAD URL: ${DOWNLOAD_URL}" + +if [ $(echo $0|grep '8$') ]; then + echo "Assuming OpenJDK 8 and later"; + OPENJDK8=true; + NASHORN=nashorn; + CTYPE=xz +else + echo "Assuming OpenJDK 7 and earlier"; + OPENJDK8=false; + CTYPE=bz2 +fi +echo "COMPRESSION TYPE: ${CTYPE}" + +if test "x$CHECKOUT_DIR" = "x"; then + echo "ERROR: Checkout directory must be specified"; + echo "$0 <CHECKOUT_DIR> <DOWNLOAD_DIR> <TAG>" + exit -1; +fi + +if test "x$DOWNLOAD_DIR" = "x"; then + if test "x$OPENJDK8" = "xfalse"; then + DOWNLOAD_DIR=/home/downloads/java/drops/icedtea7 ; + else + DOWNLOAD_DIR=/home/downloads/java/drops/icedtea8 ; + fi +fi + +if test "x$TAG" = "x"; then + TAG=tip ; +elif echo ${TAG}|grep '^icedtea' ; then + if test "x$CHECKOUT_DIR" = "x"; then + echo "No checkout directory found."; + exit -1; + fi +fi + +if test "x$HOTSPOT" = "x" -o "x$HOTSPOT" = "xdefault"; then + HOTSPOT=default; + ARCHIVED_REPOS=". corba jaxp jaxws langtools hotspot jdk $NASHORN" +else + ARCHIVED_REPOS=${HOTSPOT} + echo "Only archiving HotSpot tree as ${HOTSPOT}" +fi + +echo "TAG = $TAG"; +echo "Creating new tarballs in $DOWNLOAD_DIR" +echo "Using checkout directory $CHECKOUT_DIR" +echo "Using HotSpot archive: $HOTSPOT" +URL=$(hg -R ${CHECKOUT_DIR} paths default) +echo "Upstream URL is ${URL}" +pushd $DOWNLOAD_DIR +echo "Compiling tarballs for ${ARCHIVED_REPOS}" +for repos in ${ARCHIVED_REPOS}; +do + DIRNAME=${repos} + if test "x$repos" = "x."; then + FILENAME=openjdk; + PREFIX=$(echo ${URL}|sed -r 's#.*/([^/]*)$#\1#'|sed 's#\.#-#') + echo "Prefix for root tree is ${PREFIX}" + REPONAME=${PREFIX}; + elif test "x$repos" = "x${HOTSPOT}"; then + FILENAME=${repos} + REPONAME=hotspot; + DIRNAME=hotspot; + else + FILENAME=${repos}; + REPONAME=${repos}; + fi + if echo ${TAG} | egrep '^(icedtea|jdk|aarch64|tip)' > /dev/null ; then + CHANGESET=$(hg log -r ${TAG} -R ${CHECKOUT_DIR}/${DIRNAME} | head -n1| awk -F ':' '{print $3}') + else + CHANGESET=${TAG} + fi + if test "x${CTYPE}" = "xxz"; then + MCTYPE=tar; + else + MCTYPE=t${CTYPE}; + SUFFIX=.${CTYPE} + fi + echo "Creating ${FILENAME}.tar.${CTYPE} containing ${REPONAME}-${CHANGESET} from tag ${TAG} in ${CHECKOUT_DIR}/${repos}" + rm -f ${FILENAME}.tar.${CTYPE} + hg archive -R ${CHECKOUT_DIR}/${DIRNAME} -t ${MCTYPE} -r ${TAG} -p ${REPONAME}-${CHANGESET} ${FILENAME}.tar${SUFFIX} + if test "x${CTYPE}" = "xxz"; then xz -v ${FILENAME}.tar; fi +done +echo Removing outdated symlinks +find $DOWNLOAD_DIR -maxdepth 1 -type l -exec rm -vf '{}' ';' +popd +echo Generating new changeset IDs and SHA256 sums +echo URL = ${URL} +if test "x$OPENJDK8" = "xfalse"; then + $RUNNING_DIR/gen_changeset_and_sha256sums.sh bz2 $DOWNLOAD_DIR ${DOWNLOAD_URL} ${URL} ${HOTSPOT} +else + $RUNNING_DIR/gen_changeset_and_sha256sums_8.sh xz $DOWNLOAD_DIR ${DOWNLOAD_URL} ${URL} ${HOTSPOT} +fi
--- a/scripts/gen_changeset_and_sha256sums.sh Mon Jul 18 06:27:50 2016 +0100 +++ b/scripts/gen_changeset_and_sha256sums.sh Thu Jul 21 22:45:04 2016 +0100 @@ -1,19 +1,110 @@ #!/bin/bash -DOWNLOAD_DIR=$1 +# Copyright (C) 2016 Red Hat, Inc. +# Written by Andrew John Hughes <gnu.andrew@redhat.com>. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +COMPRESSION_TYPE=$1 +DOWNLOAD_DIR=$2 +DOWNLOAD_URL=$3 +ROOT_URL=$4 +HOTSPOT=$5 + +if [ $(echo $0|grep '_8') ]; then + echo "Assuming OpenJDK 8 and later"; + OPENJDK8=true; + NASHORN=nashorn; +else + echo "Assuming OpenJDK 7 and earlier"; + OPENJDK8=false; +fi + +if test "x$COMPRESSION_TYPE" = "x"; then + echo "ERROR: Compression type must be specified."; + echo "$0 <COMPRESSION_TYPE> <DOWNLOAD_DIR> <DOWNLOAD_URL> <ROOT_URL> <HOTSPOT>" + exit -1; +fi if test "x$DOWNLOAD_DIR" = "x"; then - DOWNLOAD_DIR=/home/downloads/java/icedtea ; + if test "x$OPENJDK8" = "xfalse"; then + DOWNLOAD_DIR=/home/downloads/java/drops/icedtea7 ; + else + DOWNLOAD_DIR=/home/downloads/java/drops/icedtea8 ; + fi +fi + +if test "x$URL" = "x"; then + if test "x$OPENJDK8" = "xfalse"; then + URL=http://icedtea.classpath.org/hg/icedtea7-forest ; + else + URL=http://icedtea.classpath.org/hg/icedtea8-forest ; + fi fi -rm -f /tmp/changesets /tmp/sums -for repos in corba hotspot jaxp jaxws jdk langtools openjdk -do - echo Generating changeset and checksum for $repos using $DOWNLOAD_DIR/$repos.tar.gz - file=$DOWNLOAD_DIR/$repos.tar.gz - id=$(echo $repos|tr '[a-z]' '[A-Z]') +echo "Using URL: $ROOT_URL"; +if echo ${ROOT_URL}|grep 'release' > /dev/null; then + jdk_version=$(echo ${ROOT_URL}|sed -r 's#.*release/icedtea([0-9]).*#\1#') + version=$(echo ${ROOT_URL}|sed -r 's#.*release/icedtea[0-9]-forest-([0-9.]*)#\1#') + echo "OpenJDK version ${jdk_version}, release branch: ${version}"; +elif echo ${ROOT_URL}|grep 'openjdk\.java\.net' > /dev/null; then + jdk_version=$(echo ${ROOT_URL}|sed -r 's#.*jdk([0-9])u.*#\1#') + echo "OpenJDK version ${jdk_version}"; +else + jdk_version=$(echo ${ROOT_URL}|sed -r 's#.*icedtea([0-9]).*#\1#') + echo "OpenJDK version ${jdk_version}"; +fi + +if test "x$HOTSPOT" = "x"; then + HOTSPOT=default; +fi + +echo "Using HotSpot archive: $HOTSPOT" + +rm -f /tmp/changesets /tmp/sums /tmp/hotspot.map + +if test "x$HOTSPOT" = "xdefault"; then + for repos in corba jaxp jaxws jdk langtools openjdk $NASHORN + do + file=$DOWNLOAD_DIR/$repos.tar.${COMPRESSION_TYPE} + echo Generating changeset and checksum for $repos using ${file} + if [ -e $file ] ; then + id=$(echo $repos|tr '[a-z]' '[A-Z]') + sha256sum=$(sha256sum $file|awk '{print $1}') + changeset=$(tar tf $file|head -n1|sed -r "s#[a-z0-9-]*-([0-9a-z]*)/.*#\1#") + name=$(echo ${DOWNLOAD_DIR}|sed -r 's#.*(icedtea.*)#\1#'|sed 's#[78]/#-#') + ln -sf ${repos}.tar.${COMPRESSION_TYPE} ${DOWNLOAD_DIR}/${name}-${repos}-${changeset}.tar.${COMPRESSION_TYPE} + echo "${id}_CHANGESET = $changeset" >> /tmp/changesets + echo "${id}_SHA256SUM = $sha256sum" >> /tmp/sums + fi + done + hotspots=hotspot +else + hotspots=${HOTSPOT} +fi + +file=${DOWNLOAD_DIR}/${hotspots}.tar.${COMPRESSION_TYPE} +if [ -e ${file} ] ; then + echo Generating changeset and checksum for ${hotspots} using ${file} sha256sum=$(sha256sum $file|awk '{print $1}') - changeset=$(tar tzf $file|head -n1|sed -r "s#[a-z0-9-]*-([0-9a-z]*)/.*#\1#") - echo "${id}_CHANGESET = $changeset" >> /tmp/changesets - echo "${id}_SHA256SUM = $sha256sum" >> /tmp/sums -done + name=$(echo ${DOWNLOAD_DIR}|sed -r 's#.*(icedtea.*)#\1#'|sed 's#[78]/#-#') + changeset=$(tar tf $file|head -n1|sed -r "s#[a-z0-9-]*-([0-9a-z]*)/.*#\1#") + ln -sf ${hotspots}.tar.${COMPRESSION_TYPE} ${DOWNLOAD_DIR}/${name}-${hotspots}-${changeset}.tar.${COMPRESSION_TYPE} + if test "x${hotspots}" = "xhotspot"; + then hsversion=default; else hsversion=${hotspots}; + fi + drop_url="${DOWNLOAD_URL}/icedtea${jdk_version}/@ICEDTEA_RELEASE@"; + echo "${hsversion} drop ${drop_url} ${changeset} ${sha256sum}" >> /tmp/hotspot.map +fi ; +