Mercurial > hg > icedtea8
changeset 2802:9be310f32e58 icedtea-3.7.0pre01
Bump aarch32 to jdk8u152-b17-aarch32-171102.
Upstream changes:
- S6515172: Runtime.availableProcessors() ignores Linux taskset command
- S8034249: need more workarounds for suspend equivalent condition issue
- S8038348: Instance field load is replaced by wrong data Phi
- S8043913: remove legacy code in SPARC's VM_Version::platform_features
- S8049717: expose L1_data_cache_line_size for diagnostic/sanity checks
- S8066250: compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java fails product
- S8081219: hs_err improvement: Add event logging for class redefinition to the hs_err file
- S8087342: Crash in klassItable::initialize_itable_for_interface
- S8134119: Use new API to get cache line sizes
- S8134389: Crash in HotSpot with jvm.dll+0x42b48 ciObjectFactory::create_new_metadata
- S8134918: C2: Type speculation produces mismatched unsafe accesses
- S8140309: [REDO] failed: no mismatched stores, except on raw memory: StoreB StoreI
- S8140584: [aarch32] nmethod::oops_do_marking_epilogue always runs verification code
- S8140584: nmethod::oops_do_marking_epilogue always runs verification code
- S8143897: Weblogic12medrec assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true)) failed: Must be the same
- S8147910: Cache initial active_processor_count
- S8150490: Update OS detection code to recognize Windows Server 2016
- S8152172: PPC64: Support AES intrinsics
- S8152438: Threads may do significant work out of the non-shared overflow buffer
- S8152730: File Leak in CompileBroker::init_compiler_thread_log of compileBroker.cpp:1665.
- S8153134: Infinite loop in handle_wrong_method in jmod
- S8153176: ParOldGC: Use correct TaskQueueSet for ParallelTaskTerminator in marking.
- S8153267: nmethod's exception cache not multi-thread safe
- S8154945: Enable 8130150 and 8081778 intrinsics by default
- S8155781: C2: opaque unsafe access triggers an assert
- S8157181: Compilers accept modification of final fields outside initializer methods
- S8157184: java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java failed with a fatal error
- S8157306: Random infrequent null pointer exceptions in javac
- S8157548: JVM crashes sometimes while starting
- S8158639: C2 compilation fails with SIGSEGV
- S8160119: Utils.tryFindJvmPid sometimes find incorrect pid
- S8160551: assert(c == Bytecodes::_putfield) failed: must be putfield
- S8161144: Fix for JDK-8147451 failed: Crash in Method::checked_resolve_jmethod_id(_jmethodID*)
- S8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
- S8161993: G1 crashes if active_processor_count changes during startup
- S8162101: C2: Handle "wide" aliases for unsafe accesses
- S8162384: Performance regression: bimorphic inlining may be bypassed by type speculation
- S8162419: closed/com/oracle/jfr/runtime/TestVMInfoEvent.sh failing after JDK-8155968
- S8162496: missing precedence edge for anti_dependence
- S8162603: Unrecognized VM option 'UseCountedLoopSafepoints'
- S8162766: Unsafe_DefineClass0 accesses raw oops while in _thread_in_native
- S8162795: [REDO] MemberNameTable doesn't purge stale entries
- S8163969: Cyclic interface initialization causes JVM crash
- S8164002: Add a new CPU family (S_family) for SPARC S7 and above processors
- S8164293: HotSpot leaking memory in long-running requests
- S8164508: unexpected profiling mismatch in c1 generated code
- S8165153: Crash in rebuild_cpu_to_node_map
- S8165482: java in ldoms, with cpu-arch=generic has problems
- S8166799: ASSEMBLY_EXCEPTION contains historical company name
- S8166872: GPL header in /hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp
- S8168115: Remove and retag jdk8u122-b03 in 8u repo
- S8168914: Crash in ClassLoaderData/JNIHandleBlock::oops_do during concurrent marking
- S8170307: Stack size option -Xss is ignored
- S8170409: CMS: Crash in CardTableModRefBSForCTRS::process_chunk_boundaries
- S8170536: Uninitialised memory in set_uintx_flag of attachListener.cpp
- S8170888: [linux] Experimental support for cgroup memory limits in container (ie Docker) environments
- S8171155: Scanning method file for initialized final field updates can fail for non-existent fields
- S8171194: Exception "Duplicate field name&signature in class file" should report the name and signature of the field
- S8172145: C2: anti dependence missed because store hidden by membar
- S8173373: C1: NPE is thrown instead of LinkageError when accessing inaccessible field on NULL receiver
- S8173941: SA does not work if executable is DSO
- S8174164: SafePointNode::_replaced_nodes breaks with irreducible loops
- S8175097: [TESTBUG] 8174164 fix missed the test
- S8175345: Reported null pointer dereference defect groups
- S8175813: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used
- S8175887: C1 value numbering handling of Unsafe.get*Volatile is incorrect
- S8177095: Range check dependent CastII/ConvI2L is prematurely eliminated
- S8177817: Remove assertions in 8u that were removed by 8056124 in 9.
- S8179084: HotSpot VM fails to start when AggressiveHeap is set
- S8180048: Interned string and symbol table leak memory during parallel unlinking
- S8180511: Null pointer dereference in Matcher::ReduceInst()
- S8180565: Null pointer dereferences of ConstMethod::method()
- S8180575: Null pointer dereference in LoadNode::Identity()
- S8180576: Null pointer dereference in Matcher::xform()
- S8180617: Null pointer dereference in InitializeNode::complete_stores
- S8180711: Better invokespecial checks
- S8180813: Null pointer dereference of CodeCache::find_blob() result
- S8180934: PutfieldError failed with UnsupportedClassVersionError
- S8184682: Upgrade compression library
ChangeLog:
2018-01-23 Andrew John Hughes <gnu_andrew@member.fsf.org>
Bump aarch32 to jdk8u152-b17-aarch32-171102.
* patches/hotspot/aarch32/8162384-pr3122.patch,
* patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch,
* patches/hotspot/aarch32/8173941-pr3326.patch,
* patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch,
* patches/hotspot/aarch32/8175887-pr3415.patch,
* patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch,
* patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch,
* patches/hotspot/aarch32/8180711.patch,
* patches/hotspot/aarch32/8184682.patch:
Removed as applied upstream.
* Makefile.am:
(ICEDTEA_PATCHES): Remove all AArch32-only patches
as now applied upstream.
* NEWS: Updated.
* hotspot.map.in: Bump aarch32 to
jdk8u152-b17-aarch32-171102.
* patches/hotspot/aarch32/8078628-pr3208.patch:
Adjust to apply against jdk8u152-b17-aarch32-171102.
Some changes in the Shenandoah version are already applied
in AArch32.
* patches/hotspot/aarch32/8145913-pr3466-rh1498309.patch:
Replace with symlink to Shenandoah version.
* patches/hotspot/aarch32/8158260-pr2991-rh1341258.patch,
Adjust to apply against jdk8u152-b17-aarch32-171102.
AArch32 does not have src/cpu/aarch64/vm/vm_version_aarch64.cpp
so can't share the patch with Shenandoah.
author | Andrew John Hughes <gnu_andrew@member.fsf.org> |
---|---|
date | Wed, 24 Jan 2018 18:02:03 +0000 |
parents | 6ff93690a6f2 |
children | ba09cdbc86ec |
files | ChangeLog Makefile.am NEWS hotspot.map.in patches/hotspot/aarch32/8078628-pr3208.patch patches/hotspot/aarch32/8145913-pr3466-rh1498309.patch patches/hotspot/aarch32/8158260-pr2991-rh1341258.patch patches/hotspot/aarch32/8162384-pr3122.patch patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch patches/hotspot/aarch32/8173941-pr3326.patch patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch patches/hotspot/aarch32/8175887-pr3415.patch patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch patches/hotspot/aarch32/8180711.patch patches/hotspot/aarch32/8184682.patch |
diffstat | 16 files changed, 63 insertions(+), 1753 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Jan 22 18:54:35 2018 +0000 +++ b/ChangeLog Wed Jan 24 18:02:03 2018 +0000 @@ -1,3 +1,33 @@ +2018-01-23 Andrew John Hughes <gnu_andrew@member.fsf.org> + + Bump aarch32 to jdk8u152-b17-aarch32-171102. + * patches/hotspot/aarch32/8162384-pr3122.patch, + * patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch, + * patches/hotspot/aarch32/8173941-pr3326.patch, + * patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch, + * patches/hotspot/aarch32/8175887-pr3415.patch, + * patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch, + * patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch, + * patches/hotspot/aarch32/8180711.patch, + * patches/hotspot/aarch32/8184682.patch: + Removed as applied upstream. + * Makefile.am: + (ICEDTEA_PATCHES): Remove all AArch32-only patches + as now applied upstream. + * NEWS: Updated. + * hotspot.map.in: Bump aarch32 to + jdk8u152-b17-aarch32-171102. + * patches/hotspot/aarch32/8078628-pr3208.patch: + Adjust to apply against jdk8u152-b17-aarch32-171102. + Some changes in the Shenandoah version are already applied + in AArch32. + * patches/hotspot/aarch32/8145913-pr3466-rh1498309.patch: + Replace with symlink to Shenandoah version. + * patches/hotspot/aarch32/8158260-pr2991-rh1341258.patch, + Adjust to apply against jdk8u152-b17-aarch32-171102. + AArch32 does not have src/cpu/aarch64/vm/vm_version_aarch64.cpp + so can't share the patch with Shenandoah. + 2018-01-22 Andrew John Hughes <gnu_andrew@member.fsf.org> Bump shenandoah to aarch64-shenandoah-jdk8u152-b16.
--- a/Makefile.am Mon Jan 22 18:54:35 2018 +0000 +++ b/Makefile.am Wed Jan 24 18:02:03 2018 +0000 @@ -347,20 +347,10 @@ if WITH_ALT_HSBUILD -# AArch32 doesn't yet have the latest update -# Shenandoah included 8175887 ahead of upstream -if WITH_AARCH32_HSBUILD -ICEDTEA_PATCHES += \ - patches/hotspot/$(HSBUILD)/8162384-pr3122.patch \ - patches/hotspot/$(HSBUILD)/8164293-pr3412-rh1459641.patch \ - patches/hotspot/$(HSBUILD)/8173941-pr3326.patch \ - patches/hotspot/$(HSBUILD)/8175813-pr3394-rh1448880.patch \ - patches/hotspot/$(HSBUILD)/8175887-pr3415.patch \ - patches/hotspot/$(HSBUILD)/8179084-pr3409-rh1455694.patch \ - patches/hotspot/$(HSBUILD)/8180711.patch \ - patches/hotspot/$(HSBUILD)/8180048-pr3411-rh1449870.patch \ - patches/hotspot/$(HSBUILD)/8184682.patch -endif +# Patches only for AArch32 +#if WITH_AARCH32_HSBUILD +#ICEDTEA_PATCHES += \ +#endif ICEDTEA_PATCHES += \ patches/hotspot/$(HSBUILD)/8038392-rh1064383.patch \
--- a/NEWS Mon Jan 22 18:54:35 2018 +0000 +++ b/NEWS Wed Jan 24 18:02:03 2018 +0000 @@ -251,6 +251,8 @@ - PR3501: Revert 8165320 so as not to revert the work of 8034174 (PR2290) * Shenandoah - S8193133: Assertion failure because 0xDEADDEAD can be in-heap +* AArch32 port + - S8140584: [aarch32] nmethod::oops_do_marking_epilogue always runs verification code New in release 3.6.0 (2017-10-31):
--- a/hotspot.map.in Mon Jan 22 18:54:35 2018 +0000 +++ b/hotspot.map.in Wed Jan 24 18:02:03 2018 +0000 @@ -1,4 +1,4 @@ # version type(drop/hg) url changeset sha256sum default drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ c14f056eed68 9190d0bc56443e9bbebe44f11a1b16079cf7a3b637cbda26c63f40df3d26f902 shenandoah drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 9adf5a64b23f 7cb89003c3da3b0b50c04447272295d8c508217979a1fbc909b356a47f11f5f8 -aarch32 drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 7b008fa0fb6d c20ed439e32c6d72321097289bf7ac19bfae172a90efe23e08c54e63c53b402c +aarch32 drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ f8b1fb102364 d8ff5f655952452f8cdc2914bbb0166b533f6c0acfd38033c7261f2864e2ea06
--- a/patches/hotspot/aarch32/8078628-pr3208.patch Mon Jan 22 18:54:35 2018 +0000 +++ b/patches/hotspot/aarch32/8078628-pr3208.patch Wed Jan 24 18:02:03 2018 +0000 @@ -7,8 +7,8 @@ 8078628, PR3208: Zero build fails with pre-compiled headers disabled diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp ---- openjdk.orig/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp 2017-04-20 13:33:45.000000000 +0100 -+++ openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp 2017-05-11 03:14:30.749469306 +0100 +--- openjdk.orig/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp 2018-01-24 03:48:09.644055362 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. @@ -33,11 +33,11 @@ + +#endif // CPU_ZERO_VM_METHODHANDLES_ZERO_HPP diff -Nru openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp openjdk/hotspot/src/share/vm/prims/methodHandles.hpp ---- openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp 2017-04-20 13:33:45.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/prims/methodHandles.hpp 2017-05-11 03:14:30.749469306 +0100 +--- openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/prims/methodHandles.hpp 2018-01-24 03:48:24.907809625 +0000 @@ -1,5 +1,6 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright 2016 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. *
--- a/patches/hotspot/aarch32/8145913-pr3466-rh1498309.patch Mon Jan 22 18:54:35 2018 +0000 +++ b/patches/hotspot/aarch32/8145913-pr3466-rh1498309.patch Wed Jan 24 18:02:03 2018 +0000 @@ -1,472 +1,1 @@ -# HG changeset patch -# User mdoerr -# Date 1507750779 -3600 -# Wed Oct 11 20:39:39 2017 +0100 -# Node ID 92f0dbe76a13992cc27188e0f68e4b1771c7004a -# Parent 542c122b1d7d30c29189565248074aa28f21ae58 -8145913, PR3466, RH1498309: PPC64: add Montgomery multiply intrinsic -Reviewed-by: aph, goetz - -diff --git a/src/cpu/ppc/vm/assembler_ppc.hpp b/src/cpu/ppc/vm/assembler_ppc.hpp ---- openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp -+++ openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp -@@ -1179,6 +1179,8 @@ - inline void mullw_( Register d, Register a, Register b); - inline void mulhw( Register d, Register a, Register b); - inline void mulhw_( Register d, Register a, Register b); -+ inline void mulhwu( Register d, Register a, Register b); -+ inline void mulhwu_(Register d, Register a, Register b); - inline void mulhd( Register d, Register a, Register b); - inline void mulhd_( Register d, Register a, Register b); - inline void mulhdu( Register d, Register a, Register b); -diff --git a/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/src/cpu/ppc/vm/assembler_ppc.inline.hpp ---- openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp -+++ openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp -@@ -109,6 +109,8 @@ - inline void Assembler::mullw_( Register d, Register a, Register b) { emit_int32(MULLW_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); } - inline void Assembler::mulhw( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } - inline void Assembler::mulhw_( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } -+inline void Assembler::mulhwu( Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } -+inline void Assembler::mulhwu_(Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } - inline void Assembler::mulhd( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } - inline void Assembler::mulhd_( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } - inline void Assembler::mulhdu( Register d, Register a, Register b) { emit_int32(MULHDU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } -diff --git a/src/cpu/ppc/vm/c2_init_ppc.cpp b/src/cpu/ppc/vm/c2_init_ppc.cpp ---- openjdk/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp -@@ -45,4 +45,10 @@ - FLAG_SET_ERGO(bool, InsertEndGroupPPC64, true); - } - } -+ -+ if (OptimizeFill) { -+ warning("OptimizeFill is not supported on this CPU."); -+ FLAG_SET_DEFAULT(OptimizeFill, false); -+ } -+ - } -diff --git a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp ---- openjdk/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp -@@ -42,6 +42,8 @@ - #include "opto/runtime.hpp" - #endif - -+#include <alloca.h> -+ - #define __ masm-> - - #ifdef PRODUCT -@@ -3269,3 +3271,245 @@ - return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_in_bytes/wordSize, - oop_maps, true); - } -+ -+ -+//------------------------------Montgomery multiplication------------------------ -+// -+ -+// Subtract 0:b from carry:a. Return carry. -+static unsigned long -+sub(unsigned long a[], unsigned long b[], unsigned long carry, long len) { -+ long i = 0; -+ unsigned long tmp, tmp2; -+ __asm__ __volatile__ ( -+ "subfc %[tmp], %[tmp], %[tmp] \n" // pre-set CA -+ "mtctr %[len] \n" -+ "0: \n" -+ "ldx %[tmp], %[i], %[a] \n" -+ "ldx %[tmp2], %[i], %[b] \n" -+ "subfe %[tmp], %[tmp2], %[tmp] \n" // subtract extended -+ "stdx %[tmp], %[i], %[a] \n" -+ "addi %[i], %[i], 8 \n" -+ "bdnz 0b \n" -+ "addme %[tmp], %[carry] \n" // carry + CA - 1 -+ : [i]"+b"(i), [tmp]"=&r"(tmp), [tmp2]"=&r"(tmp2) -+ : [a]"r"(a), [b]"r"(b), [carry]"r"(carry), [len]"r"(len) -+ : "ctr", "xer", "memory" -+ ); -+ return tmp; -+} -+ -+// Multiply (unsigned) Long A by Long B, accumulating the double- -+// length result into the accumulator formed of T0, T1, and T2. -+inline void MACC(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) { -+ unsigned long hi, lo; -+ __asm__ __volatile__ ( -+ "mulld %[lo], %[A], %[B] \n" -+ "mulhdu %[hi], %[A], %[B] \n" -+ "addc %[T0], %[T0], %[lo] \n" -+ "adde %[T1], %[T1], %[hi] \n" -+ "addze %[T2], %[T2] \n" -+ : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2) -+ : [A]"r"(A), [B]"r"(B) -+ : "xer" -+ ); -+} -+ -+// As above, but add twice the double-length result into the -+// accumulator. -+inline void MACC2(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) { -+ unsigned long hi, lo; -+ __asm__ __volatile__ ( -+ "mulld %[lo], %[A], %[B] \n" -+ "mulhdu %[hi], %[A], %[B] \n" -+ "addc %[T0], %[T0], %[lo] \n" -+ "adde %[T1], %[T1], %[hi] \n" -+ "addze %[T2], %[T2] \n" -+ "addc %[T0], %[T0], %[lo] \n" -+ "adde %[T1], %[T1], %[hi] \n" -+ "addze %[T2], %[T2] \n" -+ : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2) -+ : [A]"r"(A), [B]"r"(B) -+ : "xer" -+ ); -+} -+ -+// Fast Montgomery multiplication. The derivation of the algorithm is -+// in "A Cryptographic Library for the Motorola DSP56000, -+// Dusse and Kaliski, Proc. EUROCRYPT 90, pp. 230-237". -+static void -+montgomery_multiply(unsigned long a[], unsigned long b[], unsigned long n[], -+ unsigned long m[], unsigned long inv, int len) { -+ unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator -+ int i; -+ -+ assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply"); -+ -+ for (i = 0; i < len; i++) { -+ int j; -+ for (j = 0; j < i; j++) { -+ MACC(a[j], b[i-j], t0, t1, t2); -+ MACC(m[j], n[i-j], t0, t1, t2); -+ } -+ MACC(a[i], b[0], t0, t1, t2); -+ m[i] = t0 * inv; -+ MACC(m[i], n[0], t0, t1, t2); -+ -+ assert(t0 == 0, "broken Montgomery multiply"); -+ -+ t0 = t1; t1 = t2; t2 = 0; -+ } -+ -+ for (i = len; i < 2*len; i++) { -+ int j; -+ for (j = i-len+1; j < len; j++) { -+ MACC(a[j], b[i-j], t0, t1, t2); -+ MACC(m[j], n[i-j], t0, t1, t2); -+ } -+ m[i-len] = t0; -+ t0 = t1; t1 = t2; t2 = 0; -+ } -+ -+ while (t0) { -+ t0 = sub(m, n, t0, len); -+ } -+} -+ -+// Fast Montgomery squaring. This uses asymptotically 25% fewer -+// multiplies so it should be up to 25% faster than Montgomery -+// multiplication. However, its loop control is more complex and it -+// may actually run slower on some machines. -+static void -+montgomery_square(unsigned long a[], unsigned long n[], -+ unsigned long m[], unsigned long inv, int len) { -+ unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator -+ int i; -+ -+ assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply"); -+ -+ for (i = 0; i < len; i++) { -+ int j; -+ int end = (i+1)/2; -+ for (j = 0; j < end; j++) { -+ MACC2(a[j], a[i-j], t0, t1, t2); -+ MACC(m[j], n[i-j], t0, t1, t2); -+ } -+ if ((i & 1) == 0) { -+ MACC(a[j], a[j], t0, t1, t2); -+ } -+ for (; j < i; j++) { -+ MACC(m[j], n[i-j], t0, t1, t2); -+ } -+ m[i] = t0 * inv; -+ MACC(m[i], n[0], t0, t1, t2); -+ -+ assert(t0 == 0, "broken Montgomery square"); -+ -+ t0 = t1; t1 = t2; t2 = 0; -+ } -+ -+ for (i = len; i < 2*len; i++) { -+ int start = i-len+1; -+ int end = start + (len - start)/2; -+ int j; -+ for (j = start; j < end; j++) { -+ MACC2(a[j], a[i-j], t0, t1, t2); -+ MACC(m[j], n[i-j], t0, t1, t2); -+ } -+ if ((i & 1) == 0) { -+ MACC(a[j], a[j], t0, t1, t2); -+ } -+ for (; j < len; j++) { -+ MACC(m[j], n[i-j], t0, t1, t2); -+ } -+ m[i-len] = t0; -+ t0 = t1; t1 = t2; t2 = 0; -+ } -+ -+ while (t0) { -+ t0 = sub(m, n, t0, len); -+ } -+} -+ -+// The threshold at which squaring is advantageous was determined -+// experimentally on an i7-3930K (Ivy Bridge) CPU @ 3.5GHz. -+// Doesn't seem to be relevant for Power8 so we use the same value. -+#define MONTGOMERY_SQUARING_THRESHOLD 64 -+ -+// Copy len longwords from s to d, word-swapping as we go. The -+// destination array is reversed. -+static void reverse_words(unsigned long *s, unsigned long *d, int len) { -+ d += len; -+ while(len-- > 0) { -+ d--; -+ unsigned long s_val = *s; -+ // Swap words in a longword on little endian machines. -+#ifdef VM_LITTLE_ENDIAN -+ s_val = (s_val << 32) | (s_val >> 32); -+#endif -+ *d = s_val; -+ s++; -+ } -+} -+ -+void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints, -+ jint len, jlong inv, -+ jint *m_ints) { -+ assert(len % 2 == 0, "array length in montgomery_multiply must be even"); -+ int longwords = len/2; -+ assert(longwords > 0, "unsupported"); -+ -+ // Make very sure we don't use so much space that the stack might -+ // overflow. 512 jints corresponds to an 16384-bit integer and -+ // will use here a total of 8k bytes of stack space. -+ int total_allocation = longwords * sizeof (unsigned long) * 4; -+ guarantee(total_allocation <= 8192, "must be"); -+ unsigned long *scratch = (unsigned long *)alloca(total_allocation); -+ -+ // Local scratch arrays -+ unsigned long -+ *a = scratch + 0 * longwords, -+ *b = scratch + 1 * longwords, -+ *n = scratch + 2 * longwords, -+ *m = scratch + 3 * longwords; -+ -+ reverse_words((unsigned long *)a_ints, a, longwords); -+ reverse_words((unsigned long *)b_ints, b, longwords); -+ reverse_words((unsigned long *)n_ints, n, longwords); -+ -+ ::montgomery_multiply(a, b, n, m, (unsigned long)inv, longwords); -+ -+ reverse_words(m, (unsigned long *)m_ints, longwords); -+} -+ -+void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, -+ jint len, jlong inv, -+ jint *m_ints) { -+ assert(len % 2 == 0, "array length in montgomery_square must be even"); -+ int longwords = len/2; -+ assert(longwords > 0, "unsupported"); -+ -+ // Make very sure we don't use so much space that the stack might -+ // overflow. 512 jints corresponds to an 16384-bit integer and -+ // will use here a total of 6k bytes of stack space. -+ int total_allocation = longwords * sizeof (unsigned long) * 3; -+ guarantee(total_allocation <= 8192, "must be"); -+ unsigned long *scratch = (unsigned long *)alloca(total_allocation); -+ -+ // Local scratch arrays -+ unsigned long -+ *a = scratch + 0 * longwords, -+ *n = scratch + 1 * longwords, -+ *m = scratch + 2 * longwords; -+ -+ reverse_words((unsigned long *)a_ints, a, longwords); -+ reverse_words((unsigned long *)n_ints, n, longwords); -+ -+ if (len >= MONTGOMERY_SQUARING_THRESHOLD) { -+ ::montgomery_square(a, n, m, (unsigned long)inv, longwords); -+ } else { -+ ::montgomery_multiply(a, a, n, m, (unsigned long)inv, longwords); -+ } -+ -+ reverse_words(m, (unsigned long *)m_ints, longwords); -+} -diff --git a/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/src/cpu/ppc/vm/stubGenerator_ppc.cpp ---- openjdk/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp -@@ -2094,6 +2094,14 @@ - generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry, - &StubRoutines::_safefetchN_fault_pc, - &StubRoutines::_safefetchN_continuation_pc); -+ if (UseMontgomeryMultiplyIntrinsic) { -+ StubRoutines::_montgomeryMultiply -+ = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply); -+ } -+ if (UseMontgomerySquareIntrinsic) { -+ StubRoutines::_montgomerySquare -+ = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square); -+ } - } - - public: -diff --git a/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/src/cpu/ppc/vm/templateInterpreter_ppc.cpp ---- openjdk/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp -@@ -265,7 +265,7 @@ - __ cmpdi(CCR0, Rmdo, 0); - __ beq(CCR0, no_mdo); - -- // Increment backedge counter in the MDO. -+ // Increment invocation counter in the MDO. - const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); - __ lwz(Rscratch2, mdo_bc_offs, Rmdo); - __ addi(Rscratch2, Rscratch2, increment); -@@ -277,12 +277,12 @@ - } - - // Increment counter in MethodCounters*. -- const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); -+ const int mo_ic_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); - __ bind(no_mdo); - __ get_method_counters(R19_method, R3_counters, done); -- __ lwz(Rscratch2, mo_bc_offs, R3_counters); -+ __ lwz(Rscratch2, mo_ic_offs, R3_counters); - __ addi(Rscratch2, Rscratch2, increment); -- __ stw(Rscratch2, mo_bc_offs, R3_counters); -+ __ stw(Rscratch2, mo_ic_offs, R3_counters); - __ load_const_optimized(Rscratch1, mask, R0); - __ and_(Rscratch1, Rscratch2, Rscratch1); - __ beq(CCR0, *overflow); -diff --git a/src/cpu/ppc/vm/vm_version_ppc.cpp b/src/cpu/ppc/vm/vm_version_ppc.cpp ---- openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp -@@ -181,6 +181,13 @@ - if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { - FLAG_SET_DEFAULT(UseUnalignedAccesses, true); - } -+ -+ if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { -+ UseMontgomeryMultiplyIntrinsic = true; -+ } -+ if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { -+ UseMontgomerySquareIntrinsic = true; -+ } - } - - void VM_Version::print_features() { -diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp ---- openjdk/hotspot/src/share/vm/opto/library_call.cpp -+++ openjdk/hotspot/src/share/vm/opto/library_call.cpp -@@ -6031,11 +6031,21 @@ - Node* n_start = array_element_address(n, intcon(0), n_elem); - Node* m_start = array_element_address(m, intcon(0), m_elem); - -- Node* call = make_runtime_call(RC_LEAF, -- OptoRuntime::montgomeryMultiply_Type(), -- stubAddr, stubName, TypePtr::BOTTOM, -- a_start, b_start, n_start, len, inv, top(), -- m_start); -+ Node* call = NULL; -+ if (CCallingConventionRequiresIntsAsLongs) { -+ Node* len_I2L = ConvI2L(len); -+ call = make_runtime_call(RC_LEAF, -+ OptoRuntime::montgomeryMultiply_Type(), -+ stubAddr, stubName, TypePtr::BOTTOM, -+ a_start, b_start, n_start, len_I2L XTOP, inv, -+ top(), m_start); -+ } else { -+ call = make_runtime_call(RC_LEAF, -+ OptoRuntime::montgomeryMultiply_Type(), -+ stubAddr, stubName, TypePtr::BOTTOM, -+ a_start, b_start, n_start, len, inv, top(), -+ m_start); -+ } - set_result(m); - } - -@@ -6085,11 +6095,22 @@ - Node* n_start = array_element_address(n, intcon(0), n_elem); - Node* m_start = array_element_address(m, intcon(0), m_elem); - -- Node* call = make_runtime_call(RC_LEAF, -- OptoRuntime::montgomerySquare_Type(), -- stubAddr, stubName, TypePtr::BOTTOM, -- a_start, n_start, len, inv, top(), -- m_start); -+ Node* call = NULL; -+ if (CCallingConventionRequiresIntsAsLongs) { -+ Node* len_I2L = ConvI2L(len); -+ call = make_runtime_call(RC_LEAF, -+ OptoRuntime::montgomerySquare_Type(), -+ stubAddr, stubName, TypePtr::BOTTOM, -+ a_start, n_start, len_I2L XTOP, inv, top(), -+ m_start); -+ } else { -+ call = make_runtime_call(RC_LEAF, -+ OptoRuntime::montgomerySquare_Type(), -+ stubAddr, stubName, TypePtr::BOTTOM, -+ a_start, n_start, len, inv, top(), -+ m_start); -+ } -+ - set_result(m); - } - -diff --git a/src/share/vm/opto/runtime.cpp b/src/share/vm/opto/runtime.cpp ---- openjdk/hotspot/src/share/vm/opto/runtime.cpp -+++ openjdk/hotspot/src/share/vm/opto/runtime.cpp -@@ -1005,12 +1005,20 @@ - // create input type (domain) - int num_args = 7; - int argcnt = num_args; -+ if (CCallingConventionRequiresIntsAsLongs) { -+ argcnt++; // additional placeholder -+ } - const Type** fields = TypeTuple::fields(argcnt); - int argp = TypeFunc::Parms; - fields[argp++] = TypePtr::NOTNULL; // a - fields[argp++] = TypePtr::NOTNULL; // b - fields[argp++] = TypePtr::NOTNULL; // n -- fields[argp++] = TypeInt::INT; // len -+ if (CCallingConventionRequiresIntsAsLongs) { -+ fields[argp++] = TypeLong::LONG; // len -+ fields[argp++] = TypeLong::HALF; // placeholder -+ } else { -+ fields[argp++] = TypeInt::INT; // len -+ } - fields[argp++] = TypeLong::LONG; // inv - fields[argp++] = Type::HALF; - fields[argp++] = TypePtr::NOTNULL; // result -@@ -1029,11 +1037,19 @@ - // create input type (domain) - int num_args = 6; - int argcnt = num_args; -+ if (CCallingConventionRequiresIntsAsLongs) { -+ argcnt++; // additional placeholder -+ } - const Type** fields = TypeTuple::fields(argcnt); - int argp = TypeFunc::Parms; - fields[argp++] = TypePtr::NOTNULL; // a - fields[argp++] = TypePtr::NOTNULL; // n -- fields[argp++] = TypeInt::INT; // len -+ if (CCallingConventionRequiresIntsAsLongs) { -+ fields[argp++] = TypeLong::LONG; // len -+ fields[argp++] = TypeLong::HALF; // placeholder -+ } else { -+ fields[argp++] = TypeInt::INT; // len -+ } - fields[argp++] = TypeLong::LONG; // inv - fields[argp++] = Type::HALF; - fields[argp++] = TypePtr::NOTNULL; // result +../shenandoah/8145913-pr3466-rh1498309.patch \ No newline at end of file
--- a/patches/hotspot/aarch32/8158260-pr2991-rh1341258.patch Mon Jan 22 18:54:35 2018 +0000 +++ b/patches/hotspot/aarch32/8158260-pr2991-rh1341258.patch Wed Jan 24 18:02:03 2018 +0000 @@ -10,8 +10,8 @@ Contributed-by: gromero@linux.vnet.ibm.com, horii@jp.ibm.com diff -Nru openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp ---- openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp 2016-08-03 06:40:06.000000000 +0100 -+++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp 2016-08-04 06:46:19.679689919 +0100 +--- openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp 2018-01-23 23:23:05.623139271 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -21,7 +21,7 @@ * 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 @@ +@@ -201,6 +201,10 @@ FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); } @@ -33,8 +33,8 @@ void VM_Version::print_features() { diff -Nru openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp ---- openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp 2016-08-03 06:40:06.000000000 +0100 -+++ openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp 2016-08-04 06:46:19.679689919 +0100 +--- openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp 2018-01-23 23:25:16.977039424 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -42,7 +42,7 @@ * 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 @@ +@@ -363,6 +363,13 @@ (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; @@ -55,11 +55,11 @@ + #ifndef PRODUCT if (PrintMiscellaneous && Verbose) { - tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size()); + tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp ---- openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2016-08-03 06:40:06.000000000 +0100 -+++ openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2016-08-04 06:46:19.679689919 +0100 -@@ -1030,6 +1030,11 @@ +--- openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2018-01-23 23:23:05.623139271 +0000 +@@ -1033,6 +1033,11 @@ (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; @@ -72,8 +72,8 @@ if (PrintMiscellaneous && Verbose) { tty->print_cr("Logical CPUs per core: %u", diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.cpp openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp ---- openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2016-08-03 06:40:06.000000000 +0100 -+++ openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2016-08-04 06:46:19.679689919 +0100 +--- openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2018-01-23 23:23:05.623139271 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -95,9 +95,9 @@ + } +} diff -Nru openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src/share/vm/prims/unsafe.cpp ---- openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp 2016-08-03 06:40:06.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp 2016-08-04 06:46:19.679689919 +0100 -@@ -401,6 +401,24 @@ +--- openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp 2018-01-23 23:23:05.623139271 +0000 +@@ -393,6 +393,24 @@ #endif // not SUPPORTS_NATIVE_CX8 @@ -122,7 +122,7 @@ #define DEFINE_GETSETOOP(jboolean, Boolean) \ \ UNSAFE_ENTRY(jboolean, Unsafe_Get##Boolean##140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) \ -@@ -1729,6 +1747,9 @@ +@@ -1696,6 +1714,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)}, @@ -133,9 +133,9 @@ #undef CC diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp ---- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp 2016-08-03 06:40:06.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/runtime/globals.hpp 2016-08-04 06:46:19.679689919 +0100 -@@ -3961,6 +3961,9 @@ +--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp 2017-10-18 17:37:09.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp 2018-01-23 23:23:05.623139271 +0000 +@@ -3974,6 +3974,9 @@ product(bool, UseLockedTracing, false, \ "Use locked-tracing when doing event-based tracing") \ \ @@ -147,7 +147,7 @@ "and not as a general purpose register.") diff -Nru openjdk.orig/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java openjdk/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java --- openjdk.orig/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java 1970-01-01 01:00:00.000000000 +0100 -+++ openjdk/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java 2016-08-04 06:46:19.679689919 +0100 ++++ openjdk/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java 2018-01-23 23:23:05.623139271 +0000 @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2016 SAP SE. All rights reserved.
--- a/patches/hotspot/aarch32/8162384-pr3122.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -# HG changeset patch -# User roland -# Date 1469615613 -7200 -# Wed Jul 27 12:33:33 2016 +0200 -# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 -# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 -8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation -Summary: when speculation fails at a call fallback to profile data at the call site -Reviewed-by: kvn - -diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp ---- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 -+++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 -@@ -205,16 +205,22 @@ - - int morphism = profile.morphism(); - if (speculative_receiver_type != NULL) { -- // We have a speculative type, we should be able to resolve -- // the call. We do that before looking at the profiling at -- // this invoke because it may lead to bimorphic inlining which -- // a speculative type should help us avoid. -- receiver_method = callee->resolve_invoke(jvms->method()->holder(), -- speculative_receiver_type); -- if (receiver_method == NULL) { -+ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { -+ // We have a speculative type, we should be able to resolve -+ // the call. We do that before looking at the profiling at -+ // this invoke because it may lead to bimorphic inlining which -+ // a speculative type should help us avoid. -+ receiver_method = callee->resolve_invoke(jvms->method()->holder(), -+ speculative_receiver_type); -+ if (receiver_method == NULL) { -+ speculative_receiver_type = NULL; -+ } else { -+ morphism = 1; -+ } -+ } else { -+ // speculation failed before. Use profiling at the call -+ // (could allow bimorphic inlining for instance). - speculative_receiver_type = NULL; -- } else { -- morphism = 1; - } - } - if (receiver_method == NULL && -@@ -252,7 +258,7 @@ - Deoptimization::Reason_bimorphic : - (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); - if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && -- !too_many_traps(jvms->method(), jvms->bci(), reason) -+ !too_many_traps(caller, bci, reason) - ) { - // Generate uncommon trap for class check failure path - // in case of monomorphic or bimorphic virtual call site.
--- a/patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -# HG changeset patch -# User jcm -# Date 1484137609 28800 -# Wed Jan 11 04:26:49 2017 -0800 -# Node ID 1faf7c17089922f6f72b580253725f2ecb6ba2f8 -# Parent 3d07e14d65bc223dbfe94be9224e4aa8c6e63762 -8164293, PR3412, RH1459641: HotSpot leaking memory in long-running requests -Summary: Applied RMs in sweep_code_cache and related codes. -Reviewed-by: kvn, thartmann - -diff -r 3d07e14d65bc -r 1faf7c170899 src/share/vm/code/nmethod.cpp ---- openjdk/hotspot/src/share/vm/code/nmethod.cpp -+++ openjdk/hotspot/src/share/vm/code/nmethod.cpp -@@ -1172,6 +1172,7 @@ - // Clear ICStubs of all compiled ICs - void nmethod::clear_ic_stubs() { - assert_locked_or_safepoint(CompiledIC_lock); -+ ResourceMark rm; - RelocIterator iter(this); - while(iter.next()) { - if (iter.type() == relocInfo::virtual_call_type) { -diff -r 3d07e14d65bc -r 1faf7c170899 src/share/vm/runtime/sweeper.cpp ---- openjdk/hotspot/src/share/vm/runtime/sweeper.cpp -+++ openjdk/hotspot/src/share/vm/runtime/sweeper.cpp -@@ -319,6 +319,7 @@ - } - - void NMethodSweeper::sweep_code_cache() { -+ ResourceMark rm; - Ticks sweep_start_counter = Ticks::now(); - - _flushed_count = 0; -@@ -626,6 +627,7 @@ - // state of the code cache if it's requested. - void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { - if (PrintMethodFlushing) { -+ ResourceMark rm; - stringStream s; - // Dump code cache state into a buffer before locking the tty, - // because log_state() will use locks causing lock conflicts. -@@ -643,6 +645,7 @@ - } - - if (LogCompilation && (xtty != NULL)) { -+ ResourceMark rm; - stringStream s; - // Dump code cache state into a buffer before locking the tty, - // because log_state() will use locks causing lock conflicts.
--- a/patches/hotspot/aarch32/8173941-pr3326.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -# HG changeset patch -# User ysuenaga -# Date 1487123491 18000 -# Tue Feb 14 20:51:31 2017 -0500 -# Node ID 15922b2f31db4857ec84efdf533c41b19e68030b -# Parent 652fe741b8f2bfdacba66d772cc89fe7ec6dea66 -8173941, PR3326: SA does not work if executable is DSO -Reviewed-by: aph, dsamersoff - -diff --git a/agent/src/os/linux/elfmacros.h b/agent/src/os/linux/elfmacros.h ---- openjdk/hotspot/agent/src/os/linux/elfmacros.h -+++ openjdk/hotspot/agent/src/os/linux/elfmacros.h -@@ -33,6 +33,7 @@ - #define ELF_NHDR Elf64_Nhdr - #define ELF_DYN Elf64_Dyn - #define ELF_ADDR Elf64_Addr -+#define ELF_AUXV Elf64_auxv_t - - #define ELF_ST_TYPE ELF64_ST_TYPE - -@@ -45,6 +46,7 @@ - #define ELF_NHDR Elf32_Nhdr - #define ELF_DYN Elf32_Dyn - #define ELF_ADDR Elf32_Addr -+#define ELF_AUXV Elf32_auxv_t - - #define ELF_ST_TYPE ELF32_ST_TYPE - -diff --git a/agent/src/os/linux/ps_core.c b/agent/src/os/linux/ps_core.c ---- openjdk/hotspot/agent/src/os/linux/ps_core.c -+++ openjdk/hotspot/agent/src/os/linux/ps_core.c -@@ -642,6 +642,18 @@ - if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { - return false; - } -+ } else if (notep->n_type == NT_AUXV) { -+ // Get first segment from entry point -+ ELF_AUXV *auxv = (ELF_AUXV *)descdata; -+ while (auxv->a_type != AT_NULL) { -+ if (auxv->a_type == AT_ENTRY) { -+ // Set entry point address to address of dynamic section. -+ // We will adjust it in read_exec_segments(). -+ ph->core->dynamic_addr = auxv->a_un.a_val; -+ break; -+ } -+ auxv++; -+ } - } - p = descdata + ROUNDUP(notep->n_descsz, 4); - } -@@ -826,7 +838,13 @@ - - // from PT_DYNAMIC we want to read address of first link_map addr - case PT_DYNAMIC: { -- ph->core->dynamic_addr = exec_php->p_vaddr; -+ if (exec_ehdr->e_type == ET_EXEC) { -+ ph->core->dynamic_addr = exec_php->p_vaddr; -+ } else { // ET_DYN -+ // dynamic_addr has entry point of executable. -+ // Thus we should substract it. -+ ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; -+ } - print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); - break; - } -@@ -1024,8 +1042,9 @@ - goto err; - } - -- if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { -- print_debug("executable file is not a valid ELF ET_EXEC file\n"); -+ if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || -+ ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { -+ print_debug("executable file is not a valid ELF file\n"); - goto err; - } -
--- a/patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,283 +0,0 @@ -# HG changeset patch -# User gromero -# Date 1496364169 14400 -# Thu Jun 01 20:42:49 2017 -0400 -# Node ID 4dc64f3c3e2342970f091a1a73165a3e2a0c2f88 -# Parent d77ea5a8ca52f04fc087ea2785ed4087ff630806 -8175813, PR3394, RH1448880: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used -Reviewed-by: dholmes, zgu - -diff -r d77ea5a8ca52 -r 4dc64f3c3e23 src/os/linux/vm/os_linux.cpp ---- openjdk/hotspot/src/os/linux/vm/os_linux.cpp -+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp -@@ -2747,8 +2747,9 @@ - bool os::numa_topology_changed() { return false; } - - size_t os::numa_get_groups_num() { -- int max_node = Linux::numa_max_node(); -- return max_node > 0 ? max_node + 1 : 1; -+ // Return just the number of nodes in which it's possible to allocate memory -+ // (in numa terminology, configured nodes). -+ return Linux::numa_num_configured_nodes(); - } - - int os::numa_get_group_id() { -@@ -2762,11 +2763,33 @@ - return 0; - } - -+int os::Linux::get_existing_num_nodes() { -+ size_t node; -+ size_t highest_node_number = Linux::numa_max_node(); -+ int num_nodes = 0; -+ -+ // Get the total number of nodes in the system including nodes without memory. -+ for (node = 0; node <= highest_node_number; node++) { -+ if (isnode_in_existing_nodes(node)) { -+ num_nodes++; -+ } -+ } -+ return num_nodes; -+} -+ - size_t os::numa_get_leaf_groups(int *ids, size_t size) { -- for (size_t i = 0; i < size; i++) { -- ids[i] = i; -- } -- return size; -+ size_t highest_node_number = Linux::numa_max_node(); -+ size_t i = 0; -+ -+ // Map all node ids in which is possible to allocate memory. Also nodes are -+ // not always consecutively available, i.e. available from 0 to the highest -+ // node number. -+ for (size_t node = 0; node <= highest_node_number; node++) { -+ if (Linux::isnode_in_configured_nodes(node)) { -+ ids[i++] = node; -+ } -+ } -+ return i; - } - - bool os::get_page_info(char *start, page_info* info) { -@@ -2836,18 +2859,28 @@ - libnuma_dlsym(handle, "numa_node_to_cpus"))); - set_numa_max_node(CAST_TO_FN_PTR(numa_max_node_func_t, - libnuma_dlsym(handle, "numa_max_node"))); -+ set_numa_num_configured_nodes(CAST_TO_FN_PTR(numa_num_configured_nodes_func_t, -+ libnuma_dlsym(handle, "numa_num_configured_nodes"))); - set_numa_available(CAST_TO_FN_PTR(numa_available_func_t, - libnuma_dlsym(handle, "numa_available"))); - set_numa_tonode_memory(CAST_TO_FN_PTR(numa_tonode_memory_func_t, - libnuma_dlsym(handle, "numa_tonode_memory"))); - set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t, -- libnuma_dlsym(handle, "numa_interleave_memory"))); -+ libnuma_dlsym(handle, "numa_interleave_memory"))); - set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t, -- libnuma_dlsym(handle, "numa_set_bind_policy"))); -- -+ libnuma_dlsym(handle, "numa_set_bind_policy"))); -+ set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t, -+ libnuma_dlsym(handle, "numa_bitmask_isbitset"))); -+ set_numa_distance(CAST_TO_FN_PTR(numa_distance_func_t, -+ libnuma_dlsym(handle, "numa_distance"))); - - if (numa_available() != -1) { - set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes")); -+ set_numa_all_nodes_ptr((struct bitmask **)libnuma_dlsym(handle, "numa_all_nodes_ptr")); -+ set_numa_nodes_ptr((struct bitmask **)libnuma_dlsym(handle, "numa_nodes_ptr")); -+ // Create an index -> node mapping, since nodes are not always consecutive -+ _nindex_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<int>(0, true); -+ rebuild_nindex_to_node_map(); - // Create a cpu -> node mapping - _cpu_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<int>(0, true); - rebuild_cpu_to_node_map(); -@@ -2858,6 +2891,17 @@ - return false; - } - -+void os::Linux::rebuild_nindex_to_node_map() { -+ int highest_node_number = Linux::numa_max_node(); -+ -+ nindex_to_node()->clear(); -+ for (int node = 0; node <= highest_node_number; node++) { -+ if (Linux::isnode_in_existing_nodes(node)) { -+ nindex_to_node()->append(node); -+ } -+ } -+} -+ - // rebuild_cpu_to_node_map() constructs a table mapping cpud id to node id. - // The table is later used in get_node_by_cpu(). - void os::Linux::rebuild_cpu_to_node_map() { -@@ -2877,16 +2921,46 @@ - - cpu_to_node()->clear(); - cpu_to_node()->at_grow(cpu_num - 1); -- size_t node_num = numa_get_groups_num(); -- -+ -+ size_t node_num = get_existing_num_nodes(); -+ -+ int distance = 0; -+ int closest_distance = INT_MAX; -+ int closest_node = 0; - unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal); - for (size_t i = 0; i < node_num; i++) { -- if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) { -+ // Check if node is configured (not a memory-less node). If it is not, find -+ // the closest configured node. -+ if (!isnode_in_configured_nodes(nindex_to_node()->at(i))) { -+ closest_distance = INT_MAX; -+ // Check distance from all remaining nodes in the system. Ignore distance -+ // from itself and from another non-configured node. -+ for (size_t m = 0; m < node_num; m++) { -+ if (m != i && isnode_in_configured_nodes(nindex_to_node()->at(m))) { -+ distance = numa_distance(nindex_to_node()->at(i), nindex_to_node()->at(m)); -+ // If a closest node is found, update. There is always at least one -+ // configured node in the system so there is always at least one node -+ // close. -+ if (distance != 0 && distance < closest_distance) { -+ closest_distance = distance; -+ closest_node = nindex_to_node()->at(m); -+ } -+ } -+ } -+ } else { -+ // Current node is already a configured node. -+ closest_node = nindex_to_node()->at(i); -+ } -+ -+ // Get cpus from the original node and map them to the closest node. If node -+ // is a configured node (not a memory-less node), then original node and -+ // closest node are the same. -+ if (numa_node_to_cpus(nindex_to_node()->at(i), cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) { - for (size_t j = 0; j < cpu_map_valid_size; j++) { - if (cpu_map[j] != 0) { - for (size_t k = 0; k < BitsPerCLong; k++) { - if (cpu_map[j] & (1UL << k)) { -- cpu_to_node()->at_put(j * BitsPerCLong + k, i); -+ cpu_to_node()->at_put(j * BitsPerCLong + k, closest_node); - } - } - } -@@ -2904,14 +2978,20 @@ - } - - GrowableArray<int>* os::Linux::_cpu_to_node; -+GrowableArray<int>* os::Linux::_nindex_to_node; - os::Linux::sched_getcpu_func_t os::Linux::_sched_getcpu; - os::Linux::numa_node_to_cpus_func_t os::Linux::_numa_node_to_cpus; - os::Linux::numa_max_node_func_t os::Linux::_numa_max_node; -+os::Linux::numa_num_configured_nodes_func_t os::Linux::_numa_num_configured_nodes; - os::Linux::numa_available_func_t os::Linux::_numa_available; - os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory; - os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory; - os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; -+os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset; -+os::Linux::numa_distance_func_t os::Linux::_numa_distance; - unsigned long* os::Linux::_numa_all_nodes; -+struct bitmask* os::Linux::_numa_all_nodes_ptr; -+struct bitmask* os::Linux::_numa_nodes_ptr; - - bool os::pd_uncommit_memory(char* addr, size_t size) { - uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE, -diff -r d77ea5a8ca52 -r 4dc64f3c3e23 src/os/linux/vm/os_linux.hpp ---- openjdk/hotspot/src/os/linux/vm/os_linux.hpp -+++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp -@@ -67,6 +67,7 @@ - static bool _supports_fast_thread_cpu_time; - - static GrowableArray<int>* _cpu_to_node; -+ static GrowableArray<int>* _nindex_to_node; - - protected: - -@@ -94,7 +95,9 @@ - static void set_is_floating_stack() { _is_floating_stack = true; } - - static void rebuild_cpu_to_node_map(); -+ static void rebuild_nindex_to_node_map(); - static GrowableArray<int>* cpu_to_node() { return _cpu_to_node; } -+ static GrowableArray<int>* nindex_to_node() { return _nindex_to_node; } - - static size_t find_large_page_size(); - static size_t setup_large_page_size(); -@@ -243,28 +246,41 @@ - typedef int (*sched_getcpu_func_t)(void); - typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); - typedef int (*numa_max_node_func_t)(void); -+ typedef int (*numa_num_configured_nodes_func_t)(void); - typedef int (*numa_available_func_t)(void); - typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node); - typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); - typedef void (*numa_set_bind_policy_func_t)(int policy); -+ typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); -+ typedef int (*numa_distance_func_t)(int node1, int node2); - - static sched_getcpu_func_t _sched_getcpu; - static numa_node_to_cpus_func_t _numa_node_to_cpus; - static numa_max_node_func_t _numa_max_node; -+ static numa_num_configured_nodes_func_t _numa_num_configured_nodes; - static numa_available_func_t _numa_available; - static numa_tonode_memory_func_t _numa_tonode_memory; - static numa_interleave_memory_func_t _numa_interleave_memory; - static numa_set_bind_policy_func_t _numa_set_bind_policy; -+ static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset; -+ static numa_distance_func_t _numa_distance; - static unsigned long* _numa_all_nodes; -+ static struct bitmask* _numa_all_nodes_ptr; -+ static struct bitmask* _numa_nodes_ptr; - - static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; } - static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; } - static void set_numa_max_node(numa_max_node_func_t func) { _numa_max_node = func; } -+ static void set_numa_num_configured_nodes(numa_num_configured_nodes_func_t func) { _numa_num_configured_nodes = func; } - static void set_numa_available(numa_available_func_t func) { _numa_available = func; } - static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; } - static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; } - static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; } -+ static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; } -+ static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; } - static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; } -+ static void set_numa_all_nodes_ptr(struct bitmask **ptr) { _numa_all_nodes_ptr = *ptr; } -+ static void set_numa_nodes_ptr(struct bitmask **ptr) { _numa_nodes_ptr = *ptr; } - static int sched_getcpu_syscall(void); - public: - static int sched_getcpu() { return _sched_getcpu != NULL ? _sched_getcpu() : -1; } -@@ -272,6 +288,9 @@ - return _numa_node_to_cpus != NULL ? _numa_node_to_cpus(node, buffer, bufferlen) : -1; - } - static int numa_max_node() { return _numa_max_node != NULL ? _numa_max_node() : -1; } -+ static int numa_num_configured_nodes() { -+ return _numa_num_configured_nodes != NULL ? _numa_num_configured_nodes() : -1; -+ } - static int numa_available() { return _numa_available != NULL ? _numa_available() : -1; } - static int numa_tonode_memory(void *start, size_t size, int node) { - return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1; -@@ -286,7 +305,25 @@ - _numa_set_bind_policy(policy); - } - } -+ static int numa_distance(int node1, int node2) { -+ return _numa_distance != NULL ? _numa_distance(node1, node2) : -1; -+ } - static int get_node_by_cpu(int cpu_id); -+ static int get_existing_num_nodes(); -+ // Check if numa node is configured (non-zero memory node). -+ static bool isnode_in_configured_nodes(unsigned int n) { -+ if (_numa_bitmask_isbitset != NULL && _numa_all_nodes_ptr != NULL) { -+ return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n); -+ } else -+ return 0; -+ } -+ // Check if numa node exists in the system (including zero memory nodes). -+ static bool isnode_in_existing_nodes(unsigned int n) { -+ if (_numa_bitmask_isbitset != NULL && _numa_nodes_ptr != NULL) { -+ return _numa_bitmask_isbitset(_numa_nodes_ptr, n); -+ } else -+ return 0; -+ } - }; - -
--- a/patches/hotspot/aarch32/8175887-pr3415.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -# HG changeset patch -# User shade -# Date 1488979372 -3600 -# Wed Mar 08 14:22:52 2017 +0100 -# Node ID 654b7fcb4932d48063f5f1fba0c8994db5e02976 -# Parent 1faf7c17089922f6f72b580253725f2ecb6ba2f8 -8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect -Reviewed-by: vlivanov - -diff -r 1faf7c170899 -r 654b7fcb4932 src/share/vm/c1/c1_ValueMap.hpp ---- openjdk/hotspot/src/share/vm/c1/c1_ValueMap.hpp -+++ openjdk/hotspot/src/share/vm/c1/c1_ValueMap.hpp -@@ -158,6 +158,12 @@ - void do_UnsafePutRaw (UnsafePutRaw* x) { kill_memory(); } - void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); } - void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { kill_memory(); } -+ void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ } -+ void do_UnsafeGetObject(UnsafeGetObject* x) { -+ if (x->is_volatile()) { // the JMM requires this -+ kill_memory(); -+ } -+ } - void do_Intrinsic (Intrinsic* x) { if (!x->preserves_state()) kill_memory(); } - - void do_Phi (Phi* x) { /* nothing to do */ } -@@ -198,8 +204,6 @@ - void do_OsrEntry (OsrEntry* x) { /* nothing to do */ } - void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ } - void do_RoundFP (RoundFP* x) { /* nothing to do */ } -- void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ } -- void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ } - void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ } - void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ } - void do_ProfileCall (ProfileCall* x) { /* nothing to do */ } -diff -r 1faf7c170899 -r 654b7fcb4932 test/compiler/c1/UnsafeVolatileGuardTest.java ---- /dev/null -+++ openjdk/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java -@@ -0,0 +1,72 @@ -+/* -+ * Copyright (c) 2017, Red Hat Inc. 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.reflect.Field; -+ -+/** -+ * @test -+ * @bug 8175887 -+ * @summary C1 value numbering handling of Unsafe.get*Volatile is incorrect -+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 UnsafeVolatileGuardTest -+ */ -+public class UnsafeVolatileGuardTest { -+ volatile static private int a; -+ static private int b; -+ -+ static final sun.misc.Unsafe UNSAFE; -+ -+ static final Object BASE; -+ static final long OFFSET; -+ -+ static { -+ try { -+ Field uf = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); -+ uf.setAccessible(true); -+ UNSAFE = (sun.misc.Unsafe)uf.get(null); -+ -+ Field f = UnsafeVolatileGuardTest.class.getDeclaredField("a"); -+ BASE = UNSAFE.staticFieldBase(f); -+ OFFSET = UNSAFE.staticFieldOffset(f); -+ } catch (Exception e) { -+ throw new RuntimeException(e); -+ } -+ } -+ -+ static void test() { -+ int tt = b; // makes the JVM CSE the value of b -+ -+ while (UNSAFE.getIntVolatile(BASE, OFFSET) == 0) {} // burn -+ if (b == 0) { -+ System.err.println("wrong value of b"); -+ System.exit(1); // fail hard to report the error -+ } -+ } -+ -+ public static void main(String [] args) throws Exception { -+ for (int i = 0; i < 10; i++) { -+ new Thread(UnsafeVolatileGuardTest::test).start(); -+ } -+ b = 1; -+ a = 1; -+ } -+} -diff -r 1faf7c170899 -r 654b7fcb4932 test/compiler/c1/VolatileGuardTest.java ---- /dev/null -+++ openjdk/hotspot/test/compiler/c1/VolatileGuardTest.java -@@ -0,0 +1,52 @@ -+/* -+ * Copyright (c) 2017, Red Hat Inc. 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 8175887 -+ * @summary C1 doesn't respect the JMM with volatile field loads -+ * -+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 VolatileGuardTest -+ */ -+public class VolatileGuardTest { -+ volatile static private int a; -+ static private int b; -+ -+ static void test() { -+ int tt = b; // makes the JVM CSE the value of b -+ -+ while (a == 0) {} // burn -+ if (b == 0) { -+ System.err.println("wrong value of b"); -+ System.exit(1); // fail hard to report the error -+ } -+ } -+ -+ public static void main(String [] args) throws Exception { -+ for (int i = 0; i < 10; i++) { -+ new Thread(VolatileGuardTest::test).start(); -+ } -+ b = 1; -+ a = 1; -+ } -+}
--- a/patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -# HG changeset patch -# User dholmes -# Date 1493428477 14400 -# Fri Apr 28 21:14:37 2017 -0400 -# Node ID 2fee74c5547889d9698a2636e0a5170f9e66fb9c -# Parent 13a04e8df5a3af73794146b930b32556c7cbc5b0 -8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set -Reviewed-by: kbarrett, stefank - -diff -r 13a04e8df5a3 -r 2fee74c55478 src/share/vm/runtime/arguments.cpp ---- openjdk/hotspot/src/share/vm/runtime/arguments.cpp -+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp -@@ -3193,8 +3193,6 @@ - - // Enable parallel GC and adaptive generation sizing - FLAG_SET_CMDLINE(bool, UseParallelGC, true); -- FLAG_SET_DEFAULT(ParallelGCThreads, -- Abstract_VM_Version::parallel_worker_threads()); - - // Encourage steady state memory management - FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); -diff -r 13a04e8df5a3 -r 2fee74c55478 test/TEST.groups ---- openjdk/hotspot/test/TEST.groups -+++ openjdk/hotspot/test/TEST.groups -@@ -1,5 +1,5 @@ - # --# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2013, 2017, 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 -@@ -164,6 +164,7 @@ - gc/TestGCLogRotationViaJcmd.java \ - gc/g1/TestHumongousAllocInitialMark.java \ - gc/g1/TestHumongousShrinkHeap.java \ -+ gc/arguments/TestAggressiveHeap.java \ - gc/arguments/TestG1HeapRegionSize.java \ - gc/metaspace/TestMetaspaceMemoryPool.java \ - gc/arguments/TestDynMinHeapFreeRatio.java \ -diff -r 13a04e8df5a3 -r 2fee74c55478 test/gc/arguments/TestAggressiveHeap.java ---- /dev/null -+++ openjdk/hotspot/test/gc/arguments/TestAggressiveHeap.java -@@ -0,0 +1,91 @@ -+/* -+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* -+ * @test TestAggressiveHeap -+ * @key gc -+ * @bug 8179084 -+ * @summary Test argument processing for -XX:+AggressiveHeap. -+ * @library /testlibrary -+ * @run driver TestAggressiveHeap -+ */ -+ -+import java.lang.management.ManagementFactory; -+import javax.management.MBeanServer; -+import javax.management.ObjectName; -+ -+import com.oracle.java.testlibrary.OutputAnalyzer; -+import com.oracle.java.testlibrary.ProcessTools; -+ -+public class TestAggressiveHeap { -+ -+ public static void main(String args[]) throws Exception { -+ if (canUseAggressiveHeapOption()) { -+ testFlag(); -+ } -+ } -+ -+ // Note: Not a normal boolean flag; -XX:-AggressiveHeap is invalid. -+ private static final String option = "-XX:+AggressiveHeap"; -+ -+ // Option requires at least 256M, else error during option processing. -+ private static final long minMemory = 256 * 1024 * 1024; -+ -+ // bool UseParallelGC := true {product} -+ private static final String parallelGCPattern = -+ " *bool +UseParallelGC *:= *true +\\{product\\}"; -+ -+ private static void testFlag() throws Exception { -+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( -+ option, "-XX:+PrintFlagsFinal", "-version"); -+ -+ OutputAnalyzer output = new OutputAnalyzer(pb.start()); -+ -+ output.shouldHaveExitValue(0); -+ -+ String value = output.firstMatch(parallelGCPattern); -+ if (value == null) { -+ throw new RuntimeException( -+ option + " didn't set UseParallelGC"); -+ } -+ } -+ -+ private static boolean haveRequiredMemory() throws Exception { -+ MBeanServer server = ManagementFactory.getPlatformMBeanServer(); -+ ObjectName os = new ObjectName("java.lang", "type", "OperatingSystem"); -+ Object attr = server.getAttribute(os, "TotalPhysicalMemorySize"); -+ String value = attr.toString(); -+ long memory = Long.parseLong(value); -+ return memory >= minMemory; -+ } -+ -+ private static boolean canUseAggressiveHeapOption() throws Exception { -+ if (!haveRequiredMemory()) { -+ System.out.println( -+ "Skipping test of " + option + " : insufficient memory"); -+ return false; -+ } -+ return true; -+ } -+} -+
--- a/patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,288 +0,0 @@ -# HG changeset patch -# User tschatzl -# Date 1494843615 -7200 -# Mon May 15 12:20:15 2017 +0200 -# Node ID 3d07e14d65bc223dbfe94be9224e4aa8c6e63762 -# Parent 2fee74c5547889d9698a2636e0a5170f9e66fb9c -8180048, PR3411, RH1449870: Interned string and symbol table leak memory during parallel unlinking -Summary: Make appending found dead BasicHashtableEntrys to the free list atomic. -Reviewed-by: ehelin, shade - -diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/classfile/symbolTable.cpp ---- openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp -+++ openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1997, 2017, 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 -@@ -96,7 +96,7 @@ - int SymbolTable::_symbols_counted = 0; - volatile int SymbolTable::_parallel_claimed_idx = 0; - --void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total) { -+void SymbolTable::buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context, size_t* memory_total) { - for (int i = start_idx; i < end_idx; ++i) { - HashtableEntry<Symbol*, mtSymbol>** p = the_table()->bucket_addr(i); - HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i); -@@ -110,15 +110,14 @@ - } - Symbol* s = entry->literal(); - (*memory_total) += s->size(); -- (*processed)++; -+ context->_num_processed++; - assert(s != NULL, "just checking"); - // If reference count is zero, remove. - if (s->refcount() == 0) { - assert(!entry->is_shared(), "shared entries should be kept live"); - delete s; -- (*removed)++; - *p = entry->next(); -- the_table()->free_entry(entry); -+ context->free_entry(entry); - } else { - p = entry->next_addr(); - } -@@ -132,9 +131,14 @@ - // This is done late during GC. - void SymbolTable::unlink(int* processed, int* removed) { - size_t memory_total = 0; -- buckets_unlink(0, the_table()->table_size(), processed, removed, &memory_total); -- _symbols_removed += *removed; -- _symbols_counted += *processed; -+ BucketUnlinkContext context; -+ buckets_unlink(0, the_table()->table_size(), &context, &memory_total); -+ _the_table->bulk_free_entries(&context); -+ *processed = context._num_processed; -+ *removed = context._num_removed; -+ -+ _symbols_removed = context._num_removed; -+ _symbols_counted = context._num_processed; - // Exclude printing for normal PrintGCDetails because people parse - // this output. - if (PrintGCDetails && Verbose && WizardMode) { -@@ -148,6 +152,7 @@ - - size_t memory_total = 0; - -+ BucketUnlinkContext context; - for (;;) { - // Grab next set of buckets to scan - int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize; -@@ -157,10 +162,15 @@ - } - - int end_idx = MIN2(limit, start_idx + ClaimChunkSize); -- buckets_unlink(start_idx, end_idx, processed, removed, &memory_total); -+ buckets_unlink(start_idx, end_idx, &context, &memory_total); - } -- Atomic::add(*processed, &_symbols_counted); -- Atomic::add(*removed, &_symbols_removed); -+ -+ _the_table->bulk_free_entries(&context); -+ *processed = context._num_processed; -+ *removed = context._num_removed; -+ -+ Atomic::add(context._num_processed, &_symbols_counted); -+ Atomic::add(context._num_removed, &_symbols_removed); - // Exclude printing for normal PrintGCDetails because people parse - // this output. - if (PrintGCDetails && Verbose && WizardMode) { -@@ -811,7 +821,11 @@ - } - - void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) { -- buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, removed); -+ BucketUnlinkContext context; -+ buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), &context); -+ _the_table->bulk_free_entries(&context); -+ *processed = context._num_processed; -+ *removed = context._num_removed; - } - - void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) { -@@ -820,6 +834,7 @@ - assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); - const int limit = the_table()->table_size(); - -+ BucketUnlinkContext context; - for (;;) { - // Grab next set of buckets to scan - int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize; -@@ -829,8 +844,11 @@ - } - - int end_idx = MIN2(limit, start_idx + ClaimChunkSize); -- buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed); -+ buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, &context); - } -+ _the_table->bulk_free_entries(&context); -+ *processed = context._num_processed; -+ *removed = context._num_removed; - } - - void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) { -@@ -856,7 +874,7 @@ - } - } - --void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) { -+void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context) { - const int limit = the_table()->table_size(); - - assert(0 <= start_idx && start_idx <= limit, -@@ -880,10 +898,9 @@ - p = entry->next_addr(); - } else { - *p = entry->next(); -- the_table()->free_entry(entry); -- (*removed)++; -+ context->free_entry(entry); - } -- (*processed)++; -+ context->_num_processed++; - entry = *p; - } - } -diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/classfile/symbolTable.hpp ---- openjdk/hotspot/src/share/vm/classfile/symbolTable.hpp -+++ openjdk/hotspot/src/share/vm/classfile/symbolTable.hpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1997, 2017, 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 -@@ -124,8 +124,11 @@ - - static volatile int _parallel_claimed_idx; - -- // Release any dead symbols -- static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total); -+ typedef SymbolTable::BucketUnlinkContext BucketUnlinkContext; -+ // Release any dead symbols. Unlinked bucket entries are collected in the given -+ // context to be freed later. -+ // This allows multiple threads to work on the table at once. -+ static void buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context, size_t* memory_total); - public: - enum { - symbol_alloc_batch_size = 8, -@@ -274,9 +277,13 @@ - // Apply the give oop closure to the entries to the buckets - // in the range [start_idx, end_idx). - static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx); -+ -+ typedef StringTable::BucketUnlinkContext BucketUnlinkContext; - // Unlink or apply the give oop closure to the entries to the buckets -- // in the range [start_idx, end_idx). -- static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed); -+ // in the range [start_idx, end_idx). Unlinked bucket entries are collected in the given -+ // context to be freed later. -+ // This allows multiple threads to work on the table at once. -+ static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context); - - StringTable() : RehashableHashtable<oop, mtSymbol>((int)StringTableSize, - sizeof (HashtableEntry<oop, mtSymbol>)) {} -diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/runtime/vmStructs.cpp ---- openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp -+++ openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp -@@ -712,7 +712,7 @@ - \ - nonstatic_field(BasicHashtable<mtInternal>, _table_size, int) \ - nonstatic_field(BasicHashtable<mtInternal>, _buckets, HashtableBucket<mtInternal>*) \ -- nonstatic_field(BasicHashtable<mtInternal>, _free_list, BasicHashtableEntry<mtInternal>*) \ -+ volatile_nonstatic_field(BasicHashtable<mtInternal>, _free_list, BasicHashtableEntry<mtInternal>*) \ - nonstatic_field(BasicHashtable<mtInternal>, _first_free_entry, char*) \ - nonstatic_field(BasicHashtable<mtInternal>, _end_block, char*) \ - nonstatic_field(BasicHashtable<mtInternal>, _entry_size, int) \ -diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/utilities/hashtable.cpp ---- openjdk/hotspot/src/share/vm/utilities/hashtable.cpp -+++ openjdk/hotspot/src/share/vm/utilities/hashtable.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2003, 2017, 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 -@@ -172,6 +172,35 @@ - } - } - -+template <MEMFLAGS F> void BasicHashtable<F>::BucketUnlinkContext::free_entry(BasicHashtableEntry<F>* entry) { -+ entry->set_next(_removed_head); -+ _removed_head = entry; -+ if (_removed_tail == NULL) { -+ _removed_tail = entry; -+ } -+ _num_removed++; -+} -+ -+template <MEMFLAGS F> void BasicHashtable<F>::bulk_free_entries(BucketUnlinkContext* context) { -+ if (context->_num_removed == 0) { -+ assert(context->_removed_head == NULL && context->_removed_tail == NULL, -+ err_msg("Zero entries in the unlink context, but elements linked from " PTR_FORMAT " to " PTR_FORMAT, -+ p2i(context->_removed_head), p2i(context->_removed_tail))); -+ return; -+ } -+ -+ // MT-safe add of the list of BasicHashTableEntrys from the context to the free list. -+ BasicHashtableEntry<F>* current = _free_list; -+ while (true) { -+ context->_removed_tail->set_next(current); -+ BasicHashtableEntry<F>* old = (BasicHashtableEntry<F>*)Atomic::cmpxchg_ptr(context->_removed_head, &_free_list, current); -+ if (old == current) { -+ break; -+ } -+ current = old; -+ } -+ Atomic::add(-context->_num_removed, &_number_of_entries); -+} - - // Copy the table to the shared space. - -diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/utilities/hashtable.hpp ---- openjdk/hotspot/src/share/vm/utilities/hashtable.hpp -+++ openjdk/hotspot/src/share/vm/utilities/hashtable.hpp -@@ -164,11 +164,11 @@ - // Instance variables - int _table_size; - HashtableBucket<F>* _buckets; -- BasicHashtableEntry<F>* _free_list; -+ BasicHashtableEntry<F>* volatile _free_list; - char* _first_free_entry; - char* _end_block; - int _entry_size; -- int _number_of_entries; -+ volatile int _number_of_entries; - - protected: - -@@ -215,6 +215,24 @@ - // Free the buckets in this hashtable - void free_buckets(); - -+ // Helper data structure containing context for the bucket entry unlink process, -+ // storing the unlinked buckets in a linked list. -+ // Also avoids the need to pass around these four members as parameters everywhere. -+ struct BucketUnlinkContext { -+ int _num_processed; -+ int _num_removed; -+ // Head and tail pointers for the linked list of removed entries. -+ BasicHashtableEntry<F>* _removed_head; -+ BasicHashtableEntry<F>* _removed_tail; -+ -+ BucketUnlinkContext() : _num_processed(0), _num_removed(0), _removed_head(NULL), _removed_tail(NULL) { -+ } -+ -+ void free_entry(BasicHashtableEntry<F>* entry); -+ }; -+ // Add of bucket entries linked together in the given context to the global free list. This method -+ // is mt-safe wrt. to other calls of this method. -+ void bulk_free_entries(BucketUnlinkContext* context); - public: - int table_size() { return _table_size; } - void set_entry(int index, BasicHashtableEntry<F>* entry);
--- a/patches/hotspot/aarch32/8180711.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -# HG changeset patch -# User hseigel -# Date 1501595265 14400 -# Tue Aug 01 09:47:45 2017 -0400 -# Node ID 158904fa31b28f1e027dc5b5a833ee673e89a84b -# Parent 1ce0f165155c0b80deb76473a7576fae917af2f7 -8180711: Better invokespecial checks -Reviewed-by: acorn, ahgross, rhalade -Contributed-by: harold.seigel@oracle.com - -diff --git a/src/share/vm/interpreter/linkResolver.cpp b/src/share/vm/interpreter/linkResolver.cpp ---- openjdk/hotspot/src/share/vm/interpreter/linkResolver.cpp -+++ openjdk/hotspot/src/share/vm/interpreter/linkResolver.cpp -@@ -538,6 +538,42 @@ - } - } - -+void LinkResolver::check_method_loader_constraints(methodHandle& resolved_method, -+ KlassHandle resolved_klass, -+ Symbol* method_name, -+ Symbol* method_signature, -+ KlassHandle current_klass, -+ const char* method_type, TRAPS) { -+ Handle loader (THREAD, InstanceKlass::cast(current_klass())->class_loader()); -+ Handle class_loader (THREAD, resolved_method->method_holder()->class_loader()); -+ { -+ ResourceMark rm(THREAD); -+ Symbol* failed_type_symbol = -+ SystemDictionary::check_signature_loaders(method_signature, loader, -+ class_loader, true, CHECK); -+ if (failed_type_symbol != NULL) { -+ const char* msg = "loader constraint violation: when resolving %s" -+ " \"%s\" the class loader (instance of %s) of the current class, %s," -+ " and the class loader (instance of %s) for the method's defining class, %s, have" -+ " different Class objects for the type %s used in the signature"; -+ char* sig = Method::name_and_sig_as_C_string(resolved_klass(), method_name, method_signature); -+ const char* loader1 = SystemDictionary::loader_name(loader()); -+ char* current = InstanceKlass::cast(current_klass())->name()->as_C_string(); -+ const char* loader2 = SystemDictionary::loader_name(class_loader()); -+ char* target = InstanceKlass::cast(resolved_method->method_holder()) -+ ->name()->as_C_string(); -+ char* failed_type_name = failed_type_symbol->as_C_string(); -+ size_t buflen = strlen(msg) + strlen(sig) + strlen(loader1) + -+ strlen(current) + strlen(loader2) + strlen(target) + -+ strlen(failed_type_name) + strlen(method_type) + 1; -+ char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); -+ jio_snprintf(buf, buflen, msg, method_type, sig, loader1, current, loader2, -+ target, failed_type_name); -+ THROW_MSG(vmSymbols::java_lang_LinkageError(), buf); -+ } -+ } -+} -+ - void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle resolved_klass, - Symbol* method_name, Symbol* method_signature, - KlassHandle current_klass, bool check_access, -@@ -594,34 +630,8 @@ - CHECK); - - // check loader constraints -- Handle loader (THREAD, InstanceKlass::cast(current_klass())->class_loader()); -- Handle class_loader (THREAD, resolved_method->method_holder()->class_loader()); -- { -- ResourceMark rm(THREAD); -- Symbol* failed_type_symbol = -- SystemDictionary::check_signature_loaders(method_signature, loader, -- class_loader, true, CHECK); -- if (failed_type_symbol != NULL) { -- const char* msg = "loader constraint violation: when resolving method" -- " \"%s\" the class loader (instance of %s) of the current class, %s," -- " and the class loader (instance of %s) for the method's defining class, %s, have" -- " different Class objects for the type %s used in the signature"; -- char* sig = Method::name_and_sig_as_C_string(resolved_klass(),method_name,method_signature); -- const char* loader1 = SystemDictionary::loader_name(loader()); -- char* current = InstanceKlass::cast(current_klass())->name()->as_C_string(); -- const char* loader2 = SystemDictionary::loader_name(class_loader()); -- char* target = InstanceKlass::cast(resolved_method->method_holder()) -- ->name()->as_C_string(); -- char* failed_type_name = failed_type_symbol->as_C_string(); -- size_t buflen = strlen(msg) + strlen(sig) + strlen(loader1) + -- strlen(current) + strlen(loader2) + strlen(target) + -- strlen(failed_type_name) + 1; -- char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); -- jio_snprintf(buf, buflen, msg, sig, loader1, current, loader2, -- target, failed_type_name); -- THROW_MSG(vmSymbols::java_lang_LinkageError(), buf); -- } -- } -+ check_method_loader_constraints(resolved_method, resolved_klass, method_name, -+ method_signature, current_klass, "method", CHECK); - } - } - -@@ -670,36 +680,8 @@ - resolved_method, - CHECK); - -- HandleMark hm(THREAD); -- Handle loader (THREAD, InstanceKlass::cast(current_klass())->class_loader()); -- Handle class_loader (THREAD, resolved_method->method_holder()->class_loader()); -- { -- ResourceMark rm(THREAD); -- Symbol* failed_type_symbol = -- SystemDictionary::check_signature_loaders(method_signature, loader, -- class_loader, true, CHECK); -- if (failed_type_symbol != NULL) { -- const char* msg = "loader constraint violation: when resolving " -- "interface method \"%s\" the class loader (instance of %s) of the " -- "current class, %s, and the class loader (instance of %s) for " -- "the method's defining class, %s, have different Class objects for the type %s " -- "used in the signature"; -- char* sig = Method::name_and_sig_as_C_string(resolved_klass(),method_name,method_signature); -- const char* loader1 = SystemDictionary::loader_name(loader()); -- char* current = InstanceKlass::cast(current_klass())->name()->as_C_string(); -- const char* loader2 = SystemDictionary::loader_name(class_loader()); -- char* target = InstanceKlass::cast(resolved_method->method_holder()) -- ->name()->as_C_string(); -- char* failed_type_name = failed_type_symbol->as_C_string(); -- size_t buflen = strlen(msg) + strlen(sig) + strlen(loader1) + -- strlen(current) + strlen(loader2) + strlen(target) + -- strlen(failed_type_name) + 1; -- char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); -- jio_snprintf(buf, buflen, msg, sig, loader1, current, loader2, -- target, failed_type_name); -- THROW_MSG(vmSymbols::java_lang_LinkageError(), buf); -- } -- } -+ check_method_loader_constraints(resolved_method, resolved_klass, method_name, -+ method_signature, current_klass, "interface method", CHECK); - } - - if (nostatics && resolved_method->is_static()) { -@@ -1049,6 +1031,10 @@ - Method::name_and_sig_as_C_string(resolved_klass(), - resolved_method->name(), - resolved_method->signature())); -+ } else if (sel_method() != resolved_method()) { -+ check_method_loader_constraints(sel_method, resolved_klass, -+ sel_method->name(), sel_method->signature(), -+ current_klass, "method", CHECK); - } - } - -diff --git a/src/share/vm/interpreter/linkResolver.hpp b/src/share/vm/interpreter/linkResolver.hpp ---- openjdk/hotspot/src/share/vm/interpreter/linkResolver.hpp -+++ openjdk/hotspot/src/share/vm/interpreter/linkResolver.hpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1997, 2017, 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 -@@ -135,6 +135,9 @@ - static void resolve_pool (KlassHandle& resolved_klass, Symbol*& method_name, Symbol*& method_signature, KlassHandle& current_klass, constantPoolHandle pool, int index, TRAPS); - - static void resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool nostatics, TRAPS); -+ static void check_method_loader_constraints(methodHandle& resolved_method, KlassHandle resolved_klass, -+ Symbol* method_name, Symbol* method_signature, -+ KlassHandle current_klass, const char* method_type, TRAPS); - static void resolve_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool require_methodref, TRAPS); - - static void linktime_resolve_static_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS);
--- a/patches/hotspot/aarch32/8184682.patch Mon Jan 22 18:54:35 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -# HG changeset patch -# User coffeys -# Date 1502190121 -3600 -# Tue Aug 08 12:02:01 2017 +0100 -# Node ID 8b0169692abbf8fb7972920cd79cee7dcab959c3 -# Parent 689fd6652737c33f03ea95a867070f8053739623 -8184682: Upgrade compression library -Reviewed-by: alanb, sherman, ahgross, jeff - -diff -Nru openjdk.orig/hotspot/THIRD_PARTY_README openjdk/hotspot/THIRD_PARTY_README ---- openjdk.orig/hotspot/THIRD_PARTY_README 2017-08-09 11:27:53.000000000 +0100 -+++ openjdk/hotspot/THIRD_PARTY_README 2017-11-01 05:44:50.951552669 +0000 -@@ -2808,12 +2808,12 @@ - - ------------------------------------------------------------------------------- - --%% This notice is provided with respect to zlib v1.2.8, which may be included -+%% This notice is provided with respect to zlib v1.2.11, which may be included - with JRE 8, JDK 8, and OpenJDK 8. - - --- begin of LICENSE --- -- -- version 1.2.8, April 28th, 2013 -+ -+ version 1.2.11, January 15th, 2017 - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler -