diff --git a/8209894-ZGC-Cap-number-of-GC-workers-based-on-heap-s.patch b/8209894-ZGC-Cap-number-of-GC-workers-based-on-heap-s.patch index ef06ac23cae03e9ef9f371b31bcf2df2031e2d00..6ba8ad526b9d5d8380afa4977bfc0d9432eb27b8 100644 --- a/8209894-ZGC-Cap-number-of-GC-workers-based-on-heap-s.patch +++ b/8209894-ZGC-Cap-number-of-GC-workers-based-on-heap-s.patch @@ -73,13 +73,6 @@ diff --git a/src/hotspot/share/gc/z/zWorkers.hpp b/src/hotspot/share/gc/z/zWorke index 36a3c61fd..6ce09c447 100644 --- a/src/hotspot/share/gc/z/zWorkers.hpp +++ b/src/hotspot/share/gc/z/zWorkers.hpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,6 @@ private: bool _boost; WorkGang _workers; diff --git a/8214535-support-Jmap-parallel.patch b/8214535-support-Jmap-parallel.patch index 7dc84e29cdfb7995c83fc6b727fde8a4b81c2ac4..b613bd91d09535bd36fea450f70c957414e23032 100755 --- a/8214535-support-Jmap-parallel.patch +++ b/8214535-support-Jmap-parallel.patch @@ -61,8 +61,8 @@ index 7e9c6254c..fd2da14a3 100644 + heap_region_par_iterate_from_worker_offset(&blk, claimer, worker_id); +} + - void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const { - _hrm.iterate(cl); + void G1CollectedHeap::keep_alive(oop obj) { + G1BarrierSet::enqueue(obj); } diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index bb46cae83..82f59d69b 100644 diff --git a/8237483-AArch64-C1-OopMap-inserted-twice-fatal-error.patch b/8237483-AArch64-C1-OopMap-inserted-twice-fatal-error.patch deleted file mode 100644 index 10fc9e8a78d4f64ac725807f2dd2f06ea3b59357..0000000000000000000000000000000000000000 --- a/8237483-AArch64-C1-OopMap-inserted-twice-fatal-error.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -index 82abda9..df3addf 100644 ---- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -@@ -2045,6 +2045,13 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit - - // get current pc information - // pc is only needed if the method has an exception handler, the unwind code does not need it. -+ if (compilation()->debug_info_recorder()->last_pc_offset() == __ offset()) { -+ // As no instructions have been generated yet for this LIR node it's -+ // possible that an oop map already exists for the current offset. -+ // In that case insert an dummy NOP here to ensure all oop map PCs -+ // are unique. See JDK-8237483. -+ __ nop(); -+ } - int pc_for_athrow_offset = __ offset(); - InternalAddress pc_for_athrow(__ pc()); - __ adr(exceptionPC->as_register(), pc_for_athrow); diff --git a/8240353.patch b/8240353.patch deleted file mode 100755 index 6aa496caa3117ec3826f47450313ce22f014679d..0000000000000000000000000000000000000000 --- a/8240353.patch +++ /dev/null @@ -1,65 +0,0 @@ -commit 29fd7a83a66269e360af353c64d945612be62623 -Date: Thu Feb 4 16:37:53 2021 +0800 - - 8240353: AArch64: missing support for -XX:+ExtendedDTraceProbes in C1 - - Summary: : java -XX:+ExtendedDTraceProbes throws SIGILL - LLT: java -XX:+ExtendedDTraceProbes - Patch Type: backport - Bug url: https://bugs.openjdk.java.net/browse/JDK-8240353 - -diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -index 7798aa509..a8e89cde0 100644 ---- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * -@@ -449,12 +449,9 @@ int LIR_Assembler::emit_unwind_handler() { - } - - if (compilation()->env()->dtrace_method_probes()) { -- __ call_Unimplemented(); --#if 0 -- __ movptr(Address(rsp, 0), rax); -- __ mov_metadata(Address(rsp, sizeof(void*)), method()->constant_encoding()); -- __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit))); --#endif -+ __ mov(c_rarg0, rthread); -+ __ mov_metadata(c_rarg1, method()->constant_encoding()); -+ __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), c_rarg0, c_rarg1); - } - - if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) { -diff --git a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp -index 2344e0be3..3f5ab6641 100644 ---- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * -@@ -1123,6 +1123,16 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { - } - break; - -+ case dtrace_object_alloc_id: -+ { // c_rarg0: object -+ StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments); -+ save_live_registers(sasm); -+ -+ __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), c_rarg0); -+ -+ restore_live_registers(sasm); -+ } -+ break; - - default: - { StubFrame f(sasm, "unimplemented entry", dont_gc_arguments); diff --git a/8243670-Unexpected-test-result-caused-by-C2-MergeMem.patch b/8243670-Unexpected-test-result-caused-by-C2-MergeMem.patch deleted file mode 100644 index 245dfa6cce07c1852c9b66c72e6f93e53d767d59..0000000000000000000000000000000000000000 --- a/8243670-Unexpected-test-result-caused-by-C2-MergeMem.patch +++ /dev/null @@ -1,170 +0,0 @@ -diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp -index 8c59efb..e32b5e7 100644 ---- a/src/hotspot/share/opto/cfgnode.cpp -+++ b/src/hotspot/share/opto/cfgnode.cpp -@@ -1192,6 +1192,30 @@ Node* PhiNode::Identity(PhaseGVN* phase) { - if (id != NULL) return id; - } - -+ // Looking for phis with identical inputs. If we find one that has -+ // type TypePtr::BOTTOM, replace the current phi with the bottom phi. -+ if (phase->is_IterGVN() && type() == Type::MEMORY && adr_type() != -+ TypePtr::BOTTOM && !adr_type()->is_known_instance()) { -+ uint phi_len = req(); -+ Node* phi_reg = region(); -+ for (DUIterator_Fast imax, i = phi_reg->fast_outs(imax); i < imax; i++) { -+ Node* u = phi_reg->fast_out(i); -+ if (u->is_Phi() && u->as_Phi()->type() == Type::MEMORY && -+ u->adr_type() == TypePtr::BOTTOM && u->in(0) == phi_reg && -+ u->req() == phi_len) { -+ for (uint j = 1; j < phi_len; j++) { -+ if (in(j) != u->in(j)) { -+ u = NULL; -+ break; -+ } -+ } -+ if (u != NULL) { -+ return u; -+ } -+ } -+ } -+ } -+ - return this; // No identity - } - -diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp -index 9e22011..bc314c0 100644 ---- a/src/hotspot/share/opto/memnode.cpp -+++ b/src/hotspot/share/opto/memnode.cpp -@@ -4554,24 +4554,6 @@ Node *MergeMemNode::Ideal(PhaseGVN *phase, bool can_reshape) { - } - // else preceding memory was not a MergeMem - -- // replace equivalent phis (unfortunately, they do not GVN together) -- if (new_mem != NULL && new_mem != new_base && -- new_mem->req() == phi_len && new_mem->in(0) == phi_reg) { -- if (new_mem->is_Phi()) { -- PhiNode* phi_mem = new_mem->as_Phi(); -- for (uint i = 1; i < phi_len; i++) { -- if (phi_base->in(i) != phi_mem->in(i)) { -- phi_mem = NULL; -- break; -- } -- } -- if (phi_mem != NULL) { -- // equivalent phi nodes; revert to the def -- new_mem = new_base; -- } -- } -- } -- - // maybe store down a new value - Node* new_in = new_mem; - if (new_in == new_base) new_in = empty_mem; -diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp -index 8103c6f..5928f44 100644 ---- a/src/hotspot/share/opto/type.hpp -+++ b/src/hotspot/share/opto/type.hpp -@@ -453,6 +453,7 @@ public: - const Type* maybe_remove_speculative(bool include_speculative) const; - - virtual bool maybe_null() const { return true; } -+ virtual bool is_known_instance() const { return false; } - - private: - // support arrays -@@ -1390,6 +1391,10 @@ public: - return _ptrtype; - } - -+ bool is_known_instance() const { -+ return _ptrtype->is_known_instance(); -+ } -+ - #ifndef PRODUCT - virtual void dump2( Dict &d, uint depth, outputStream *st ) const; - #endif -diff --git a/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java b/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java -new file mode 100644 -index 0000000..d4c93b3 ---- /dev/null -+++ b/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java -@@ -0,0 +1,77 @@ -+/* -+ * Copyright (c) 2020, Huawei Technologies Co. Ltd. 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 8243670 -+ * @summary Unexpected test result caused by C2 MergeMemNode::Ideal -+ * -+ * @run main/othervm -Xcomp -XX:-SplitIfBlocks -+ * -XX:CompileOnly=compiler.c2.TestReplaceEquivPhis::test -+ * -XX:-BackgroundCompilation compiler.c2.TestReplaceEquivPhis -+ */ -+ -+package compiler.c2; -+ -+public class TestReplaceEquivPhis { -+ -+ public static final int N = 400; -+ public static volatile int instanceCount = 0; -+ public int iFld = 0; -+ public static int iArrFld[] = new int[N]; -+ -+ public int test() { -+ int v = 0; -+ boolean bArr[] = new boolean[N]; -+ -+ for (int i = 1; i < 344; i++) { -+ iFld = i; -+ for (int j = 2; j <177 ; j++) { -+ v = iFld; -+ iFld = TestReplaceEquivPhis.instanceCount; -+ TestReplaceEquivPhis.iArrFld[i] = 0; -+ iFld += TestReplaceEquivPhis.instanceCount; -+ TestReplaceEquivPhis.iArrFld[i] = 0; -+ bArr[j] = false; -+ TestReplaceEquivPhis.instanceCount = 1; -+ -+ for (int k = 1; k < 3; k++) { -+ // do nothing -+ } -+ } -+ } -+ return v; -+ } -+ -+ public static void main(String[] args) { -+ TestReplaceEquivPhis obj = new TestReplaceEquivPhis(); -+ for (int i = 0; i < 5; i++) { -+ int result = obj.test(); -+ if (result != 2) { -+ throw new RuntimeException("Test failed."); -+ } -+ } -+ System.out.println("Test passed."); -+ } -+ -+} diff --git a/8247766-aarch64-guarantee-val-1U--nbits-failed-Field-too-big-for-insn.patch b/8247766-aarch64-guarantee-val-1U--nbits-failed-Field-too-big-for-insn.patch deleted file mode 100644 index 57d4598ceaff88605ac493a29696a648059bbdd0..0000000000000000000000000000000000000000 --- a/8247766-aarch64-guarantee-val-1U--nbits-failed-Field-too-big-for-insn.patch +++ /dev/null @@ -1,257 +0,0 @@ -diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -index db582f25f..80ddb9b31 100644 ---- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -@@ -553,14 +553,7 @@ class Address { - - void lea(MacroAssembler *, Register) const; - -- static bool offset_ok_for_immed(long offset, int shift = 0) { -- unsigned mask = (1 << shift) - 1; -- if (offset < 0 || offset & mask) { -- return (uabs(offset) < (1 << (20 - 12))); // Unscaled offset -- } else { -- return ((offset >> shift) < (1 << (21 - 10 + 1))); // Scaled, unsigned offset -- } -- } -+ static bool offset_ok_for_immed(long offset, uint shift); - }; - - // Convience classes -diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp -index 86eb8c2f8..a475575bf 100644 ---- a/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp -+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp -@@ -30,4 +30,15 @@ - #include "asm/codeBuffer.hpp" - #include "code/codeCache.hpp" - -+inline bool Address::offset_ok_for_immed(long offset, uint shift = 0) { -+ uint mask = (1 << shift) - 1; -+ if (offset < 0 || (offset & mask) != 0) { -+ // Unscaled signed offset, encoded in a signed imm9 field. -+ return Assembler::is_simm9(offset); -+ } else { -+ // Scaled unsigned offset, encoded in an unsigned imm12:_ field. -+ return Assembler::is_uimm12(offset >> shift); -+ } -+} -+ - #endif // CPU_AARCH64_VM_ASSEMBLER_AARCH64_INLINE_HPP -diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -index f6a77dc78..7798aa509 100644 ---- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -@@ -226,6 +226,19 @@ Address LIR_Assembler::as_Address_lo(LIR_Address* addr) { - // FIXME: This needs to be much more clever. See x86. - } - -+// Ensure a valid Address (base + offset) to a stack-slot. If stack access is -+// not encodable as a base + (immediate) offset, generate an explicit address -+// calculation to hold the address in a temporary register. -+Address LIR_Assembler::stack_slot_address(int index, uint size, Register tmp, int adjust) { -+ precond(size == 4 || size == 8); -+ Address addr = frame_map()->address_for_slot(index, adjust); -+ precond(addr.getMode() == Address::base_plus_offset); -+ precond(addr.base() == sp); -+ precond(addr.offset() > 0); -+ uint mask = size - 1; -+ assert((addr.offset() & mask) == 0, "scaled offsets only"); -+ return __ legitimize_address(addr, size, tmp); -+} - - void LIR_Assembler::osr_entry() { - offsets()->set_value(CodeOffsets::OSR_Entry, code_offset()); -@@ -745,32 +758,38 @@ void LIR_Assembler::reg2reg(LIR_Opr src, LIR_Opr dest) { - } - - void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool pop_fpu_stack) { -+ precond(src->is_register() && dest->is_stack()); -+ -+ uint const c_sz32 = sizeof(uint32_t); -+ uint const c_sz64 = sizeof(uint64_t); -+ - if (src->is_single_cpu()) { -+ int index = dest->single_stack_ix(); - if (type == T_ARRAY || type == T_OBJECT) { -- __ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix())); -+ __ str(src->as_register(), stack_slot_address(index, c_sz64, rscratch1)); - __ verify_oop(src->as_register()); - } else if (type == T_METADATA || type == T_DOUBLE || type == T_ADDRESS) { -- __ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix())); -+ __ str(src->as_register(), stack_slot_address(index, c_sz64, rscratch1)); - } else { -- __ strw(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix())); -+ __ strw(src->as_register(), stack_slot_address(index, c_sz32, rscratch1)); - } - - } else if (src->is_double_cpu()) { -- Address dest_addr_LO = frame_map()->address_for_slot(dest->double_stack_ix(), lo_word_offset_in_bytes); -+ int index = dest->double_stack_ix(); -+ Address dest_addr_LO = stack_slot_address(index, c_sz64, rscratch1, lo_word_offset_in_bytes); - __ str(src->as_register_lo(), dest_addr_LO); - - } else if (src->is_single_fpu()) { -- Address dest_addr = frame_map()->address_for_slot(dest->single_stack_ix()); -- __ strs(src->as_float_reg(), dest_addr); -+ int index = dest->single_stack_ix(); -+ __ strs(src->as_float_reg(), stack_slot_address(index, c_sz32, rscratch1)); - - } else if (src->is_double_fpu()) { -- Address dest_addr = frame_map()->address_for_slot(dest->double_stack_ix()); -- __ strd(src->as_double_reg(), dest_addr); -+ int index = dest->double_stack_ix(); -+ __ strd(src->as_double_reg(), stack_slot_address(index, c_sz64, rscratch1)); - - } else { - ShouldNotReachHere(); - } -- - } - - -@@ -855,32 +874,34 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch - - - void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { -- assert(src->is_stack(), "should not call otherwise"); -- assert(dest->is_register(), "should not call otherwise"); -+ precond(src->is_stack() && dest->is_register()); -+ -+ uint const c_sz32 = sizeof(uint32_t); -+ uint const c_sz64 = sizeof(uint64_t); - - if (dest->is_single_cpu()) { -+ int index = src->single_stack_ix(); - if (type == T_ARRAY || type == T_OBJECT) { -- __ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); -+ __ ldr(dest->as_register(), stack_slot_address(index, c_sz64, rscratch1)); - __ verify_oop(dest->as_register()); - } else if (type == T_METADATA || type == T_ADDRESS) { -- __ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); -+ __ ldr(dest->as_register(), stack_slot_address(index, c_sz64, rscratch1)); - } else { -- Address src_addr = frame_map()->address_for_slot(src->single_stack_ix()); -- Address data_addr = __ form_address(rscratch1, sp, src_addr.offset(), 2); -- __ ldrw(dest->as_register(), data_addr); -+ __ ldrw(dest->as_register(), stack_slot_address(index, c_sz32, rscratch1)); - } - - } else if (dest->is_double_cpu()) { -- Address src_addr_LO = frame_map()->address_for_slot(src->double_stack_ix(), lo_word_offset_in_bytes); -+ int index = src->double_stack_ix(); -+ Address src_addr_LO = stack_slot_address(index, c_sz64, rscratch1, lo_word_offset_in_bytes); - __ ldr(dest->as_register_lo(), src_addr_LO); - - } else if (dest->is_single_fpu()) { -- Address src_addr = frame_map()->address_for_slot(src->single_stack_ix()); -- __ ldrs(dest->as_float_reg(), src_addr); -+ int index = src->single_stack_ix(); -+ __ ldrs(dest->as_float_reg(), stack_slot_address(index, c_sz32, rscratch1)); - - } else if (dest->is_double_fpu()) { -- Address src_addr = frame_map()->address_for_slot(src->double_stack_ix()); -- __ ldrd(dest->as_double_reg(), src_addr); -+ int index = src->double_stack_ix(); -+ __ ldrd(dest->as_double_reg(), stack_slot_address(index, c_sz64, rscratch1)); - - } else { - ShouldNotReachHere(); -diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp -index 6374a33e6..9db81fed9 100644 ---- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp -+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp -@@ -45,10 +45,12 @@ friend class ArrayCopyStub; - - bool is_literal_address(LIR_Address* addr); - -- // When we need to use something other than rscratch1 use this -- // method. -+ // When we need to use something other than rscratch1 use this method. - Address as_Address(LIR_Address* addr, Register tmp); - -+ // Ensure we have a valid Address (base+offset) to a stack-slot. -+ Address stack_slot_address(int index, uint shift, Register tmp, int adjust = 0); -+ - // Record the type of the receiver in ReceiverTypeData - void type_profile_helper(Register mdo, - ciMethodData *md, ciProfileData *data, -diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp -index 44497ea7c..014a4d3c6 100644 ---- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp -+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp -@@ -26,7 +26,7 @@ - #ifndef CPU_AARCH64_VM_MACROASSEMBLER_AARCH64_HPP - #define CPU_AARCH64_VM_MACROASSEMBLER_AARCH64_HPP - --#include "asm/assembler.hpp" -+#include "asm/assembler.inline.hpp" - - // MacroAssembler extends Assembler by frequently used macros. - // -@@ -132,6 +132,20 @@ class MacroAssembler: public Assembler { - a.lea(this, r); - } - -+ /* Sometimes we get misaligned loads and stores, usually from Unsafe -+ accesses, and these can exceed the offset range. */ -+ Address legitimize_address(const Address &a, int size, Register scratch) { -+ if (a.getMode() == Address::base_plus_offset) { -+ if (! Address::offset_ok_for_immed(a.offset(), exact_log2(size))) { -+ block_comment("legitimize_address {"); -+ lea(scratch, a); -+ block_comment("} legitimize_address"); -+ return Address(scratch); -+ } -+ } -+ return a; -+ } -+ - void addmw(Address a, Register incr, Register scratch) { - ldrw(scratch, a); - addw(scratch, scratch, incr); -diff --git a/src/hotspot/share/asm/assembler.hpp b/src/hotspot/share/asm/assembler.hpp -index da181b90b..56c3068e4 100644 ---- a/src/hotspot/share/asm/assembler.hpp -+++ b/src/hotspot/share/asm/assembler.hpp -@@ -302,6 +302,7 @@ class AbstractAssembler : public ResourceObj { - // Define some: - static bool is_simm5( intptr_t x) { return is_simm(x, 5 ); } - static bool is_simm8( intptr_t x) { return is_simm(x, 8 ); } -+ static bool is_simm9( intptr_t x) { return is_simm(x, 9 ); } - static bool is_simm10(intptr_t x) { return is_simm(x, 10); } - static bool is_simm11(intptr_t x) { return is_simm(x, 11); } - static bool is_simm12(intptr_t x) { return is_simm(x, 12); } -@@ -310,6 +311,15 @@ class AbstractAssembler : public ResourceObj { - static bool is_simm26(intptr_t x) { return is_simm(x, 26); } - static bool is_simm32(intptr_t x) { return is_simm(x, 32); } - -+ // Test if x is within unsigned immediate range for width. -+ static bool is_uimm(intptr_t x, uint w) { -+ precond(0 < w && w < 64); -+ intptr_t limes = intptr_t(1) << w; -+ return x < limes; -+ } -+ -+ static bool is_uimm12(intptr_t x) { return is_uimm(x, 12); } -+ - // Accessors - CodeSection* code_section() const { return _code_section; } - CodeBuffer* code() const { return code_section()->outer(); } -diff --git a/src/hotspot/share/utilities/debug.hpp b/src/hotspot/share/utilities/debug.hpp -index aa594754a..c66c710f2 100644 ---- a/src/hotspot/share/utilities/debug.hpp -+++ b/src/hotspot/share/utilities/debug.hpp -@@ -66,6 +66,9 @@ do { \ - // For backward compatibility. - #define assert(p, ...) vmassert(p, __VA_ARGS__) - -+#define precond(p) assert(p, "precond") -+#define postcond(p) assert(p, "postcond") -+ - #ifndef ASSERT - #define vmassert_status(p, status, msg) - #else --- -2.19.1 - diff --git a/8248336-AArch64-C2-offset-overflow-in-BoxLockNode-em.patch b/8248336-AArch64-C2-offset-overflow-in-BoxLockNode-em.patch deleted file mode 100755 index e16a188a0e786213c070e6791c7feb74a49868c7..0000000000000000000000000000000000000000 --- a/8248336-AArch64-C2-offset-overflow-in-BoxLockNode-em.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3070d796490221304ef226560ad2a837c3de4401 Mon Sep 17 00:00:00 2001 -Date: Sat, 31 Oct 2020 14:17:53 +0800 -Subject: [PATCH] 8248336: AArch64: C2: offset overflow in BoxLockNode::emit - -Summary: : offset overflow in BoxLockNode::emit -LLT: jtreg -Bug url: https://bugs.openjdk.java.net/browse/JDK-8248336 ---- - src/hotspot/cpu/aarch64/aarch64.ad | 16 ++++++++++------ - 1 file changed, 10 insertions(+), 6 deletions(-) - -diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad -index 827ec9e..617b2b8 100644 ---- a/src/hotspot/cpu/aarch64/aarch64.ad -+++ b/src/hotspot/cpu/aarch64/aarch64.ad -@@ -2071,16 +2071,20 @@ void BoxLockNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { - int offset = ra_->reg2offset(in_RegMask(0).find_first_elem()); - int reg = ra_->get_encode(this); - -- if (Assembler::operand_valid_for_add_sub_immediate(offset)) { -- __ add(as_Register(reg), sp, offset); -- } else { -- ShouldNotReachHere(); -- } -+ // This add will handle any 24-bit signed offset. 24 bits allows an -+ // 8 megabyte stack frame. -+ __ add(as_Register(reg), sp, offset); - } - - uint BoxLockNode::size(PhaseRegAlloc *ra_) const { - // BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_). -- return 4; -+ int offset = ra_->reg2offset(in_RegMask(0).find_first_elem()); -+ -+ if (Assembler::operand_valid_for_add_sub_immediate(offset)) { -+ return NativeInstruction::instruction_size; -+ } else { -+ return 2 * NativeInstruction::instruction_size; -+ } - } - - //============================================================================= --- -1.8.3.1 - diff --git a/8264640.patch b/8264640.patch new file mode 100755 index 0000000000000000000000000000000000000000..18413b89827ea820feb13a4784632f603ae77fd3 --- /dev/null +++ b/8264640.patch @@ -0,0 +1,20 @@ +diff --git a/src/hotspot/share/gc/cms/parOopClosures.inline.hpp b/src/hotspot/share/gc/cms/parOopClosures.inline.hpp +index 1e206292d..609a14868 100644 +--- a/src/hotspot/share/gc/cms/parOopClosures.inline.hpp ++++ b/src/hotspot/share/gc/cms/parOopClosures.inline.hpp +@@ -44,6 +44,7 @@ template inline void ParScanWeakRefClosure::do_oop_work(T* p) { + // we need to ensure that it is copied (see comment in + // ParScanClosure::do_oop_work). + Klass* objK = obj->klass(); ++ OrderAccess::loadload(); + markOop m = obj->mark_raw(); + oop new_obj; + if (m->is_marked()) { // Contains forwarding pointer. +@@ -108,6 +109,7 @@ inline void ParScanClosure::do_oop_work(T* p, + // overwritten with an overflow next pointer after the object is + // forwarded. + Klass* objK = obj->klass(); ++ OrderAccess::loadload(); + markOop m = obj->mark_raw(); + oop new_obj; + if (m->is_marked()) { // Contains forwarding pointer. diff --git a/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch b/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch new file mode 100755 index 0000000000000000000000000000000000000000..2fba5977dc211812b2b35f9d5d51986a4e1c42a2 --- /dev/null +++ b/G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch @@ -0,0 +1,370 @@ +commit 84035ec6aea36f1e58f8aab9a2e07e6985529434 +Date: Tue Apr 20 14:45:13 2021 +0800 + + G1: iterate region by bitmap rather than obj size in prepare_no_moving_region + +diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp +index 2cc9c87d0..a86046616 100644 +--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp ++++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp +@@ -171,25 +171,47 @@ void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction(Hea + } + } + +-void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_no_moving_region(const HeapRegion* hr) { +- const HeapRegion* current = hr; ++void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_no_moving_region(HeapRegion* hr) { ++ HeapRegion* current = hr; + assert(!current->is_humongous(), "Should be no humongous regions"); + HeapWord* limit = current->top(); + HeapWord* next_addr = current->bottom(); ++ HeapWord* live_end = current->bottom(); ++ HeapWord* threshold = current->initialize_threshold(); ++ HeapWord* pre_addr; ++ + while (next_addr < limit) { + Prefetch::write(next_addr, PrefetchScanIntervalInBytes); +- oop obj = oop(next_addr); +- size_t obj_size = obj->size(); ++ pre_addr = next_addr; ++ + if (_bitmap->is_marked(next_addr)) { ++ oop obj = oop(next_addr); ++ size_t obj_size = obj->size(); ++ // Object should not move but mark-word is used so it looks like the ++ // object is forwarded. Need to clear the mark and it's no problem ++ // since it will be restored by preserved marks. There is an exception ++ // with BiasedLocking, in this case forwardee() will return NULL ++ // even if the mark-word is used. This is no problem since ++ // forwardee() will return NULL in the compaction phase as well. + if (obj->forwardee() != NULL) { +- obj->init_mark_raw(); ++ obj->init_mark(); + } ++ next_addr += obj_size; ++ // update live byte range end ++ live_end = next_addr; + } else { +- // Fill dummy object to replace dead object +- Universe::heap()->fill_with_dummy_object(next_addr, next_addr + obj_size, true); ++ next_addr = _bitmap->get_next_marked_addr(next_addr, limit); ++ assert(next_addr > live_end, "next_addr must be bigger than live_end"); ++ assert(next_addr == limit || _bitmap->is_marked(next_addr), "next_addr is the limit or is marked"); ++ // fill dummy object to replace dead range ++ Universe::heap()->fill_with_dummy_object(live_end, next_addr, true); ++ } ++ ++ if (next_addr > threshold) { ++ threshold = current->cross_threshold(pre_addr, next_addr); + } +- next_addr += obj_size; + } ++ assert(next_addr == limit, "Should stop the scan at the limit."); + } + + void G1FullGCPrepareTask::prepare_serial_compaction() { +diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp +index 57b53c9dd..7f4a69e80 100644 +--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp ++++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp +@@ -61,7 +61,7 @@ protected: + void prepare_for_compaction_work(G1FullGCCompactionPoint* cp, HeapRegion* hr); + void free_humongous_region(HeapRegion* hr); + void reset_region_metadata(HeapRegion* hr); +- void prepare_no_moving_region(const HeapRegion* hr); ++ void prepare_no_moving_region(HeapRegion* hr); + + public: + G1CalculatePointersClosure(G1CMBitMap* bitmap, +diff --git a/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp b/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp +index 32da3800a..aec32f9e4 100644 +--- a/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp ++++ b/src/hotspot/share/gc/g1/g1MarkLiveWords.cpp +@@ -1,22 +1,25 @@ + /* +- * Copyright (c) 2021, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2021, Huawei Technologies Co., Ltd. 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. Alibaba designates this +- * particular file as subject to the "Classpath" exception as provided +- * by Oracle in the LICENSE file that accompanied this code. ++ * 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 ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * + */ + + #include "gc/g1/g1MarkLiveWords.hpp" +diff --git a/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp b/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp +index a11a4ca52..e8632fe5d 100644 +--- a/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp ++++ b/src/hotspot/share/gc/g1/g1MarkLiveWords.hpp +@@ -1,22 +1,25 @@ + /* +- * Copyright (c) 2021, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2021, Huawei Technologies Co., Ltd. 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. Alibaba designates this +- * particular file as subject to the "Classpath" exception as provided +- * by Oracle in the LICENSE file that accompanied this code. ++ * 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 ++ * 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. ++ * + */ + + #ifndef SHARE_VM_GC_G1_G1MARKLIVEWORDS_HPP +diff --git a/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp b/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp +index 37922e8cf..1fb6d9929 100644 +--- a/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp ++++ b/src/hotspot/share/gc/g1/g1MarkRegionCache.cpp +@@ -1,22 +1,25 @@ + /* +- * Copyright (c) 2021, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2021, Huawei Technologies Co., Ltd. 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. Alibaba designates this +- * particular file as subject to the "Classpath" exception as provided +- * by Oracle in the LICENSE file that accompanied this code. ++ * 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 ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * + */ + + #include "gc/g1/g1MarkRegionCache.hpp" +diff --git a/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp b/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp +index 0615fcab6..00d2931a6 100644 +--- a/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp ++++ b/src/hotspot/share/gc/g1/g1MarkRegionCache.hpp +@@ -1,22 +1,25 @@ + /* +- * Copyright (c) 2021, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2021, Huawei Technologies Co., Ltd. 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. Alibaba designates this +- * particular file as subject to the "Classpath" exception as provided +- * by Oracle in the LICENSE file that accompanied this code. ++ * 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 ++ * 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. ++ * + */ + + #ifndef SHARE_VM_GC_G1_G1MARKREGIONCACHE_HPP +diff --git a/test/hotspot/jtreg/compiler/c2/Test8217359.java b/test/hotspot/jtreg/compiler/c2/Test8217359.java +index ca0d2cc75..533bdce4b 100644 +--- a/test/hotspot/jtreg/compiler/c2/Test8217359.java ++++ b/test/hotspot/jtreg/compiler/c2/Test8217359.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2019, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2019, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/c2/TestFoldCompares.java b/test/hotspot/jtreg/compiler/c2/TestFoldCompares.java +index 735ecf76b..6b7aa5053 100644 +--- a/test/hotspot/jtreg/compiler/c2/TestFoldCompares.java ++++ b/test/hotspot/jtreg/compiler/c2/TestFoldCompares.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java b/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java +index d4c93b390..229df93e5 100644 +--- a/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java ++++ b/test/hotspot/jtreg/compiler/c2/TestReplaceEquivPhis.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/lazybox/TestLazyBox.java b/test/hotspot/jtreg/compiler/lazybox/TestLazyBox.java +index 4d9a72db2..f22dad6af 100644 +--- a/test/hotspot/jtreg/compiler/lazybox/TestLazyBox.java ++++ b/test/hotspot/jtreg/compiler/lazybox/TestLazyBox.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2021, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2021, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops.java b/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops.java +index c831430ed..8fcafc59b 100644 +--- a/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops.java ++++ b/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops_2.java b/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops_2.java +index c53f33ff2..90fb2242f 100644 +--- a/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops_2.java ++++ b/test/hotspot/jtreg/compiler/loopopts/TestBeautifyLoops_2.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/loopopts/TestRemoveEmptyLoop.java b/test/hotspot/jtreg/compiler/loopopts/TestRemoveEmptyLoop.java +index 94c79c9c2..780c09211 100644 +--- a/test/hotspot/jtreg/compiler/loopopts/TestRemoveEmptyLoop.java ++++ b/test/hotspot/jtreg/compiler/loopopts/TestRemoveEmptyLoop.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2019, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2019, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestSearchAlignment.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestSearchAlignment.java +index 37be01524..5242adb43 100644 +--- a/test/hotspot/jtreg/compiler/loopopts/superword/TestSearchAlignment.java ++++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestSearchAlignment.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java b/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java +index 2f892773b..2383c3a94 100644 +--- a/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java ++++ b/test/hotspot/jtreg/gc/g1/TestG1NoMoving.java +@@ -1,22 +1,25 @@ + /* +- * Copyright (c) 2021, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2021, Huawei Technologies Co., Ltd. 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. Alibaba designates this +- * particular file as subject to the "Classpath" exception as provided +- * by Oracle in the LICENSE file that accompanied this code. ++ * 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 ++ * 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. ++ * + */ + + /* +diff --git a/test/hotspot/jtreg/runtime/invokedynamic/DynamicConstantHelper.jasm b/test/hotspot/jtreg/runtime/invokedynamic/DynamicConstantHelper.jasm +index 01ab0c9f1..4fa919e94 100644 +--- a/test/hotspot/jtreg/runtime/invokedynamic/DynamicConstantHelper.jasm ++++ b/test/hotspot/jtreg/runtime/invokedynamic/DynamicConstantHelper.jasm +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/test/hotspot/jtreg/runtime/invokedynamic/TestDynamicConstant.java b/test/hotspot/jtreg/runtime/invokedynamic/TestDynamicConstant.java +index 1d8d3c669..24498ece4 100644 +--- a/test/hotspot/jtreg/runtime/invokedynamic/TestDynamicConstant.java ++++ b/test/hotspot/jtreg/runtime/invokedynamic/TestDynamicConstant.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. ++ * Copyright (c) 2020, Huawei Technologies Co., Ltd. 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 +diff --git a/version.txt b/version.txt +new file mode 100644 +index 000000000..85b49171c +--- /dev/null ++++ b/version.txt +@@ -0,0 +1 @@ ++11.0.10.0.13 diff --git a/add-SVE-backend-feature.patch b/add-SVE-backend-feature.patch index ebd505523f9edbfefd1b51b5cb7ce4d3837c12da..1d51d8fcb132bcb878bce13b95a1b284b2410ac2 100755 --- a/add-SVE-backend-feature.patch +++ b/add-SVE-backend-feature.patch @@ -5558,11 +5558,11 @@ index 80ddb9b31..f554b5e15 100644 + unsigned get(int msb = 31, int lsb = 0) { int nbits = msb - lsb + 1; - unsigned mask = ((1U << nbits) - 1) << lsb; + unsigned mask = checked_cast(right_n_bits(nbits)) << lsb; @@ -554,6 +565,18 @@ class Address { void lea(MacroAssembler *, Register) const; - static bool offset_ok_for_immed(long offset, uint shift); + static bool offset_ok_for_immed(int64_t offset, uint shift = 0); + + static bool offset_ok_for_sve_immed(long offset, int shift, int vl /* sve vector length */) { + if (offset % vl == 0) { diff --git a/address-s-offset-may-exceed-the-limit-of-ldrw-instru.patch b/address-s-offset-may-exceed-the-limit-of-ldrw-instru.patch deleted file mode 100644 index c880107be9792ca6ec1f6cc64d6ed1efa6e26fe6..0000000000000000000000000000000000000000 --- a/address-s-offset-may-exceed-the-limit-of-ldrw-instru.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c98fac94c7ce8826dec848d38723eebb192600f1 Mon Sep 17 00:00:00 2001 -Date: Tue, 21 Apr 2020 15:54:35 +0800 -Subject: [PATCH] address's offset may exceed the limit of ldrw instruction in - stack2reg - -Summary: : -LLT: test/hotspot/jtreg/runtime/handshake/HandshakeWalkSuspendExitTest.java -Bug url: NA -d31f3a48 ---- - src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -index cf3ce0a..82abda9 100644 ---- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp -@@ -864,7 +864,9 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { - } else if (type == T_METADATA || type == T_ADDRESS) { - __ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); - } else { -- __ ldrw(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix())); -+ Address src_addr = frame_map()->address_for_slot(src->single_stack_ix()); -+ Address data_addr = __ form_address(rscratch1, sp, src_addr.offset(), 2); -+ __ ldrw(dest->as_register(), data_addr); - } - - } else if (dest->is_double_cpu()) { --- -1.8.3.1 - diff --git a/jdk-updates-jdk11u-jdk-11.0.10-ga.tar.xz b/jdk-updates-jdk11u-jdk-11.0.11-ga.tar.xz similarity index 82% rename from jdk-updates-jdk11u-jdk-11.0.10-ga.tar.xz rename to jdk-updates-jdk11u-jdk-11.0.11-ga.tar.xz index baafed89f233fe8379526945e66e406f2afad321..ba2e83dd2a85b18ac8c27d430ee9486112f4950b 100644 Binary files a/jdk-updates-jdk11u-jdk-11.0.10-ga.tar.xz and b/jdk-updates-jdk11u-jdk-11.0.11-ga.tar.xz differ diff --git a/numa_mem_leak.patch b/numa_mem_leak.patch new file mode 100755 index 0000000000000000000000000000000000000000..4a7613177cfb75e51cd77bc810cf34887ae4f81f --- /dev/null +++ b/numa_mem_leak.patch @@ -0,0 +1,37 @@ +diff --git a/src/hotspot/os/linux/os_linux.hpp b/src/hotspot/os/linux/os_linux.hpp +index 22f177f17..6b2714f5d 100644 +--- a/src/hotspot/os/linux/os_linux.hpp ++++ b/src/hotspot/os/linux/os_linux.hpp +@@ -377,8 +377,8 @@ class Linux { + } + // Check if node is in bound node set. + static bool isnode_in_bound_nodes(int node) { +- if (_numa_get_membind != NULL && _numa_bitmask_isbitset != NULL) { +- return _numa_bitmask_isbitset(_numa_get_membind(), node); ++ if (_numa_membind_bitmask != NULL && _numa_bitmask_isbitset != NULL) { ++ return _numa_bitmask_isbitset(_numa_membind_bitmask, node); + } else { + return false; + } +@@ -387,19 +387,17 @@ class Linux { + // Returns true if bound to a single numa node, otherwise returns false. + static bool isbound_to_single_node() { + int nodes = 0; +- struct bitmask* bmp = NULL; + unsigned int node = 0; + unsigned int highest_node_number = 0; + +- if (_numa_get_membind != NULL && _numa_max_node != NULL && _numa_bitmask_isbitset != NULL) { +- bmp = _numa_get_membind(); ++ if (_numa_membind_bitmask != NULL && _numa_max_node != NULL && _numa_bitmask_isbitset != NULL) { + highest_node_number = _numa_max_node(); + } else { + return false; + } + + for (node = 0; node <= highest_node_number; node++) { +- if (_numa_bitmask_isbitset(bmp, node)) { ++ if (_numa_bitmask_isbitset(_numa_membind_bitmask, node)) { + nodes++; + } + } diff --git a/java-11-openjdk.spec b/openjdk-11.spec similarity index 98% rename from java-11-openjdk.spec rename to openjdk-11.spec index cbcb76d8045303a193cf974a47c8d211c13c7a4b..70f5a28b6fa0f34adb1ac8f8ef2af7cb631e6729 100644 --- a/java-11-openjdk.spec +++ b/openjdk-11.spec @@ -114,7 +114,7 @@ # New Version-String scheme-style defines %global majorver 11 -%global securityver 10 +%global securityver 11 # buildjdkver is usually same as %%{majorver}, # but in time of bootstrap of next jdk, it is majorver-1, # and this it is better to change it here, on single place @@ -135,7 +135,7 @@ %global project jdk-updates %global repo jdk11u -%global revision jdk-11.0.10-ga +%global revision jdk-11.0.11-ga %global full_revision %{project}-%{repo}-%{revision} # priority must be 7 digits in total # setting to 1, so debug ones can have 0 @@ -740,7 +740,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: 6 +Release: 2 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -816,7 +816,6 @@ Patch22: 8233506-ZGC-the-load-for-Reference.get-can-be-conver.patch Patch23: add-missing-inline.patch Patch26: ZGC-aarch64-fix-system-call-number-of-memfd_create.patch Patch27: ZGC-aarch64-fix-not-using-load-store-Pre-index.patch -Patch28: address-s-offset-may-exceed-the-limit-of-ldrw-instru.patch Patch29: ZGC-reuse-entries-of-ResolvedMethodTable.patch # 11.0.8 @@ -829,24 +828,19 @@ Patch38: fast-serializer-jdk11.patch Patch39: fix-jck-failure-on-FastSerializer.patch Patch40: 8223667-ASAN-build-broken.patch Patch42: 8229496-SIGFPE-division-by-zero-in-C2-OSR-compiled-method.patch -Patch43: 8243670-Unexpected-test-result-caused-by-C2-MergeMem.patch Patch45: leaf-optimize-in-ParallelScanvageGC.patch Patch46: ZGC-correct-free-heap-size-excluding-waste-in-rule_allocation_rate.patch Patch47: 8204947-Port-ShenandoahTaskTerminator-to-mainline-and-make-it-default.patch Patch48: 8205921-Optimizing-best_of_2-work-stealing-queue-selection.patch -Patch49: 8237483-AArch64-C1-OopMap-inserted-twice-fatal-error.patch -Patch50: 8248336-AArch64-C2-offset-overflow-in-BoxLockNode-em.patch # 11.0.9 Patch54: 8207160-ClassReader-adjustMethodParams-can-potentially-return-null-if-the-args-list-is-empty.patch Patch55: 8215047-Task-terminators-do-not-complete-termination-in-consistent-state.patch -Patch56: 8247766-aarch64-guarantee-val-1U--nbits-failed-Field-too-big-for-insn.patch Patch57: add-zgc-parameter-adaptation-feature.patch Patch58: add-integerCache-feature.patch Patch59: add-SVE-backend-feature.patch #11.0.10 -Patch60: 8240353.patch Patch61: downgrade-the-symver-of-log2f-posix-spawn.patch Patch62: 8254078-DataOutputStream-is-very-slow-post-disabling.patch Patch63: 8217918-C2-XX-AggressiveUnboxing-is-broken.patch @@ -854,6 +848,12 @@ Patch64: Fix-the-memcpy-symbol-issue-during-JDK11-x64-build.patch Patch65: add-LazyBox-feature.patch Patch66: add-G1-Full-GC-optimization.patch Patch67: 8214535-support-Jmap-parallel.patch +Patch68: src-openeuler-openjdk-11-resolve-code-inconsistencies.patch +Patch69: G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch + +#11.0.11 +Patch70: 8264640.patch +Patch71: numa_mem_leak.patch BuildRequires: autoconf BuildRequires: alsa-lib-devel @@ -1099,7 +1099,6 @@ pushd %{top_level_dir_name} %patch23 -p1 %patch26 -p1 %patch27 -p1 -%patch28 -p1 %patch29 -p1 %patch33 -p1 %patch34 -p1 @@ -1110,20 +1109,15 @@ pushd %{top_level_dir_name} %patch39 -p1 %patch40 -p1 %patch42 -p1 -%patch43 -p1 %patch45 -p1 %patch46 -p1 %patch47 -p1 %patch48 -p1 -%patch49 -p1 -%patch50 -p1 %patch54 -p1 %patch55 -p1 -%patch56 -p1 %patch57 -p1 %patch58 -p1 %patch59 -p1 -%patch60 -p1 %patch61 -p1 %patch62 -p1 %patch63 -p1 @@ -1131,9 +1125,13 @@ pushd %{top_level_dir_name} %patch65 -p1 %patch66 -p1 %patch67 -p1 +%patch68 -p1 +%patch69 -p1 +%patch70 -p1 +%patch71 -p1 popd # openjdk -%patch1000 +# %patch1000 # Extract systemtap tapsets %if %{with_systemtap} @@ -1634,6 +1632,21 @@ require "copy_jdk_configs.lua" %changelog +* Mon May 31 2021 kuenking111 - 1:11.0.11.9-2 +- add numa_mem_leak.patch + +* Fri May 28 2021 kuenking111 - 1:11.0.11.9-1 +- add 8264640.patch + +* Fri May 14 2021 hu_bo_dao - 1:11.0.11.9-0 +- Update to 11.0.11+9 (GA) + +* Sat Apr 17 2021 aijm - 1:11.0.10.9-8 +- add G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch + +* Tue Apr 13 2021 kuenking - 1:11.0.10.9-7 +- add src-openeuler-openjdk-11-resolve-code-inconsistencies.patch + * Fri Mar 19 2021 aijm - 1:11.0.10.9-6 - add 8214535-support-Jmap-parallel.patch diff --git a/src-openeuler-openjdk-11-resolve-code-inconsistencies.patch b/src-openeuler-openjdk-11-resolve-code-inconsistencies.patch new file mode 100755 index 0000000000000000000000000000000000000000..ba133b9b7b119a436d2034fda306155ed3f91049 --- /dev/null +++ b/src-openeuler-openjdk-11-resolve-code-inconsistencies.patch @@ -0,0 +1,1305 @@ +commit c2748cd0d7b5a92b275aff0cd1d1fa0b113ba64f +Author: aijiaming +Date: Mon Apr 12 10:53:53 2021 +0800 + + fix patch + +diff --git a/make/launcher/Launcher-java.base.gmk b/make/launcher/Launcher-java.base.gmk +index f6d4aa28f..d511c0be5 100644 +--- a/make/launcher/Launcher-java.base.gmk ++++ b/make/launcher/Launcher-java.base.gmk +@@ -30,6 +30,11 @@ $(eval $(call IncludeCustomExtension, launcher/Launcher-java.base.gmk)) + JAVA_RC_FLAGS += -I$(TOPDIR)/src/java.base/windows/native/common + JAVA_RC_FLAGS += -I$(TOPDIR)/src/java.base/windows/native/launcher/icons + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + $(eval $(call SetupBuildLauncher, java, \ +@@ -79,6 +84,7 @@ ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix linux), ) + $(eval $(call SetupJdkExecutable, BUILD_JSPAWNHELPER, \ + NAME := jspawnhelper, \ + SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKEXE) -I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \ + EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o, \ +diff --git a/make/launcher/Launcher-jdk.pack.gmk b/make/launcher/Launcher-jdk.pack.gmk +index a93fd2a90..2e0bc7a5b 100644 +--- a/make/launcher/Launcher-jdk.pack.gmk ++++ b/make/launcher/Launcher-jdk.pack.gmk +@@ -30,6 +30,11 @@ $(eval $(call SetupBuildLauncher, pack200, \ + MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \ + )) + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + # The order of the object files on the link command line affects the size of the resulting + # binary (at least on linux) which causes the size to differ between old and new build. +@@ -81,6 +86,7 @@ $(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \ + SRC := $(UNPACKEXE_SRC), \ + TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \ + CFLAGS_release := -DPRODUCT, \ + CFLAGS_linux := -fPIC, \ +diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk +index 7b0441507..b334b76e4 100644 +--- a/make/lib/Awt2dLibraries.gmk ++++ b/make/lib/Awt2dLibraries.gmk +@@ -35,6 +35,11 @@ LIBAWT_DEFAULT_HEADER_DIRS := \ + libawt/java2d/pipe \ + # + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + # We must not include java.desktop/unix/native/libmlib_image, which is only +@@ -50,6 +55,7 @@ endif + $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \ + NAME := mlib_image, \ + EXTRA_SRC := common/awt/medialib, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \ + EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \ + OPTIMIZATION := HIGHEST, \ +@@ -219,6 +225,7 @@ endif + $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \ + NAME := awt, \ + EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + EXCLUDES := $(LIBAWT_EXCLUDES), \ + EXCLUDE_FILES := $(LIBAWT_EXFILES), \ + OPTIMIZATION := LOW, \ +@@ -431,6 +438,7 @@ endif + $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \ + NAME := javajpeg, \ + INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + OPTIMIZATION := HIGHEST, \ + CFLAGS := $(CFLAGS_JDKLIB), \ + HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \ +@@ -921,6 +929,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false) + NAME := splashscreen, \ + EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \ + EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \ + EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \ + OPTIMIZATION := LOW, \ +diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk +index 226e20892..f180a28c3 100644 +--- a/make/lib/CoreLibraries.gmk ++++ b/make/lib/CoreLibraries.gmk +@@ -28,6 +28,11 @@ WIN_VERIFY_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify/verify.lib + # Hook to include the corresponding custom file, if present. + $(eval $(call IncludeCustomExtension, lib/CoreLibraries.gmk)) + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + + ########################################################################################## + # libfdlibm is statically linked with libjava below and not delivered into the +@@ -76,6 +81,7 @@ endif + $(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \ + NAME := verify, \ + OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB), \ + DISABLED_WARNINGS_gcc := implicit-fallthrough, \ + DISABLED_WARNINGS_microsoft := 4244 4267, \ +@@ -96,9 +102,11 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) + BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c + endif + ++ + $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \ + NAME := java, \ + OPTIMIZATION := HIGH, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBJAVA_CFLAGS), \ + System.c_CFLAGS := $(VERSION_CFLAGS), \ +@@ -144,6 +152,7 @@ endif + $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \ + NAME := zip, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + EXCLUDES := $(LIBZIP_EXCLUDES), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBZ_CFLAGS), \ +@@ -165,6 +174,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \ + NAME := jimage, \ + TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB), \ + CFLAGS_unix := -UDEBUG, \ +@@ -236,7 +246,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \ + NAME := jli, \ + OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \ + EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \ +- EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \ ++ EXTRA_FILES := $(LIBJLI_EXTRA_FILES) $(LIBMEMCPY_FILES), \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ + DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \ +diff --git a/make/lib/Lib-java.base.gmk b/make/lib/Lib-java.base.gmk +index 880249b8a..48876b84c 100644 +--- a/make/lib/Lib-java.base.gmk ++++ b/make/lib/Lib-java.base.gmk +@@ -36,12 +36,18 @@ $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native)) + + include CoreLibraries.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + # Create the network library + + $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \ + NAME := net, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB), \ + DISABLED_WARNINGS_gcc := format-nonliteral, \ + DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \ +diff --git a/make/lib/Lib-java.desktop.gmk b/make/lib/Lib-java.desktop.gmk +index 2bb02cdd7..917ab02fc 100644 +--- a/make/lib/Lib-java.desktop.gmk ++++ b/make/lib/Lib-java.desktop.gmk +@@ -36,6 +36,11 @@ $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native)) + + include Awt2dLibraries.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + # Create the libjsound library + +@@ -63,6 +68,7 @@ ifneq ($(OPENJDK_TARGET_OS), aix) + NAME := jsound, \ + TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBJSOUND_CFLAGS), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ +diff --git a/make/lib/Lib-java.instrument.gmk b/make/lib/Lib-java.instrument.gmk +index 9acde85ff..6e679b500 100644 +--- a/make/lib/Lib-java.instrument.gmk ++++ b/make/lib/Lib-java.instrument.gmk +@@ -36,9 +36,15 @@ ifeq ($(OPENJDK_TARGET_OS), windows) + WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib + endif + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \ + NAME := instrument, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBINSTRUMENT_CFLAGS), \ + CFLAGS_debug := -DJPLIS_LOGGING, \ + CFLAGS_release := -DNO_JPLIS_LOGGING, \ +diff --git a/make/lib/Lib-jdk.crypto.cryptoki.gmk b/make/lib/Lib-jdk.crypto.cryptoki.gmk +index 3f25d7c04..6c23857e1 100644 +--- a/make/lib/Lib-jdk.crypto.cryptoki.gmk ++++ b/make/lib/Lib-jdk.crypto.cryptoki.gmk +@@ -25,11 +25,17 @@ + + include LibCommon.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \ + NAME := j2pkcs11, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB), \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ +diff --git a/make/lib/Lib-jdk.crypto.ec.gmk b/make/lib/Lib-jdk.crypto.ec.gmk +index dfecc1d3c..4137a371d 100644 +--- a/make/lib/Lib-jdk.crypto.ec.gmk ++++ b/make/lib/Lib-jdk.crypto.ec.gmk +@@ -25,6 +25,11 @@ + + include LibCommon.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + ifeq ($(ENABLE_INTREE_EC), true) +@@ -42,6 +47,7 @@ ifeq ($(ENABLE_INTREE_EC), true) + NAME := sunec, \ + TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(BUILD_LIBSUNEC_CFLAGS_JDKLIB) \ + -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ + CXXFLAGS := $(BUILD_LIBSUNEC_CXXFLAGS_JDKLIB), \ +diff --git a/make/lib/Lib-jdk.hotspot.agent.gmk b/make/lib/Lib-jdk.hotspot.agent.gmk +index 1cbae7065..1ac259517 100644 +--- a/make/lib/Lib-jdk.hotspot.agent.gmk ++++ b/make/lib/Lib-jdk.hotspot.agent.gmk +@@ -27,6 +27,11 @@ include LibCommon.gmk + + $(eval $(call IncludeCustomExtension, hotspot/lib/Lib-jdk.hotspot.agent.gmk)) + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + ifeq ($(OPENJDK_TARGET_OS), linux) +@@ -58,6 +63,7 @@ endif + $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \ + NAME := saproc, \ + OPTIMIZATION := HIGH, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + DISABLED_WARNINGS_microsoft := 4267, \ + DISABLED_WARNINGS_gcc := sign-compare, \ + DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \ +diff --git a/make/lib/Lib-jdk.jdwp.agent.gmk b/make/lib/Lib-jdk.jdwp.agent.gmk +index f00f0760f..1081b1f30 100644 +--- a/make/lib/Lib-jdk.jdwp.agent.gmk ++++ b/make/lib/Lib-jdk.jdwp.agent.gmk +@@ -25,6 +25,11 @@ + + include LibCommon.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \ +@@ -53,6 +58,7 @@ TARGETS += $(BUILD_LIBDT_SOCKET) + $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \ + NAME := jdwp, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING, \ + EXTRA_HEADER_DIRS := \ + include \ +diff --git a/make/lib/Lib-jdk.pack.gmk b/make/lib/Lib-jdk.pack.gmk +index f401e03e7..23c87a07d 100644 +--- a/make/lib/Lib-jdk.pack.gmk ++++ b/make/lib/Lib-jdk.pack.gmk +@@ -25,6 +25,11 @@ + + include LibCommon.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \ +@@ -32,6 +37,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \ + EXTRA_SRC := common-unpack, \ + TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CXXFLAGS_JDKLIB) \ + -DNO_ZLIB -DUNPACK_JNI -DFULL, \ + CFLAGS_release := -DPRODUCT, \ +diff --git a/make/lib/Lib-jdk.sctp.gmk b/make/lib/Lib-jdk.sctp.gmk +index 267610202..f2c1dc0b9 100644 +--- a/make/lib/Lib-jdk.sctp.gmk ++++ b/make/lib/Lib-jdk.sctp.gmk +@@ -25,6 +25,11 @@ + + include LibCommon.gmk + ++LIBMEMCPY_FILES += \ ++ $(addprefix $(TOPDIR)/src/hotspot/share/runtime/, \ ++ memcpy.cpp \ ++ ) ++ + ################################################################################ + + ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) +@@ -33,6 +38,7 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) + $(eval $(call SetupJdkLibrary, BUILD_LIBSCTP, \ + NAME := sctp, \ + OPTIMIZATION := LOW, \ ++ EXTRA_FILES := $(LIBMEMCPY_FILES), \ + CFLAGS := $(CFLAGS_JDKLIB), \ + EXTRA_HEADER_DIRS := \ + $(call GetJavaHeaderDir, java.base) \ +diff --git a/src/hotspot/os/linux/attachListener_linux.cpp b/src/hotspot/os/linux/attachListener_linux.cpp +index d79bd1bac..eafe26906 100644 +--- a/src/hotspot/os/linux/attachListener_linux.cpp ++++ b/src/hotspot/os/linux/attachListener_linux.cpp +@@ -498,12 +498,26 @@ bool AttachListener::init_at_startup() { + // If the file .attach_pid exists in the working directory + // or /tmp then this is the trigger to start the attach mechanism + bool AttachListener::is_init_trigger() { +- if (init_at_startup() || is_initialized()) { +- return false; // initialized at startup or already initialized ++ if (init_at_startup()) { ++ return false; // initialized at startup + } ++ + char fn[PATH_MAX + 1]; + int ret; + struct stat64 st; ++ ++ // check initialized ++ if (is_initialized()) { ++ // check .java_pid file exists ++ RESTARTABLE(::stat64(LinuxAttachListener::path(), &st), ret); ++ if (ret == -1) { ++ // shutdown attach listener thread whick is blocked in accept ++ // function;Then attach listener thread exits. ++ ::shutdown(LinuxAttachListener::listener(), SHUT_RDWR); ++ } ++ return false; ++ } ++ + sprintf(fn, ".attach_pid%d", os::current_process_id()); + RESTARTABLE(::stat64(fn, &st), ret); + if (ret == -1) { +diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp +index bc2561fb0..6780fe3ed 100644 +--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp ++++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2020, 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 +@@ -3784,6 +3784,23 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign + INLINE_BAILOUT("mdo allocation failed"); + } + ++ const bool is_invokedynamic = (bc == Bytecodes::_invokedynamic); ++ const bool has_receiver = (bc != Bytecodes::_invokestatic && !is_invokedynamic); ++ ++ const int args_base = state()->stack_size() - callee->arg_size(); ++ assert(args_base >= 0, "stack underflow during inlining"); ++ ++ Value recv = NULL; ++ if (has_receiver) { ++ assert(!callee->is_static(), "callee must not be static"); ++ assert(callee->arg_size() > 0, "must have at least a receiver"); ++ ++ recv = state()->stack_at(args_base); ++ if (recv->is_null_obj()) { ++ INLINE_BAILOUT("receiver is always null"); ++ } ++ } ++ + // now perform tests that are based on flag settings + bool inlinee_by_directive = compilation()->directive()->should_inline(callee); + if (callee->force_inline() || inlinee_by_directive) { +@@ -3826,21 +3843,11 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign + + BlockBegin* orig_block = block(); + +- const bool is_invokedynamic = bc == Bytecodes::_invokedynamic; +- const bool has_receiver = (bc != Bytecodes::_invokestatic && !is_invokedynamic); +- +- const int args_base = state()->stack_size() - callee->arg_size(); +- assert(args_base >= 0, "stack underflow during inlining"); +- + // Insert null check if necessary +- Value recv = NULL; + if (has_receiver) { + // note: null check must happen even if first instruction of callee does + // an implicit null check since the callee is in a different scope + // and we must make sure exception handling does the right thing +- assert(!callee->is_static(), "callee must not be static"); +- assert(callee->arg_size() > 0, "must have at least a receiver"); +- recv = state()->stack_at(args_base); + null_check(recv); + } + +diff --git a/src/hotspot/share/c1/c1_Instruction.hpp b/src/hotspot/share/c1/c1_Instruction.hpp +index a94a21e42..61d3cc8cc 100644 +--- a/src/hotspot/share/c1/c1_Instruction.hpp ++++ b/src/hotspot/share/c1/c1_Instruction.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2020, 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 +@@ -268,7 +268,7 @@ class InstructionVisitor: public StackObj { + + + #define HASHING3(class_name, enabled, f1, f2, f3) \ +- virtual intx hash() const { \ ++ virtual intx hash() const { \ + return (enabled) ? HASH4(name(), f1, f2, f3) : 0; \ + } \ + virtual bool is_equal(Value v) const { \ +@@ -452,6 +452,8 @@ class Instruction: public CompilationResourceObj { + bool is_linked() const { return check_flag(IsLinkedInBlockFlag); } + bool can_be_linked() { return as_Local() == NULL && as_Phi() == NULL; } + ++ bool is_null_obj() { return as_Constant() != NULL && type()->as_ObjectType()->constant_value()->is_null_object(); } ++ + bool has_uses() const { return use_count() > 0; } + ValueStack* state_before() const { return _state_before; } + ValueStack* exception_state() const { return _exception_state; } +@@ -832,8 +834,8 @@ LEAF(LoadField, AccessField) + + ciType* declared_type() const; + +- // generic +- HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile ++ // generic; cannot be eliminated if needs patching or if volatile. ++ HASHING3(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset(), declared_type()) + }; + + +@@ -962,8 +964,8 @@ LEAF(LoadIndexed, AccessIndexed) + ciType* exact_type() const; + ciType* declared_type() const; + +- // generic +- HASHING2(LoadIndexed, true, array()->subst(), index()->subst()) ++ // generic; ++ HASHING3(LoadIndexed, true, type()->tag(), array()->subst(), index()->subst()) + }; + + +diff --git a/src/hotspot/share/gc/g1/g1InCSetState.hpp b/src/hotspot/share/gc/g1/g1InCSetState.hpp +index c60609617..f0b8638c1 100644 +--- a/src/hotspot/share/gc/g1/g1InCSetState.hpp ++++ b/src/hotspot/share/gc/g1/g1InCSetState.hpp +@@ -70,7 +70,6 @@ struct InCSetState { + + const char* get_type_str() const { + switch (value()) { +- //case Optional: return "Optional"; + case Humongous: return "Humongous"; + case NotInCSet: return "NotInCSet"; + case Young: return "Young"; +diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp +index 66e1b32a6..7a403c3b2 100644 +--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp ++++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp +@@ -541,7 +541,7 @@ public: + // Claim the block and get the block index. + size_t claim_and_get_block() { + size_t block_index; +- block_index = Atomic::add(1u, &_claimed_index) - 1; // TODO: original impl is: Atomic::fetch_and_add(&_claimed_index, 1u); ++ block_index = Atomic::add(1u, &_claimed_index) - 1; + + PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen(); + size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims; +diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp +index 8b4be7d11..1b9dd5ada 100644 +--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp ++++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp +@@ -217,7 +217,7 @@ public: + // Allow barrier sets to have shared state that is preserved across a compilation unit. + // This could for example comprise macro nodes to be expanded during macro expansion. + virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; } +- virtual void optimize_loops(PhaseIdealLoop* phase, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { } ++ virtual bool optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { return false; } + // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be + // expanded later, then now is the time to do so. + virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; } +diff --git a/src/hotspot/share/gc/shared/taskqueue.hpp b/src/hotspot/share/gc/shared/taskqueue.hpp +index 246e82be6..110757684 100644 +--- a/src/hotspot/share/gc/shared/taskqueue.hpp ++++ b/src/hotspot/share/gc/shared/taskqueue.hpp +@@ -515,7 +515,7 @@ public: + // As above, but it also terminates if the should_exit_termination() + // method of the terminator parameter returns true. If terminator is + // NULL, then it is ignored. +- SHENANDOAHGC_ONLY(virtual) virtual bool offer_termination(TerminatorTerminator* terminator); ++ virtual bool offer_termination(TerminatorTerminator* terminator); + + // Reset the terminator, so that it may be reused again. + // The caller is responsible for ensuring that this is done +diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +index 5266c911e..849be8e99 100644 +--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp ++++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +@@ -875,7 +875,6 @@ void ShenandoahConcurrentMark::mark_loop_prework(uint w, ShenandoahTaskTerminato + + template + void ShenandoahConcurrentMark::mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint worker_id, ShenandoahTaskTerminator *terminator) { +- int seed = 17; + uintx stride = ShenandoahMarkLoopStride; + + ShenandoahHeap* heap = ShenandoahHeap::heap(); +@@ -929,7 +928,7 @@ void ShenandoahConcurrentMark::mark_loop_work(T* cl, ShenandoahLiveData* live_da + uint work = 0; + for (uint i = 0; i < stride; i++) { + if (q->pop(t) || +- queues->steal(worker_id, &seed, t)) { ++ queues->steal(worker_id, t)) { + do_task(q, cl, live_data, &t); + work++; + } else { +diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp +index dbc0eb274..e612a1ff8 100644 +--- a/src/hotspot/share/memory/heapInspection.cpp ++++ b/src/hotspot/share/memory/heapInspection.cpp +@@ -746,7 +746,7 @@ class RecordInstanceClosure : public ObjectClosure { + }; + + // Heap inspection for every worker. +-// When native OOM hanppens for KlassInfoTable, set _success to false. ++// When native OOM happens for KlassInfoTable, set _success to false. + void ParHeapInspectTask::work(uint worker_id) { + uintx missed_count = 0; + bool merge_success = true; +diff --git a/src/hotspot/share/opto/graphKit.cpp b/src/hotspot/share/opto/graphKit.cpp +index 356bd5ccc..3e742c0ef 100644 +--- a/src/hotspot/share/opto/graphKit.cpp ++++ b/src/hotspot/share/opto/graphKit.cpp +@@ -44,8 +44,8 @@ + #include "opto/runtime.hpp" + #include "runtime/deoptimization.hpp" + #include "runtime/sharedRuntime.hpp" +-#include "utilities/bitMap.inline.hpp" + #include "utilities/macros.hpp" ++#include "utilities/bitMap.inline.hpp" + #if INCLUDE_SHENANDOAHGC + #include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp" + #endif +diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp +index c65f2f6be..621110183 100644 +--- a/src/hotspot/share/opto/loopnode.cpp ++++ b/src/hotspot/share/opto/loopnode.cpp +@@ -2730,7 +2730,7 @@ bool PhaseIdealLoop::process_expensive_nodes() { + //----------------------------build_and_optimize------------------------------- + // Create a PhaseLoop. Build the ideal Loop tree. Map each Ideal Node to + // its corresponding LoopNode. If 'optimize' is true, do some loop cleanups. +-void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode, bool z_barrier_insertion) { ++void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) { + bool do_split_ifs = (mode == LoopOptsDefault || mode == LoopOptsLastRound); + bool skip_loop_opts = (mode == LoopOptsNone); + #if INCLUDE_SHENANDOAHGC +@@ -2801,8 +2801,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode, bool z_barrier_insert + } + + // Nothing to do, so get out +- bool stop_early = !C->has_loops() && !skip_loop_opts && !do_split_ifs && !_verify_me && !_verify_only SHENANDOAHGC_ONLY(&& !shenandoah_opts) && +- !z_barrier_insertion; ++ bool stop_early = !C->has_loops() && !skip_loop_opts && !do_split_ifs && !_verify_me && !_verify_only SHENANDOAHGC_ONLY(&& !shenandoah_opts); + bool do_expensive_nodes = C->should_optimize_expensive_nodes(_igvn); + if (stop_early && !do_expensive_nodes) { + _igvn.optimize(); // Cleanup NeverBranches +@@ -2958,16 +2957,6 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode, bool z_barrier_insert + } + #endif + +- if(z_barrier_insertion) { +- BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); +- bs->optimize_loops(this, visited, nstack, worklist); +- _igvn.optimize(); +- if (C->log() != NULL) { +- log_loop_tree(_ltree_root, _ltree_root, C->log()); +- } +- return; +- } +- + if (ReassociateInvariants) { + // Reassociate invariants and prep for split_thru_phi + for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) { +diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp +index 8bc62a89e..56b8492d3 100644 +--- a/src/hotspot/share/opto/loopnode.hpp ++++ b/src/hotspot/share/opto/loopnode.hpp +@@ -936,7 +936,7 @@ public: + } + + // build the loop tree and perform any requested optimizations +- void build_and_optimize(LoopOptsMode mode, bool z_barrier_insertion = false); ++ void build_and_optimize(LoopOptsMode mode); + + // Dominators for the sea of nodes + void Dominators(); +@@ -946,13 +946,13 @@ public: + Node *dom_lca_internal( Node *n1, Node *n2 ) const; + + // Compute the Ideal Node to Loop mapping +- PhaseIdealLoop(PhaseIterGVN &igvn, LoopOptsMode mode, bool z_barrier_insertion = false) : ++ PhaseIdealLoop(PhaseIterGVN &igvn, LoopOptsMode mode) : + PhaseTransform(Ideal_Loop), + _igvn(igvn), + _dom_lca_tags(arena()), // Thread::resource_area + _verify_me(NULL), + _verify_only(false) { +- build_and_optimize(mode, z_barrier_insertion); ++ build_and_optimize(mode); + } + + // Verify that verify_me made the same decisions as a fresh run. +diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp +index f3c845772..18ea89b85 100644 +--- a/src/hotspot/share/prims/unsafe.cpp ++++ b/src/hotspot/share/prims/unsafe.cpp +@@ -1111,9 +1111,11 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { + {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, + + {CC "isBigEndian0", CC "()Z", FN_PTR(Unsafe_isBigEndian0)}, ++ {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)}, ++ + {CC "getUseHashMapIntegerCache", CC "()Z", FN_PTR(Unsafe_GetUseHashMapIntegerCache)}, + {CC "getUseFastSerializer", CC "()Z", FN_PTR(Unsafe_GetUseFastSerializer)}, +- {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)} ++ + }; + + #undef CC +diff --git a/src/hotspot/share/runtime/memcpy.cpp b/src/hotspot/share/runtime/memcpy.cpp +new file mode 100644 +index 000000000..ed8330679 +--- /dev/null ++++ b/src/hotspot/share/runtime/memcpy.cpp +@@ -0,0 +1,20 @@ ++/* ++ * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. ++ */ ++ ++#if defined( __GNUC__ ) && \ ++(__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) ++#include ++ ++#if (defined AMD64) || (defined amd64) ++/* some systems do not have newest memcpy@@GLIBC_2.14 - stay with old good one */ ++asm (".symver memcpy, memcpy@GLIBC_2.2.5"); ++ ++extern "C"{ ++ void *__wrap_memcpy(void *dest, const void *src, size_t n) ++ { ++ return memcpy(dest, src, n); ++ } ++} ++#endif ++#endif +diff --git a/src/hotspot/share/runtime/stackValue.cpp b/src/hotspot/share/runtime/stackValue.cpp +index cab1de79a..6a67574ad 100644 +--- a/src/hotspot/share/runtime/stackValue.cpp ++++ b/src/hotspot/share/runtime/stackValue.cpp +@@ -132,10 +132,9 @@ StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* r + val = (oop)NULL; + } + #endif +-#if INCLUDE_ZGC +- // Deoptimization must make sure all oop have passed load barrier +- if (UseZGC) { +- val = ZBarrier::load_barrier_on_oop_field_preloaded((oop*)value_addr, val); ++#if INCLUDE_SHENANDOAHGC ++ if (UseShenandoahGC) { ++ val = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(val); + } + #endif + +diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp +index b0f3b2e87..dbe65922e 100644 +--- a/src/hotspot/share/services/attachListener.cpp ++++ b/src/hotspot/share/services/attachListener.cpp +@@ -368,6 +368,7 @@ static void attach_listener_thread_entry(JavaThread* thread, TRAPS) { + for (;;) { + AttachOperation* op = AttachListener::dequeue(); + if (op == NULL) { ++ AttachListener::set_initialized(false); + return; // dequeue failed or shutdown + } + +diff --git a/src/hotspot/share/services/attachListener.hpp b/src/hotspot/share/services/attachListener.hpp +index 4e13fe326..5f5ca3d0f 100644 +--- a/src/hotspot/share/services/attachListener.hpp ++++ b/src/hotspot/share/services/attachListener.hpp +@@ -72,7 +72,7 @@ class AttachListener: AllStatic { + + public: + static bool is_initialized() { return _initialized; } +- static void set_initialized() { _initialized = true; } ++ static void set_initialized(bool init = true) { _initialized = init; } + + // indicates if this VM supports attach-on-demand + static bool is_attach_supported() { return !DisableAttachMechanism; } +diff --git a/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java b/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java +index 1cbbf9cfc..ef384e609 100644 +--- a/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java ++++ b/src/java.base/share/classes/javax/net/ssl/SSLServerSocketFactory.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -112,7 +112,7 @@ public abstract class SSLServerSocketFactory extends ServerSocketFactory + + try { + return SSLContext.getDefault().getServerSocketFactory(); +- } catch (NoSuchAlgorithmException e) { ++ } catch (NoSuchAlgorithmException | UnsupportedOperationException e) { + return new DefaultSSLServerSocketFactory(e); + } + } +diff --git a/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java b/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java +index 39a9918d4..1115c48d8 100644 +--- a/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java ++++ b/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -121,7 +121,7 @@ public abstract class SSLSocketFactory extends SocketFactory + + try { + return SSLContext.getDefault().getSocketFactory(); +- } catch (NoSuchAlgorithmException e) { ++ } catch (NoSuchAlgorithmException | UnsupportedOperationException e) { + return new DefaultSSLSocketFactory(e); + } + } +diff --git a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java +index 6068de9e7..a104a25df 100644 +--- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java ++++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java +@@ -207,6 +207,10 @@ public abstract class SSLContextImpl extends SSLContextSpi { + if (!isInitialized) { + throw new IllegalStateException("SSLContext is not initialized"); + } ++ if (isDTLS()) { ++ throw new UnsupportedOperationException( ++ "DTLS not supported with SSLSocket"); ++ } + return new SSLSocketFactoryImpl(this); + } + +@@ -215,6 +219,10 @@ public abstract class SSLContextImpl extends SSLContextSpi { + if (!isInitialized) { + throw new IllegalStateException("SSLContext is not initialized"); + } ++ if (isDTLS()) { ++ throw new UnsupportedOperationException( ++ "DTLS not supported with SSLServerSocket"); ++ } + return new SSLServerSocketFactoryImpl(this); + } + +@@ -1262,6 +1270,25 @@ public abstract class SSLContextImpl extends SSLContextSpi { + serverDefaultProtocols, false); + } + ++ @Override ++ protected SSLParameters engineGetDefaultSSLParameters() { ++ SSLEngine engine = createSSLEngineImpl(); ++ // Note: The TLSContext defaults to client side SSLParameters. ++ // We can do the same here. Please don't change the behavior ++ // for compatibility. ++ engine.setUseClientMode(true); ++ return engine.getSSLParameters(); ++ } ++ ++ @Override ++ protected SSLParameters engineGetSupportedSSLParameters() { ++ SSLEngine engine = createSSLEngineImpl(); ++ SSLParameters params = new SSLParameters(); ++ params.setCipherSuites(engine.getSupportedCipherSuites()); ++ params.setProtocols(engine.getSupportedProtocols()); ++ return params; ++ } ++ + @Override + List getSupportedProtocolVersions() { + return supportedProtocols; +diff --git a/test/hotspot/jtreg/compiler/c1/TestValueNumberingNullObject.java b/test/hotspot/jtreg/compiler/c1/TestValueNumberingNullObject.java +new file mode 100644 +index 000000000..66d5581f5 +--- /dev/null ++++ b/test/hotspot/jtreg/compiler/c1/TestValueNumberingNullObject.java +@@ -0,0 +1,131 @@ ++/* ++ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++/* ++ * @test ++ * @bug 8237894 ++ * @summary CTW: C1 compilation fails with assert(x->type()->tag() == f->type()->tag()) failed: should have same type ++ * ++ * @run main/othervm ++ * -Xcomp -Xbatch -XX:CompileCommand=compileonly,compiler.c1.T*::* ++ * -XX:CompileCommand=exclude,compiler.c1.TestValueNumberingNullObject::main ++ * -XX:CompileCommand=inline,*.* ++ * -XX:TieredStopAtLevel=3 ++ * compiler.c1.TestValueNumberingNullObject ++ */ ++ ++package compiler.c1; ++ ++class T1 { ++ ++ public T2 f1; ++ ++ public int za() { ++ return 0; ++ } ++ ++ public int zb() { ++ return 0; ++ } ++ ++ public int zc() { ++ return 0; ++ } ++ ++ public int zd() { ++ return 0; ++ } ++ ++ public int ze() { ++ return 0; ++ } ++ ++ public int zf() { ++ return 0; ++ } ++ ++ public int zg() { ++ return 0; ++ } ++ ++ public int zh() { ++ return 0; ++ } ++} ++ ++class T2 { ++ ++ public T1 f1; ++ ++ public int zh() { ++ return 0; ++ } ++} ++ ++public class TestValueNumberingNullObject { ++ ++ public static void main(String args[]) { ++ new T1(); // Load ++ new T2(); // Load ++ try { ++ // case 1 ++ // Null based field access. ++ // Value Numbering null based field access causes instructions to be eliminated across type/subtypes. ++ // declared type of these instructions are field type, so it being receiver causes problems to Type System. ++ // to mitigate this issue, we hash declared type in addition to existing hashing. ++ testFieldAccess(); ++ } catch (Exception e) { ++ } ++ try { ++ // case 2 ++ // Null based indexed access. ++ // Value Numbering null based indexed access causes instructions to be eliminated across type/subtypes. ++ // element basic type in encoded in the access instruction, this causes problems to Type system. ++ // declared type of these instructions are null, so it being receiver doesn't cause any problem to Type System. ++ // to mitigate this issue, we hash basic type in addition to existing hashing ++ basicTypeAccess(); ++ } catch (Exception e) { ++ } ++ } ++ ++ static long testFieldAccess() { ++ T1 t1 = null; ++ T2 t2 = null; ++ T1[] t3 = null; ++ T2[] t4 = null; ++ ++ long value = t1.f1.zh() + t2.f1.zh(); ++ // null array object based field access. ++ value += t3[2].f1.zh() + t4[2].f1.zh(); ++ return value; ++ } ++ ++ static long basicTypeAccess() { ++ long[] f1 = null; ++ int[] f2 = null; ++ T2[] t2 = null; ++ T1[] t1 = null; ++ return f1[5] + f2[5] + t2[5].zh() + t1[5].zh(); ++ } ++} ++ +diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +index 540f353e6..727b9b948 100644 +--- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java ++++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +@@ -53,7 +53,7 @@ public class VerifyCACerts { + + File.separator + "security" + File.separator + "cacerts"; + + // The numbers of certs now. +- private static final int COUNT = 97; ++ private static final int COUNT = 89; + + // SHA-256 of cacerts, can be generated with + // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 +@@ -92,12 +92,6 @@ public class VerifyCACerts { + "E7:93:C9:B0:2F:D8:AA:13:E2:1C:31:22:8A:CC:B0:81:19:64:3B:74:9C:89:89:64:B1:74:6D:46:C3:D4:CB:D2"); + put("usertrusteccca [jdk]", + "4F:F4:60:D5:4B:9C:86:DA:BF:BC:FC:57:12:E0:40:0D:2B:ED:3F:BC:4D:4F:BD:AA:86:E0:6A:DC:D2:A9:AD:7A"); +- put("utnuserfirstobjectca [jdk]", +- "6F:FF:78:E4:00:A7:0C:11:01:1C:D8:59:77:C4:59:FB:5A:F9:6A:3D:F0:54:08:20:D0:F4:B8:60:78:75:E5:8F"); +- put("addtrustexternalca [jdk]", +- "68:7F:A4:51:38:22:78:FF:F0:C8:B1:1F:8D:43:D5:76:67:1C:6E:B2:BC:EA:B4:13:FB:83:D9:65:D0:6D:2F:F2"); +- put("addtrustqualifiedca [jdk]", +- "80:95:21:08:05:DB:4B:BC:35:5E:44:28:D8:FD:6E:C2:CD:E3:AB:5F:B9:7A:99:42:98:8E:B8:F4:DC:D0:60:16"); + put("baltimorecybertrustca [jdk]", + "16:AF:57:A9:F6:76:B0:AB:12:60:95:AA:5E:BA:DE:F2:2A:B3:11:19:D6:44:AC:95:CD:4B:93:DB:F3:F2:6A:EB"); + put("digicertglobalrootca [jdk]", +@@ -132,16 +126,6 @@ public class VerifyCACerts { + "A4:31:0D:50:AF:18:A6:44:71:90:37:2A:86:AF:AF:8B:95:1F:FB:43:1D:83:7F:1E:56:88:B4:59:71:ED:15:57"); + put("thawteprimaryrootcag3 [jdk]", + "4B:03:F4:58:07:AD:70:F2:1B:FC:2C:AE:71:C9:FD:E4:60:4C:06:4C:F5:FF:B6:86:BA:E5:DB:AA:D7:FD:D3:4C"); +- put("thawtepremiumserverca [jdk]", +- "3F:9F:27:D5:83:20:4B:9E:09:C8:A3:D2:06:6C:4B:57:D3:A2:47:9C:36:93:65:08:80:50:56:98:10:5D:BC:E9"); +- put("verisigntsaca [jdk]", +- "CB:6B:05:D9:E8:E5:7C:D8:82:B1:0B:4D:B7:0D:E4:BB:1D:E4:2B:A4:8A:7B:D0:31:8B:63:5B:F6:E7:78:1A:9D"); +- put("verisignclass2g2ca [jdk]", +- "3A:43:E2:20:FE:7F:3E:A9:65:3D:1E:21:74:2E:AC:2B:75:C2:0F:D8:98:03:05:BC:50:2C:AF:8C:2D:9B:41:A1"); +- put("verisignclass3ca [jdk]", +- "A4:B6:B3:99:6F:C2:F3:06:B3:FD:86:81:BD:63:41:3D:8C:50:09:CC:4F:A3:29:C2:CC:F0:E2:FA:1B:14:03:05"); +- put("verisignclass3g2ca [jdk]", +- "83:CE:3C:12:29:68:8A:59:3D:48:5F:81:97:3C:0F:91:95:43:1E:DA:37:CC:5E:36:43:0E:79:C7:A8:88:63:8B"); + put("verisignuniversalrootca [jdk]", + "23:99:56:11:27:A5:71:25:DE:8C:EF:EA:61:0D:DF:2F:A0:78:B5:C8:06:7F:4E:82:82:90:BF:B8:60:E8:4B:3C"); + put("verisignclass3g3ca [jdk]", +diff --git a/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java b/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java +index 0dc0ffac2..e4e9434f9 100644 +--- a/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java ++++ b/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java +@@ -192,33 +192,13 @@ public class CustomizedDTLSDefaultProtocols { + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); +- System.out.println("\tChecking SSLSocket.getSSLParameters()"); +- SocketFactory fac = context.getSocketFactory(); +- SSLSocket socket = (SSLSocket)fac.createSocket(); +- parameters = socket.getSSLParameters(); +- +- protocols = parameters.getProtocols(); +- failed |= !checkProtocols(protocols, cv.enabledProtocols); +- +- ciphers = parameters.getCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); +- protocols = socket.getEnabledProtocols(); +- failed |= !checkProtocols(protocols, cv.enabledProtocols); +- +- System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); +- ciphers = socket.getEnabledCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); +- protocols = socket.getSupportedProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- System.out.println( +- "\tChecking SSLEngine.getSupportedCipherSuites()"); +- ciphers = socket.getSupportedCipherSuites(); +- failed |= !checkCipherSuites(ciphers); ++ try { ++ context.getSocketFactory(); ++ failed = true; ++ System.out.println("SSLSocket returned a socket for DTLS"); ++ } catch (UnsupportedOperationException e) { ++ System.out.println("\t " + e.getMessage()); ++ } + + // + // Check SSLServerSocket +@@ -226,33 +206,13 @@ public class CustomizedDTLSDefaultProtocols { + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); +- System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); +- SSLServerSocketFactory sf = context.getServerSocketFactory(); +- SSLServerSocket ssocket = (SSLServerSocket)sf.createServerSocket(); +- parameters = ssocket.getSSLParameters(); +- +- protocols = parameters.getProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- ciphers = parameters.getCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); +- protocols = ssocket.getEnabledProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); +- ciphers = ssocket.getEnabledCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); +- protocols = ssocket.getSupportedProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- System.out.println( +- "\tChecking SSLEngine.getSupportedCipherSuites()"); +- ciphers = ssocket.getSupportedCipherSuites(); +- failed |= !checkCipherSuites(ciphers); ++ try { ++ context.getServerSocketFactory(); ++ failed = true; ++ System.out.println("SSLServerSocket returned a socket for DTLS"); ++ } catch (UnsupportedOperationException e) { ++ System.out.println("\t " + e.getMessage()); ++ } + } + + if (failed) { +diff --git a/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java b/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java +index b0e805c06..ea0bd8ccf 100644 +--- a/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java ++++ b/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java +@@ -32,6 +32,7 @@ + * CustomizedDTLSServerDefaultProtocols + */ + ++import java.lang.UnsupportedOperationException; + import java.security.NoSuchAlgorithmException; + import java.security.Security; + import java.util.Arrays; +@@ -212,33 +213,13 @@ public class CustomizedDTLSServerDefaultProtocols { + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); +- System.out.println("\tChecking SSLSocket.getSSLParameters()"); +- SocketFactory fac = context.getSocketFactory(); +- SSLSocket socket = (SSLSocket) fac.createSocket(); +- parameters = socket.getSSLParameters(); +- +- protocols = parameters.getProtocols(); +- failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); +- +- ciphers = parameters.getCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLSocket.getEnabledProtocols()"); +- protocols = socket.getEnabledProtocols(); +- failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); +- +- System.out.println("\tChecking SSLSocket.getEnabledCipherSuites()"); +- ciphers = socket.getEnabledCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLSocket.getSupportedProtocols()"); +- protocols = socket.getSupportedProtocols(); +- failed |= !checkProtocols(protocols, supportedProtocols); +- +- System.out.println( +- "\tChecking SSLSocket.getSupportedCipherSuites()"); +- ciphers = socket.getSupportedCipherSuites(); +- failed |= !checkCipherSuites(ciphers); ++ try { ++ context.getSocketFactory(); ++ failed = true; ++ System.out.println("SSLSocket returned a socket for DTLS"); ++ } catch (UnsupportedOperationException e) { ++ System.out.println("\t " + e.getMessage()); ++ } + + // + // Check SSLServerSocket +@@ -246,33 +227,13 @@ public class CustomizedDTLSServerDefaultProtocols { + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); +- System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); +- SSLServerSocketFactory sf = context.getServerSocketFactory(); +- SSLServerSocket ssocket = (SSLServerSocket) sf.createServerSocket(); +- parameters = ssocket.getSSLParameters(); +- +- protocols = parameters.getProtocols(); +- failed |= !checkProtocols(protocols, cv.serverEnabledProtocols); +- +- ciphers = parameters.getCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); +- protocols = ssocket.getEnabledProtocols(); +- failed |= !checkProtocols(protocols, cv.serverEnabledProtocols); +- +- System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); +- ciphers = ssocket.getEnabledCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); +- protocols = ssocket.getSupportedProtocols(); +- failed |= !checkProtocols(protocols, supportedProtocols); +- +- System.out.println( +- "\tChecking SSLEngine.getSupportedCipherSuites()"); +- ciphers = ssocket.getSupportedCipherSuites(); +- failed |= !checkCipherSuites(ciphers); ++ try { ++ context.getServerSocketFactory(); ++ failed = true; ++ System.out.println("SSLServerSocket returned a socket for DTLS"); ++ } catch (UnsupportedOperationException e) { ++ System.out.println("\t " + e.getMessage()); ++ } + + if (failed) { + throw new Exception("Run into problems, see log for more details"); +diff --git a/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java b/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java +index ccfff01b6..029771541 100644 +--- a/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java ++++ b/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java +@@ -189,33 +189,13 @@ public class DefaultDTLSEnabledProtocols { + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); +- System.out.println("\tChecking SSLSocket.getSSLParameters()"); +- SocketFactory fac = context.getSocketFactory(); +- SSLSocket socket = (SSLSocket)fac.createSocket(); +- parameters = socket.getSSLParameters(); +- +- protocols = parameters.getProtocols(); +- failed |= !checkProtocols(protocols, cv.enabledProtocols); +- +- ciphers = parameters.getCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); +- protocols = socket.getEnabledProtocols(); +- failed |= !checkProtocols(protocols, cv.enabledProtocols); +- +- System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); +- ciphers = socket.getEnabledCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); +- protocols = socket.getSupportedProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- System.out.println( +- "\tChecking SSLEngine.getSupportedCipherSuites()"); +- ciphers = socket.getSupportedCipherSuites(); +- failed |= !checkCipherSuites(ciphers); ++ try { ++ context.getSocketFactory(); ++ failed = true; ++ System.out.println("SSLSocket returned a socket for DTLS"); ++ } catch (UnsupportedOperationException e) { ++ System.out.println("\t " + e.getMessage()); ++ } + + // + // Check SSLServerSocket +@@ -223,33 +203,13 @@ public class DefaultDTLSEnabledProtocols { + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); +- System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); +- SSLServerSocketFactory sf = context.getServerSocketFactory(); +- SSLServerSocket ssocket = (SSLServerSocket)sf.createServerSocket(); +- parameters = ssocket.getSSLParameters(); +- +- protocols = parameters.getProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- ciphers = parameters.getCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); +- protocols = ssocket.getEnabledProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); +- ciphers = ssocket.getEnabledCipherSuites(); +- failed |= !checkCipherSuites(ciphers); +- +- System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); +- protocols = ssocket.getSupportedProtocols(); +- failed |= !checkProtocols(protocols, cv.supportedProtocols); +- +- System.out.println( +- "\tChecking SSLEngine.getSupportedCipherSuites()"); +- ciphers = ssocket.getSupportedCipherSuites(); +- failed |= !checkCipherSuites(ciphers); ++ try { ++ context.getServerSocketFactory(); ++ failed = true; ++ System.out.println("SSLServerSocket returned a socket for DTLS"); ++ } catch (UnsupportedOperationException e) { ++ System.out.println("\t " + e.getMessage()); ++ } + } + + if (failed) {