changeset 10923:f79e943d15a7

Merge jdk8u292-b05
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Sun, 25 Apr 2021 18:18:49 +0100
parents 27cf2684ed40 (current diff) a5795acea814 (diff)
children dd646a857cc3
files .hgtags THIRD_PARTY_README agent/make/Makefile agent/src/os/linux/LinuxDebuggerLocal.c agent/src/os/linux/Makefile agent/src/os/linux/libproc.h agent/src/share/classes/sun/jvm/hotspot/HSDB.java agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java make/defs.make make/linux/makefiles/aarch64.make make/linux/makefiles/buildtree.make make/linux/makefiles/defs.make make/linux/makefiles/gcc.make make/linux/makefiles/sa.make make/linux/platform_aarch64 make/windows/makefiles/compile.make src/cpu/aarch64/vm/aarch64.ad src/cpu/aarch64/vm/aarch64Test.cpp src/cpu/aarch64/vm/aarch64_ad.m4 src/cpu/aarch64/vm/assembler_aarch64.cpp src/cpu/aarch64/vm/assembler_aarch64.hpp src/cpu/aarch64/vm/assembler_aarch64.inline.hpp src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp src/cpu/aarch64/vm/bytecodes_aarch64.cpp src/cpu/aarch64/vm/bytecodes_aarch64.hpp src/cpu/aarch64/vm/bytes_aarch64.hpp src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp src/cpu/aarch64/vm/c1_Defs_aarch64.hpp src/cpu/aarch64/vm/c1_FpuStackSim_aarch64.cpp src/cpu/aarch64/vm/c1_FpuStackSim_aarch64.hpp src/cpu/aarch64/vm/c1_FrameMap_aarch64.cpp src/cpu/aarch64/vm/c1_FrameMap_aarch64.hpp src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.hpp src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp src/cpu/aarch64/vm/c1_LinearScan_aarch64.hpp src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.cpp src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp src/cpu/aarch64/vm/c1_globals_aarch64.hpp src/cpu/aarch64/vm/c2_globals_aarch64.hpp src/cpu/aarch64/vm/c2_init_aarch64.cpp src/cpu/aarch64/vm/codeBuffer_aarch64.hpp src/cpu/aarch64/vm/compiledIC_aarch64.cpp src/cpu/aarch64/vm/copy_aarch64.hpp src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp src/cpu/aarch64/vm/debug_aarch64.cpp src/cpu/aarch64/vm/depChecker_aarch64.cpp src/cpu/aarch64/vm/depChecker_aarch64.hpp src/cpu/aarch64/vm/disassembler_aarch64.hpp src/cpu/aarch64/vm/frame_aarch64.cpp src/cpu/aarch64/vm/frame_aarch64.hpp src/cpu/aarch64/vm/frame_aarch64.inline.hpp src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp src/cpu/aarch64/vm/globals_aarch64.hpp src/cpu/aarch64/vm/icBuffer_aarch64.cpp src/cpu/aarch64/vm/icache_aarch64.cpp src/cpu/aarch64/vm/icache_aarch64.hpp src/cpu/aarch64/vm/immediate_aarch64.cpp src/cpu/aarch64/vm/immediate_aarch64.hpp src/cpu/aarch64/vm/interp_masm_aarch64.cpp src/cpu/aarch64/vm/interp_masm_aarch64.hpp src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp src/cpu/aarch64/vm/interpreterRT_aarch64.cpp src/cpu/aarch64/vm/interpreterRT_aarch64.hpp src/cpu/aarch64/vm/interpreter_aarch64.cpp src/cpu/aarch64/vm/interpreter_aarch64.hpp src/cpu/aarch64/vm/javaFrameAnchor_aarch64.hpp src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp src/cpu/aarch64/vm/jniTypes_aarch64.hpp src/cpu/aarch64/vm/jni_aarch64.h src/cpu/aarch64/vm/macroAssembler_aarch64.cpp src/cpu/aarch64/vm/macroAssembler_aarch64.hpp src/cpu/aarch64/vm/macroAssembler_aarch64.inline.hpp src/cpu/aarch64/vm/metaspaceShared_aarch64.cpp src/cpu/aarch64/vm/methodHandles_aarch64.cpp src/cpu/aarch64/vm/methodHandles_aarch64.hpp src/cpu/aarch64/vm/nativeInst_aarch64.cpp src/cpu/aarch64/vm/nativeInst_aarch64.hpp src/cpu/aarch64/vm/registerMap_aarch64.hpp src/cpu/aarch64/vm/register_aarch64.cpp src/cpu/aarch64/vm/register_aarch64.hpp src/cpu/aarch64/vm/register_definitions_aarch64.cpp src/cpu/aarch64/vm/relocInfo_aarch64.cpp src/cpu/aarch64/vm/relocInfo_aarch64.hpp src/cpu/aarch64/vm/runtime_aarch64.cpp src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp src/cpu/aarch64/vm/stubGenerator_aarch64.cpp src/cpu/aarch64/vm/stubRoutines_aarch64.cpp src/cpu/aarch64/vm/stubRoutines_aarch64.hpp src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp src/cpu/aarch64/vm/templateTable_aarch64.cpp src/cpu/aarch64/vm/templateTable_aarch64.hpp src/cpu/aarch64/vm/vmStructs_aarch64.hpp src/cpu/aarch64/vm/vm_version_aarch64.cpp src/cpu/aarch64/vm/vm_version_aarch64.hpp src/cpu/aarch64/vm/vm_version_ext_aarch64.cpp src/cpu/aarch64/vm/vmreg_aarch64.cpp src/cpu/aarch64/vm/vmreg_aarch64.hpp src/cpu/aarch64/vm/vmreg_aarch64.inline.hpp src/cpu/aarch64/vm/vtableStubs_aarch64.cpp src/cpu/ppc/vm/macroAssembler_ppc.cpp src/os/linux/vm/os_linux.cpp src/os_cpu/linux_aarch64/vm/assembler_linux_aarch64.cpp src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp src/os_cpu/linux_aarch64/vm/bytes_linux_aarch64.inline.hpp src/os_cpu/linux_aarch64/vm/copy_linux_aarch64.inline.hpp src/os_cpu/linux_aarch64/vm/copy_linux_aarch64.s src/os_cpu/linux_aarch64/vm/globals_linux_aarch64.hpp src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp src/os_cpu/linux_aarch64/vm/os_linux_aarch64.hpp src/os_cpu/linux_aarch64/vm/os_linux_aarch64.inline.hpp src/os_cpu/linux_aarch64/vm/prefetch_linux_aarch64.inline.hpp src/os_cpu/linux_aarch64/vm/threadLS_linux_aarch64.cpp src/os_cpu/linux_aarch64/vm/threadLS_linux_aarch64.hpp src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp src/os_cpu/linux_aarch64/vm/vmStructs_linux_aarch64.hpp src/share/tools/hsdis/hsdis.c src/share/vm/adlc/formssel.cpp src/share/vm/adlc/main.cpp src/share/vm/asm/assembler.hpp src/share/vm/asm/assembler.inline.hpp src/share/vm/asm/codeBuffer.hpp src/share/vm/asm/macroAssembler.hpp src/share/vm/asm/macroAssembler.inline.hpp src/share/vm/asm/register.hpp src/share/vm/c1/c1_Canonicalizer.cpp src/share/vm/c1/c1_FrameMap.cpp src/share/vm/c1/c1_FrameMap.hpp src/share/vm/c1/c1_LIR.cpp src/share/vm/c1/c1_LIR.hpp src/share/vm/c1/c1_LIRAssembler.cpp src/share/vm/c1/c1_LIRAssembler.hpp src/share/vm/c1/c1_LIRGenerator.cpp src/share/vm/c1/c1_LinearScan.cpp src/share/vm/c1/c1_LinearScan.hpp src/share/vm/c1/c1_MacroAssembler.hpp src/share/vm/c1/c1_Runtime1.cpp src/share/vm/c1/c1_Runtime1.hpp src/share/vm/c1/c1_globals.hpp src/share/vm/ci/ciMethodData.cpp src/share/vm/classfile/bytecodeAssembler.cpp src/share/vm/classfile/classFileStream.hpp src/share/vm/classfile/stackMapTable.hpp src/share/vm/classfile/verifier.cpp src/share/vm/code/codeBlob.cpp src/share/vm/code/compiledIC.hpp src/share/vm/code/relocInfo.hpp src/share/vm/code/vmreg.hpp src/share/vm/compiler/disassembler.cpp src/share/vm/compiler/disassembler.hpp src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp src/share/vm/gc_implementation/g1/g1RemSet.cpp src/share/vm/gc_implementation/g1/heapRegion.cpp src/share/vm/gc_implementation/parNew/parNewGeneration.cpp src/share/vm/interpreter/abstractInterpreter.hpp src/share/vm/interpreter/bytecode.hpp src/share/vm/interpreter/bytecodeInterpreter.hpp src/share/vm/interpreter/bytecodeStream.hpp src/share/vm/interpreter/bytecodes.cpp src/share/vm/interpreter/bytecodes.hpp src/share/vm/interpreter/cppInterpreter.hpp src/share/vm/interpreter/cppInterpreterGenerator.hpp src/share/vm/interpreter/interpreter.hpp src/share/vm/interpreter/interpreterRuntime.cpp src/share/vm/interpreter/interpreterRuntime.hpp src/share/vm/interpreter/templateInterpreter.hpp src/share/vm/interpreter/templateInterpreterGenerator.hpp src/share/vm/interpreter/templateTable.hpp src/share/vm/memory/allocation.inline.hpp src/share/vm/memory/metaspace.cpp src/share/vm/oops/constantPool.hpp src/share/vm/oops/oop.inline.hpp src/share/vm/opto/buildOopMap.cpp src/share/vm/opto/c2_globals.hpp src/share/vm/opto/c2compiler.cpp src/share/vm/opto/callnode.hpp src/share/vm/opto/compile.cpp src/share/vm/opto/gcm.cpp src/share/vm/opto/graphKit.cpp src/share/vm/opto/lcm.cpp src/share/vm/opto/library_call.cpp src/share/vm/opto/locknode.hpp src/share/vm/opto/macro.cpp src/share/vm/opto/matcher.cpp src/share/vm/opto/memnode.cpp src/share/vm/opto/memnode.hpp src/share/vm/opto/output.hpp src/share/vm/opto/parse3.cpp src/share/vm/opto/phaseX.hpp src/share/vm/opto/regmask.cpp src/share/vm/opto/regmask.hpp src/share/vm/opto/runtime.cpp src/share/vm/prims/jniCheck.cpp src/share/vm/prims/jni_md.h src/share/vm/prims/jvmtiClassFileReconstituter.cpp src/share/vm/prims/jvmtiExport.cpp src/share/vm/prims/methodHandles.hpp src/share/vm/runtime/advancedThresholdPolicy.cpp src/share/vm/runtime/arguments.cpp src/share/vm/runtime/atomic.inline.hpp src/share/vm/runtime/deoptimization.cpp src/share/vm/runtime/dtraceJSDT.hpp src/share/vm/runtime/frame.cpp src/share/vm/runtime/frame.hpp src/share/vm/runtime/frame.inline.hpp src/share/vm/runtime/globals.hpp src/share/vm/runtime/java.cpp src/share/vm/runtime/javaCalls.hpp src/share/vm/runtime/javaFrameAnchor.hpp src/share/vm/runtime/os.hpp src/share/vm/runtime/relocator.hpp src/share/vm/runtime/safepoint.cpp src/share/vm/runtime/sharedRuntime.cpp src/share/vm/runtime/stackValueCollection.cpp src/share/vm/runtime/stubRoutines.hpp src/share/vm/runtime/thread.hpp src/share/vm/runtime/threadLocalStorage.hpp src/share/vm/runtime/vframeArray.cpp src/share/vm/runtime/vmStructs.cpp src/share/vm/runtime/vm_version.cpp src/share/vm/services/memoryPool.cpp src/share/vm/utilities/copy.hpp src/share/vm/utilities/globalDefinitions.hpp src/share/vm/utilities/macros.hpp test/aarch64/DoubleArithTests.java test/aarch64/DoubleCmpTests.java test/aarch64/FloatArithTests.java test/aarch64/FloatCmpTests.java test/aarch64/IntArithTests.java test/aarch64/IntCmpTests.java test/aarch64/IntLogicTests.java test/aarch64/IntShiftTests.java test/aarch64/LongArithTests.java test/aarch64/LongCmpTests.java test/aarch64/LongLogicTests.java test/aarch64/LongShiftTests.java test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java test/runtime/6929067/Test6929067.sh test/testlibrary/com/oracle/java/testlibrary/Platform.java
diffstat 61 files changed, 655 insertions(+), 257 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Apr 22 01:38:42 2021 +0100
+++ b/.hgtags	Sun Apr 25 18:18:49 2021 +0100
@@ -1433,3 +1433,9 @@
 fcfacb8f9da0749c20b9618246adda82e5e6241f jdk8u282-b08
 fcfacb8f9da0749c20b9618246adda82e5e6241f jdk8u282-ga
 adc340baec52aad297d19836cc3f9050c9d2fbba icedtea-3.18.0
+d7c102fe9c4736bca65b25da69093d84da141e65 jdk8u292-b00
+4fbe1b3f53bf38bbc326e9ec6714758c4abf0818 jdk8u292-b01
+540c4d7153913e8ab6f65441d93941cc427b27bb jdk8u292-b02
+306a4643e4d22f7558b4a725708cb39c82ac1cc1 jdk8u292-b03
+16bc2fd11c4c62b01473221b1b6b892a63723e18 jdk8u292-b04
+a435c913c8ce30f0487d05cfec1d9be3fcc57f10 jdk8u292-b05
--- a/THIRD_PARTY_README	Thu Apr 22 01:38:42 2021 +0100
+++ b/THIRD_PARTY_README	Sun Apr 25 18:18:49 2021 +0100
@@ -154,8 +154,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to CUP Parser Generator for 
-Java 0.10b, which may be included with JRE 8, JDK 8, and OpenJDK 8.
+%% This notice is provided with respect to CUP Parser Generator for
+Java 0.11b, which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
--- a/agent/src/share/classes/sun/jvm/hotspot/HSDB.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/HSDB.java	Sun Apr 25 18:18:49 2021 +0100
@@ -992,15 +992,20 @@
                                                      curFrame.getFP(),
                                                      anno));
             } else {
-              // For C2, which has null frame pointers on x86/amd64/aarch64
-              CodeBlob cb = VM.getVM().getCodeCache().findBlob(curFrame.getPC());
-              Address sp = curFrame.getSP();
-              if (Assert.ASSERTS_ENABLED) {
-                Assert.that(cb.getFrameSize() > 0, "CodeBlob must have non-zero frame size");
+              if (VM.getVM().getCPU().equals("x86") || VM.getVM().getCPU().equals("amd64") ||
+                  VM.getVM().getCPU().equals("aarch64")) {
+                // For C2, which has null frame pointers on x86/amd64
+                CodeBlob cb = VM.getVM().getCodeCache().findBlob(curFrame.getPC());
+                Address sp = curFrame.getSP();
+                if (Assert.ASSERTS_ENABLED) {
+                  Assert.that(cb.getFrameSize() > 0, "CodeBlob must have non-zero frame size");
+                }
+                annoPanel.addAnnotation(new Annotation(sp,
+                                                       sp.addOffsetTo(cb.getFrameSize()),
+                                                       anno));
+              } else {
+                Assert.that(VM.getVM().getCPU().equals("ia64"), "only ia64 should reach here");
               }
-              annoPanel.addAnnotation(new Annotation(sp,
-                                                     sp.addOffsetTo(cb.getFrameSize()),
-                                                     anno));
             }
 
             // Add interpreter frame annotations
--- a/agent/src/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java	Sun Apr 25 18:18:49 2021 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -75,7 +75,7 @@
     int rl = readInt();
     int h = reverseInt(rh);
     int l = reverseInt(rl);
-    return Double.longBitsToDouble((h << 32) | ((long)l & 0x00000000FFFFFFFFL));
+    return Double.longBitsToDouble(((long)h << 32) | ((long)l & 0x00000000FFFFFFFFL));
   }
 
   public long readLong() {
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java	Sun Apr 25 18:18:49 2021 +0100
@@ -63,9 +63,9 @@
       return "sparc";
     } else if (cpu.equals("ia64") || cpu.equals("amd64") || cpu.equals("x86_64")) {
       return cpu;
-    } else {if (cpu.equals("aarch64")) {
+    } else if (cpu.equals("aarch64")) {
       return cpu;
-    } else 
+    } else {
       try {
         Class pic = Class.forName("sun.jvm.hotspot.utilities.PlatformInfoClosed");
         AltPlatformInfo api = (AltPlatformInfo)pic.newInstance();
--- a/make/defs.make	Thu Apr 22 01:38:42 2021 +0100
+++ b/make/defs.make	Sun Apr 25 18:18:49 2021 +0100
@@ -334,13 +334,6 @@
   LIBARCH/ppc64   = ppc64
   LIBARCH/zero    = $(ZERO_LIBARCH)
 
-  # Override LIBARCH for ppc64le
-  ifeq ($(ARCH), ppc64)
-    ifeq ($(OPENJDK_TARGET_CPU_ENDIAN), little)
-      LIBARCH = ppc64le
-    endif
-  endif
-
   LP64_ARCH += sparcv9 amd64 ia64 ppc64 aarch64 zero
 endif
 
--- a/make/windows/makefiles/compile.make	Thu Apr 22 01:38:42 2021 +0100
+++ b/make/windows/makefiles/compile.make	Sun Apr 25 18:18:49 2021 +0100
@@ -159,6 +159,15 @@
 !if "$(MSC_VER)" == "1913"
 COMPILER_NAME=VS2017
 !endif
+!if "$(MSC_VER)" == "1914"
+COMPILER_NAME=VS2017
+!endif
+!if "$(MSC_VER)" == "1915"
+COMPILER_NAME=VS2017
+!endif
+!if "$(MSC_VER)" == "1916"
+COMPILER_NAME=VS2017
+!endif
 !endif
 
 # By default, we do not want to use the debug version of the msvcrt.dll file
--- a/src/cpu/aarch64/vm/aarch64.ad	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/aarch64/vm/aarch64.ad	Sun Apr 25 18:18:49 2021 +0100
@@ -1824,16 +1824,20 @@
   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;
+  }
 }
 
 //=============================================================================
@@ -3351,7 +3355,7 @@
     // markOop of object (disp_hdr) with the stack pointer.
     __ mov(rscratch1, sp);
     __ sub(disp_hdr, disp_hdr, rscratch1);
-    __ mov(tmp, (address) (~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place));
+    __ mov(tmp, (address) (~(os::vm_page_size()-1) | (uintptr_t)markOopDesc::lock_mask_in_place));
     // If condition is true we are cont and hence we can store 0 as the
     // displaced header in the box, which indicates that it is a recursive lock.
     __ ands(tmp/*==0?*/, disp_hdr, tmp);
@@ -12437,7 +12441,7 @@
 
   format %{ "mul   rscratch1, $op1, $op2\t#overflow check long\n\t"
             "smulh rscratch2, $op1, $op2\n\t"
-            "cmp   rscratch2, rscratch1, ASR #31\n\t"
+            "cmp   rscratch2, rscratch1, ASR #63\n\t"
             "movw  rscratch1, #0x80000000\n\t"
             "cselw rscratch1, rscratch1, zr, NE\n\t"
             "cmpw  rscratch1, #1" %}
@@ -12445,7 +12449,7 @@
   ins_encode %{
     __ mul(rscratch1, $op1$$Register, $op2$$Register);   // Result bits 0..63
     __ smulh(rscratch2, $op1$$Register, $op2$$Register); // Result bits 64..127
-    __ cmp(rscratch2, rscratch1, Assembler::ASR, 31);    // Top is pure sign ext
+    __ cmp(rscratch2, rscratch1, Assembler::ASR, 63);    // Top is pure sign ext
     __ movw(rscratch1, 0x80000000);                    // Develop 0 (EQ),
     __ cselw(rscratch1, rscratch1, zr, Assembler::NE); // or 0x80000000 (NE)
     __ cmpw(rscratch1, 1);                             // 0x80000000 - 1 => VS
@@ -12463,7 +12467,7 @@
 
   format %{ "mul   rscratch1, $op1, $op2\t#overflow check long\n\t"
             "smulh rscratch2, $op1, $op2\n\t"
-            "cmp   rscratch2, rscratch1, ASR #31\n\t"
+            "cmp   rscratch2, rscratch1, ASR #63\n\t"
             "b$cmp $labl" %}
   ins_cost(4 * INSN_COST); // Branch is rare so treat as INSN_COST
   ins_encode %{
@@ -12471,7 +12475,7 @@
     Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
     __ mul(rscratch1, $op1$$Register, $op2$$Register);   // Result bits 0..63
     __ smulh(rscratch2, $op1$$Register, $op2$$Register); // Result bits 64..127
-    __ cmp(rscratch2, rscratch1, Assembler::ASR, 31);    // Top is pure sign ext
+    __ cmp(rscratch2, rscratch1, Assembler::ASR, 63);    // Top is pure sign ext
     __ br(cond == Assembler::VS ? Assembler::NE : Assembler::EQ, *L);
   %}
 
--- a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013, Red Hat Inc.
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates.
+ * Copyright (c) 2000, 2020, Oracle and/or its affiliates.
  * All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -432,12 +432,10 @@
   }
 
   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);
+>>>>>>> merge rev
   }
 
   if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
--- a/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1311,6 +1311,16 @@
       }
       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);
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1545,7 +1545,7 @@
   // critical natives they are offset down.
   GrowableArray<int> arg_order(2 * total_in_args);
   VMRegPair tmp_vmreg;
-  tmp_vmreg.set1(r19->as_VMReg());
+  tmp_vmreg.set2(r19->as_VMReg());
 
   if (!is_critical_native) {
     for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) {
--- a/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/aarch64/vm/vm_version_aarch64.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1,6 +1,6 @@
 /*
+ * Copyright (c) 2013, Red Hat Inc.
  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -332,4 +332,11 @@
                                    g.generate_getPsrInfo());
 
   get_processor_features();
+
+  if (CriticalJNINatives) {
+    if (FLAG_IS_CMDLINE(CriticalJNINatives)) {
+      warning("CriticalJNINatives specified, but not supported in this VM");
+    }
+    FLAG_SET_DEFAULT(CriticalJNINatives, false);
+  }
 }
--- a/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -94,6 +94,7 @@
 
   __ lookup_virtual_method(r16, vtable_index, rmethod);
 
+#ifndef PRODUCT
   if (DebugVtables) {
     Label L;
     __ cbz(rmethod, L);
@@ -102,6 +103,8 @@
     __ stop("Vtable entry is NULL");
     __ bind(L);
   }
+#endif // PRODUCT
+
   // r0: receiver klass
   // rmethod: Method*
   // r2: receiver
@@ -130,6 +133,11 @@
   // returned by pd_code_size_limit!
   const int code_length = VtableStub::pd_code_size_limit(false);
   VtableStub* s = new(code_length) VtableStub(false, itable_index);
+  // Can be NULL if there is no free space in the code cache.
+  if (s == NULL) {
+    return NULL;
+  }
+
   ResourceMark rm;
   CodeBuffer cb(s->entry_point(), code_length);
   MacroAssembler* masm = new MacroAssembler(&cb);
@@ -139,7 +147,7 @@
     __ lea(r10, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
     __ incrementw(Address(r10));
   }
-#endif
+#endif // PRODUCT
 
   // Entry arguments:
   //  rscratch2: CompiledICHolder
@@ -182,7 +190,7 @@
   // method (rmethod): Method*
   // j_rarg0: receiver
 
-#ifdef ASSERT
+#ifndef PRODUCT
   if (DebugVtables) {
     Label L2;
     __ cbz(rmethod, L2);
@@ -191,7 +199,7 @@
     __ stop("compiler entrypoint is null");
     __ bind(L2);
   }
-#endif // ASSERT
+#endif // PRODUCT
 
   // rmethod: Method*
   // j_rarg0: receiver
@@ -218,14 +226,10 @@
 
 
 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
-  int size = DebugVtables ? 216 : 0;
-  if (CountCompiledCalls)
-    size += 6 * 4;
-  // FIXME: vtable stubs only need 36 bytes
-  if (is_vtable_stub)
-    size += 52;
-  else
-    size += 176;
+  if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) {
+    return 1000;
+  }
+  int size = is_vtable_stub ? 60 : 192; // Plain + safety
   return size;
 
   // In order to tune these parameters, run the JVM with VM options
--- a/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -908,9 +908,7 @@
     sub(current_header, current_header, R1_SP);
 
     assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
-    load_const_optimized(tmp,
-                         (address) (~(os::vm_page_size()-1) |
-                                    markOopDesc::lock_mask_in_place));
+    load_const_optimized(tmp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place);
 
     and_(R0/*==0?*/, current_header, tmp);
     // If condition is true we are done and hence we can store 0 in the displaced
--- a/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -2046,8 +2046,7 @@
   // Check if the owner is self by comparing the value in the markOop of object
   // (current_header) with the stack pointer.
   sub(current_header, current_header, R1_SP);
-  load_const_optimized(temp, (address) (~(os::vm_page_size()-1) |
-                                        markOopDesc::lock_mask_in_place));
+  load_const_optimized(temp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place);
 
   and_(R0/*==0?*/, current_header, temp);
   // If condition is true we are cont and hence we can store 0 as the
--- a/src/os/linux/vm/osContainer_linux.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/os/linux/vm/osContainer_linux.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -115,7 +115,25 @@
     }
 };
 
-CgroupSubsystem* memory = NULL;
+class CgroupMemorySubsystem: CgroupSubsystem {
+ friend class OSContainer;
+
+ private:
+    /* Some container runtimes set limits via cgroup
+     * hierarchy. If set to true consider also memory.stat
+     * file if everything else seems unlimited */
+    bool _uses_mem_hierarchy;
+
+ public:
+    CgroupMemorySubsystem(char *root, char *mountpoint) : CgroupSubsystem::CgroupSubsystem(root, mountpoint) {
+      _uses_mem_hierarchy = false;
+    }
+
+    bool is_hierarchical() { return _uses_mem_hierarchy; }
+    void set_hierarchical(bool value) { _uses_mem_hierarchy = value; }
+};
+
+CgroupMemorySubsystem* memory = NULL;
 CgroupSubsystem* cpuset = NULL;
 CgroupSubsystem* cpu = NULL;
 CgroupSubsystem* cpuacct = NULL;
@@ -124,24 +142,27 @@
 
 PRAGMA_DIAG_PUSH
 PRAGMA_FORMAT_NONLITERAL_IGNORED
-template <typename T> int subsystem_file_contents(CgroupSubsystem* c,
+template <typename T> int subsystem_file_line_contents(CgroupSubsystem* c,
                                               const char *filename,
+                                              const char *matchline,
                                               const char *scan_fmt,
                                               T returnval) {
   FILE *fp = NULL;
   char *p;
   char file[MAXPATHLEN+1];
   char buf[MAXPATHLEN+1];
+  char discard[MAXPATHLEN+1];
+  bool found_match = false;
 
   if (c == NULL) {
     if (PrintContainerInfo) {
-      tty->print_cr("subsystem_file_contents: CgroupSubsytem* is NULL");
+      tty->print_cr("subsystem_file_line_contents: CgroupSubsytem* is NULL");
     }
     return OSCONTAINER_ERROR;
   }
   if (c->subsystem_path() == NULL) {
     if (PrintContainerInfo) {
-      tty->print_cr("subsystem_file_contents: subsystem path is NULL");
+      tty->print_cr("subsystem_file_line_contents: subsystem path is NULL");
     }
     return OSCONTAINER_ERROR;
   }
@@ -161,19 +182,33 @@
   }
   fp = fopen(file, "r");
   if (fp != NULL) {
-    p = fgets(buf, MAXPATHLEN, fp);
-    if (p != NULL) {
-      int matched = sscanf(p, scan_fmt, returnval);
-      if (matched == 1) {
+    int err = 0;
+    while ((p = fgets(buf, MAXPATHLEN, fp)) != NULL) {
+      found_match = false;
+      if (matchline == NULL) {
+        // single-line file case
+        int matched = sscanf(p, scan_fmt, returnval);
+        found_match = (matched == 1);
+      } else {
+        // multi-line file case
+        if (strstr(p, matchline) != NULL) {
+          // discard matchline string prefix
+          int matched = sscanf(p, scan_fmt, discard, returnval);
+          found_match = (matched == 2);
+        } else {
+          continue; // substring not found
+        }
+      }
+      if (found_match) {
         fclose(fp);
         return 0;
       } else {
+        err = 1;
         if (PrintContainerInfo) {
           tty->print_cr("Type %s not found in file %s", scan_fmt, file);
         }
       }
-    } else {
-      if (PrintContainerInfo) {
+      if (err == 0 && PrintContainerInfo) {
         tty->print_cr("Empty file %s", file);
       }
     }
@@ -193,10 +228,11 @@
   return_type variable;                                                   \
 {                                                                         \
   int err;                                                                \
-  err = subsystem_file_contents(subsystem,                                \
-                                filename,                                 \
-                                scan_fmt,                                 \
-                                &variable);                               \
+  err = subsystem_file_line_contents(subsystem,                           \
+                                     filename,                            \
+                                     NULL,                                \
+                                     scan_fmt,                            \
+                                     &variable);                          \
   if (err != 0)                                                           \
     return (return_type) OSCONTAINER_ERROR;                               \
                                                                           \
@@ -209,10 +245,11 @@
   char variable[bufsize];                                                 \
 {                                                                         \
   int err;                                                                \
-  err = subsystem_file_contents(subsystem,                                \
-                                filename,                                 \
-                                scan_fmt,                                 \
-                                variable);                                \
+  err = subsystem_file_line_contents(subsystem,                           \
+                                     filename,                            \
+                                     NULL,                                \
+                                     scan_fmt,                            \
+                                     variable);                           \
   if (err != 0)                                                           \
     return (return_type) NULL;                                            \
                                                                           \
@@ -220,6 +257,24 @@
     tty->print_cr(logstring, variable);                                   \
 }
 
+#define GET_CONTAINER_INFO_LINE(return_type, subsystem, filename,         \
+                           matchline, logstring, scan_fmt, variable)      \
+  return_type variable;                                                   \
+{                                                                         \
+  int err;                                                                \
+  err = subsystem_file_line_contents(subsystem,                           \
+                                filename,                                 \
+                                matchline,                                \
+                                scan_fmt,                                 \
+                                &variable);                               \
+  if (err != 0)                                                           \
+    return (return_type) OSCONTAINER_ERROR;                               \
+                                                                          \
+  if (PrintContainerInfo)                                                 \
+    tty->print_cr(logstring, variable);                                   \
+}
+
+
 /* init
  *
  * Initialize the container support and determine if
@@ -281,7 +336,7 @@
     }
     while ((token = strsep(&cptr, ",")) != NULL) {
       if (strcmp(token, "memory") == 0) {
-        memory = new CgroupSubsystem(tmproot, tmpmount);
+        memory = new CgroupMemorySubsystem(tmproot, tmpmount);
       } else if (strcmp(token, "cpuset") == 0) {
         cpuset = new CgroupSubsystem(tmproot, tmpmount);
       } else if (strcmp(token, "cpu") == 0) {
@@ -368,6 +423,10 @@
     while ((token = strsep(&controllers, ",")) != NULL) {
       if (strcmp(token, "memory") == 0) {
         memory->set_subsystem_path(base);
+        jlong hierarchy = uses_mem_hierarchy();
+        if (hierarchy > 0) {
+          memory->set_hierarchical(true);
+        }
       } else if (strcmp(token, "cpuset") == 0) {
         cpuset->set_subsystem_path(base);
       } else if (strcmp(token, "cpu") == 0) {
@@ -384,6 +443,9 @@
   // command line arguments have been processed.
   if ((mem_limit = memory_limit_in_bytes()) > 0) {
     os::Linux::set_physical_memory(mem_limit);
+    if (PrintContainerInfo) {
+      tty->print_cr("Memory Limit is: " JLONG_FORMAT, mem_limit);
+    }
   }
 
   _is_containerized = true;
@@ -398,6 +460,21 @@
   }
 }
 
+/* uses_mem_hierarchy
+ *
+ * Return whether or not hierarchical cgroup accounting is being
+ * done.
+ *
+ * return:
+ *    A number > 0 if true, or
+ *    OSCONTAINER_ERROR for not supported
+ */
+jlong OSContainer::uses_mem_hierarchy() {
+  GET_CONTAINER_INFO(jlong, memory, "/memory.use_hierarchy",
+                    "Use Hierarchy is: " JLONG_FORMAT, JLONG_FORMAT, use_hierarchy);
+  return use_hierarchy;
+}
+
 
 /* memory_limit_in_bytes
  *
@@ -414,7 +491,20 @@
 
   if (memlimit >= _unlimited_memory) {
     if (PrintContainerInfo) {
-      tty->print_cr("Memory Limit is: Unlimited");
+      tty->print_cr("Non-Hierarchical Memory Limit is: Unlimited");
+    }
+    if (memory->is_hierarchical()) {
+      const char* matchline = "hierarchical_memory_limit";
+      const char* format = "%s " JULONG_FORMAT;
+      GET_CONTAINER_INFO_LINE(julong, memory, "/memory.stat", matchline,
+                             "Hierarchical Memory Limit is: " JULONG_FORMAT, format, hier_memlimit)
+      if (hier_memlimit >= _unlimited_memory) {
+        if (PrintContainerInfo) {
+          tty->print_cr("Hierarchical Memory Limit is: Unlimited");
+        }
+      } else {
+        return (jlong)hier_memlimit;
+      }
     }
     return (jlong)-1;
   }
@@ -428,7 +518,20 @@
                      "Memory and Swap Limit is: " JULONG_FORMAT, JULONG_FORMAT, memswlimit);
   if (memswlimit >= _unlimited_memory) {
     if (PrintContainerInfo) {
-      tty->print_cr("Memory and Swap Limit is: Unlimited");
+      tty->print_cr("Non-Hierarchical Memory and Swap Limit is: Unlimited");
+    }
+    if (memory->is_hierarchical()) {
+      const char* matchline = "hierarchical_memsw_limit";
+      const char* format = "%s " JULONG_FORMAT;
+      GET_CONTAINER_INFO_LINE(julong, memory, "/memory.stat", matchline,
+                             "Hierarchical Memory and Swap Limit is : " JULONG_FORMAT, format, hier_memlimit)
+      if (hier_memlimit >= _unlimited_memory) {
+        if (PrintContainerInfo) {
+          tty->print_cr("Hierarchical Memory and Swap Limit is: Unlimited");
+        }
+      } else {
+        return (jlong)hier_memlimit;
+      }
     }
     return (jlong)-1;
   } else {
--- a/src/os/linux/vm/osContainer_linux.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/os/linux/vm/osContainer_linux.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -46,6 +46,7 @@
   static inline bool is_containerized();
   static const char * container_type();
 
+  static jlong uses_mem_hierarchy();
   static jlong memory_limit_in_bytes();
   static jlong memory_and_swap_limit_in_bytes();
   static jlong memory_soft_limit_in_bytes();
--- a/src/os/linux/vm/os_linux.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/os/linux/vm/os_linux.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -2016,7 +2016,7 @@
     static  Elf32_Half running_arch_code=EM_AARCH64;
   #else
     #error Method os::dll_load requires that one of following is defined:\
-      IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64
+         IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64
   #endif
 
   // Identify compatability class for VM's architecture and library's architecture
@@ -2967,7 +2967,7 @@
   retval = vgetcpu(&cpu, NULL, NULL);
 #elif defined(IA32) || defined(AARCH64)
 # ifndef SYS_getcpu
-#  define SYS_getcpu AARCH64_ONLY(168) NOT_AARCH64(318)
+#  define SYS_getcpu AARCH64_ONLY(168) IA32_ONLY(318)
 # endif
   retval = syscall(SYS_getcpu, &cpu, NULL, NULL);
 #endif
@@ -5865,7 +5865,6 @@
 PRAGMA_DIAG_PUSH
 PRAGMA_FORMAT_NONLITERAL_IGNORED
 static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
-  static bool proc_task_unchecked = true;
   pid_t  tid = thread->osthread()->thread_id();
   char *s;
   char stat[2048];
@@ -5878,24 +5877,7 @@
   long ldummy;
   FILE *fp;
 
-  snprintf(proc_name, 64, "/proc/%d/stat", tid);
-
-  // The /proc/<tid>/stat aggregates per-process usage on
-  // new Linux kernels 2.6+ where NPTL is supported.
-  // The /proc/self/task/<tid>/stat still has the per-thread usage.
-  // See bug 6328462.
-  // There possibly can be cases where there is no directory
-  // /proc/self/task, so we check its availability.
-  if (proc_task_unchecked && os::Linux::is_NPTL()) {
-    // This is executed only once
-    proc_task_unchecked = false;
-    fp = fopen("/proc/self/task", "r");
-    if (fp != NULL) {
-      snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid);
-      fclose(fp);
-    }
-  }
-
+  snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid);
   fp = fopen(proc_name, "r");
   if ( fp == NULL ) return -1;
   statlen = fread(stat, 1, 2047, fp);
--- a/src/share/vm/adlc/formssel.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/adlc/formssel.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -23,6 +23,7 @@
  */
 
 // FORMS.CPP - Definitions for ADL Parser Forms Classes
+#include "utilities/macros.hpp"
 #include "adlc.hpp"
 
 //==============================Instructions===================================
@@ -1242,8 +1243,8 @@
       !is_short_branch() &&     // Don't match another short branch variant
       reduce_result() != NULL &&
       strcmp(reduce_result(), short_branch->reduce_result()) == 0 &&
-      _matrule->equivalent(AD.globalNames(), short_branch->_matrule) &&
-      equivalent_predicates(this, short_branch)) {
+      _matrule->equivalent(AD.globalNames(), short_branch->_matrule)
+      AARCH64_ONLY(&& equivalent_predicates(this, short_branch))) {
     // The instructions are equivalent.
 
     // Now verify that both instructions have the same parameters and
--- a/src/share/vm/c1/c1_LIR.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/c1/c1_LIR.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -67,7 +67,7 @@
 
 #endif
 
-#if defined(ARM) || defined (TARGET_ARCH_aarch64)
+#if defined(ARM) || defined(AARCH64)
 
 FloatRegister LIR_OprDesc::as_float_reg() const {
   return as_FloatRegister(fpu_regnr());
@@ -149,7 +149,7 @@
 #endif
 #ifdef _LP64
   assert(base()->is_cpu_register(), "wrong base operand");
-#ifndef TARGET_ARCH_aarch64
+#ifndef AARCH64
   assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
 #else
   assert(index()->is_illegal() || index()->is_double_cpu() || index()->is_single_cpu(), "wrong index operand");
@@ -560,7 +560,7 @@
       assert(opConvert->_info == NULL, "must be");
       if (opConvert->_opr->is_valid())       do_input(opConvert->_opr);
       if (opConvert->_result->is_valid())    do_output(opConvert->_result);
-#if defined(PPC) || defined(TARGET_ARCH_aarch64)
+#if defined(PPC) || defined(AARCH64)
       if (opConvert->_tmp1->is_valid())      do_temp(opConvert->_tmp1);
       if (opConvert->_tmp2->is_valid())      do_temp(opConvert->_tmp2);
 #endif
@@ -1980,7 +1980,7 @@
   print_bytecode(out, bytecode());
   in_opr()->print(out);                  out->print(" ");
   result_opr()->print(out);              out->print(" ");
-#if defined(PPC) || defined(TARGET_ARCH_aarch64)
+#if defined(PPC) || defined(AARCH64)
   if(tmp1()->is_valid()) {
     tmp1()->print(out); out->print(" ");
     tmp2()->print(out); out->print(" ");
--- a/src/share/vm/c1/c1_LIR.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/c1/c1_LIR.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1474,7 +1474,7 @@
  private:
    Bytecodes::Code _bytecode;
    ConversionStub* _stub;
-#if defined(PPC) || defined(TARGET_ARCH_aarch64)
+#if defined(PPC) || defined(AARCH64)
   LIR_Opr _tmp1;
   LIR_Opr _tmp2;
 #endif
@@ -1489,7 +1489,7 @@
 #endif
      , _bytecode(code)                           {}
 
-#if defined(PPC) || defined(TARGET_ARCH_aarch64)
+#if defined(PPC) || defined(AARCH64)
    LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub
                  ,LIR_Opr tmp1, LIR_Opr tmp2)
      : LIR_Op1(lir_convert, opr, result)
@@ -1501,7 +1501,7 @@
 
   Bytecodes::Code bytecode() const               { return _bytecode; }
   ConversionStub* stub() const                   { return _stub; }
-#if defined(PPC) || defined(TARGET_ARCH_aarch64)
+#if defined(PPC) || defined(AARCH64)
   LIR_Opr tmp1() const                           { return _tmp1; }
   LIR_Opr tmp2() const                           { return _tmp2; }
 #endif
@@ -2144,7 +2144,7 @@
 #ifdef PPC
   void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); }
 #endif
-#if defined (TARGET_ARCH_aarch64)
+#if defined(AARCH64)
   void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst,
                ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) {
     append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr()));
--- a/src/share/vm/c1/c1_LIRAssembler.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/c1/c1_LIRAssembler.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -171,7 +171,7 @@
 #endif
     s->emit_code(this);
 #ifdef ASSERT
-# ifndef AARCH64
+#ifndef AARCH64
     s->assert_no_unbound_labels();
 #endif
 #endif
--- a/src/share/vm/c1/c1_LinearScan.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/c1/c1_LinearScan.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -4541,7 +4541,7 @@
       opr = LIR_OprFact::single_xmm(assigned_reg() - pd_first_xmm_reg);
 #endif
     } else {
-#ifndef AARCH64
+#if !defined(AARCH64)
       ShouldNotReachHere();
 #endif
     }
--- a/src/share/vm/c1/c1_Runtime1.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/c1/c1_Runtime1.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -167,6 +167,7 @@
 #ifdef TARGET_ARCH_aarch64
   static void patch_code_aarch64(JavaThread* thread, StubID stub_id);
 #endif
+
  public:
   // initialization
   static void initialize(BufferBlob* blob);
--- a/src/share/vm/ci/ciMethodData.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/ci/ciMethodData.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -120,15 +120,17 @@
   // Snapshot the data -- actually, take an approximate snapshot of
   // the data.  Any concurrently executing threads may be changing the
   // data as we copy it.
-  Copy::disjoint_words((HeapWord*) mdo,
-                       (HeapWord*) &_orig,
-                       sizeof(_orig) / HeapWordSize);
+  Copy::disjoint_words_atomic((HeapWord*) mdo,
+                              (HeapWord*) &_orig,
+                              sizeof(_orig) / HeapWordSize);
   Arena* arena = CURRENT_ENV->arena();
   _data_size = mdo->data_size();
   _extra_data_size = mdo->extra_data_size();
   int total_size = _data_size + _extra_data_size;
   _data = (intptr_t *) arena->Amalloc(total_size);
-  Copy::disjoint_words((HeapWord*) mdo->data_base(), (HeapWord*) _data, total_size / HeapWordSize);
+  Copy::disjoint_words_atomic((HeapWord*) mdo->data_base(),
+                              (HeapWord*) _data,
+                              total_size / HeapWordSize);
 
   // Traverse the profile data, translating any oops into their
   // ci equivalents.
--- a/src/share/vm/code/compiledIC.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/code/compiledIC.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -323,7 +323,7 @@
   friend CompiledStaticCall* compiledStaticCall_at(Relocation* call_site);
 
   // Code
-#if defined AARCH64 && !defined ZERO
+#if defined(AARCH64) && !defined(ZERO)
   static address emit_to_interp_stub(CodeBuffer &cbuf, address mark);
 #else
   static address emit_to_interp_stub(CodeBuffer &cbuf);
--- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -43,8 +43,7 @@
 ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
   ConcurrentGCThread(),
   _cm(cm),
-  _started(false),
-  _in_progress(false),
+  _state(Idle),
   _vtime_accum(0.0),
   _vtime_mark_accum(0.0) {
   create_and_start();
@@ -341,7 +340,6 @@
 
   if (started()) {
     set_in_progress();
-    clear_started();
   }
 }
 
--- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -46,8 +46,14 @@
 
  private:
   ConcurrentMark*                  _cm;
-  volatile bool                    _started;
-  volatile bool                    _in_progress;
+
+  enum State {
+    Idle,
+    Started,
+    InProgress
+  };
+
+  volatile State _state;
 
   void sleepBeforeNextCycle();
 
@@ -71,23 +77,22 @@
 
   ConcurrentMark* cm()     { return _cm; }
 
-  void set_started()       { assert(!_in_progress, "cycle in progress"); _started = true;  }
-  void clear_started()     { assert(_in_progress, "must be starting a cycle"); _started = false; }
-  bool started()           { return _started;  }
+  void set_idle()          { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
+  bool idle()              { return _state == Idle; }
+  void set_started()       { assert(_state == Idle, "cycle in progress"); _state = Started; }
+  bool started()           { return _state == Started; }
+  void set_in_progress()   { assert(_state == Started, "must be starting a cycle"); _state = InProgress; }
+  bool in_progress()       { return _state == InProgress; }
 
-  void set_in_progress()   { assert(_started, "must be starting a cycle"); _in_progress = true;  }
-  void clear_in_progress() { assert(!_started, "must not be starting a new cycle"); _in_progress = false; }
-  bool in_progress()       { return _in_progress;  }
-
-  // This flag returns true from the moment a marking cycle is
+  // Returns true from the moment a marking cycle is
   // initiated (during the initial-mark pause when started() is set)
   // to the moment when the cycle completes (just after the next
   // marking bitmap has been cleared and in_progress() is
-  // cleared). While this flag is true we will not start another cycle
+  // cleared). While during_cycle() is true we will not start another cycle
   // so that cycles do not overlap. We cannot use just in_progress()
   // as the CM thread might take some time to wake up before noticing
   // that started() is set and set in_progress().
-  bool during_cycle()      { return started() || in_progress(); }
+  bool during_cycle()      { return !idle(); }
 
   // shutdown
   void stop();
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -264,7 +264,7 @@
     while (n <= next_boundary) {
       q = n;
       oop obj = oop(q);
-      if (obj->klass_or_null() == NULL) return q;
+      if (obj->klass_or_null_acquire() == NULL) return q;
       n += block_size(q);
     }
     assert(q <= next_boundary && n > next_boundary, "Consequence of loop");
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -166,7 +166,7 @@
   while (n <= addr) {
     q = n;
     oop obj = oop(q);
-    if (obj->klass_or_null() == NULL) return q;
+    if (obj->klass_or_null_acquire() == NULL) return q;
     n += block_size(q);
   }
   assert(q <= n, "wrong order for q and addr");
@@ -177,7 +177,7 @@
 inline HeapWord*
 G1BlockOffsetArray::forward_to_block_containing_addr(HeapWord* q,
                                                      const void* addr) {
-  if (oop(q)->klass_or_null() == NULL) return q;
+  if (oop(q)->klass_or_null_acquire() == NULL) return q;
   HeapWord* n = q + block_size(q);
   // In the normal case, where the query "addr" is a card boundary, and the
   // offset table chunks are the same size as cards, the block starting at
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -2409,7 +2409,7 @@
   // is set) so that if a waiter requests another System.gc() it doesn't
   // incorrectly see that a marking cycle is still in progress.
   if (concurrent) {
-    _cmThread->clear_in_progress();
+    _cmThread->set_idle();
   }
 
   // This notify_all() will ensure that a thread that called
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -575,9 +575,10 @@
                                         card_ptr);
 
   // If unable to process the card then we encountered an unparsable
-  // part of the heap (e.g. a partially allocated object).  Redirty
-  // and re-enqueue: if we put off the card until a GC pause, then the
-  // allocation will have completed.
+  // part of the heap (e.g. a partially allocated object) while
+  // processing a stale card.  Despite the card being stale, redirty
+  // and re-enqueue, because we've already cleaned the card.  Without
+  // this we could incorrectly discard a non-stale card.
   if (!card_processed) {
     assert(!_g1->is_gc_active(), "Unparsable heap during GC");
     // The card might have gotten re-dirtied and re-enqueued while we
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -407,6 +407,49 @@
   return NULL;
 }
 
+// Humongous objects are allocated directly in the old-gen.  Need
+// special handling for concurrent processing encountering an
+// in-progress allocation.
+static bool do_oops_on_card_in_humongous(MemRegion mr,
+                                         FilterOutOfRegionClosure* cl,
+                                         HeapRegion* hr,
+                                         G1CollectedHeap* g1h) {
+  assert(hr->isHumongous(), "precondition");
+  HeapRegion* sr = hr->humongous_start_region();
+  oop obj = oop(sr->bottom());
+
+  // If concurrent and klass_or_null is NULL, then space has been
+  // allocated but the object has not yet been published by setting
+  // the klass.  That can only happen if the card is stale.  However,
+  // we've already set the card clean, so we must return failure,
+  // since the allocating thread could have performed a write to the
+  // card that might be missed otherwise.
+  if (!g1h->is_gc_active() && (obj->klass_or_null_acquire() == NULL)) {
+    return false;
+  }
+
+  // Only filler objects follow a humongous object in the containing
+  // regions, and we can ignore those.  So only process the one
+  // humongous object.
+  if (!g1h->is_obj_dead(obj, sr)) {
+    if (obj->is_objArray() || (sr->bottom() < mr.start())) {
+      // objArrays are always marked precisely, so limit processing
+      // with mr.  Non-objArrays might be precisely marked, and since
+      // it's humongous it's worthwhile avoiding full processing.
+      // However, the card could be stale and only cover filler
+      // objects.  That should be rare, so not worth checking for;
+      // instead let it fall out from the bounded iteration.
+      obj->oop_iterate(cl, mr);
+    } else {
+      // If obj is not an objArray and mr contains the start of the
+      // obj, then this could be an imprecise mark, and we need to
+      // process the entire object.
+      obj->oop_iterate(cl);
+    }
+  }
+  return true;
+}
+
 bool HeapRegion::oops_on_card_seq_iterate_careful(MemRegion mr,
                                                   FilterOutOfRegionClosure* cl,
                                                   jbyte* card_ptr) {
@@ -424,7 +467,6 @@
   if (mr.is_empty()) {
     return true;
   }
-  // Otherwise, find the obj that extends onto mr.start().
 
   // The intersection of the incoming mr (for the card) and the
   // allocated part of the region is non-empty. This implies that
@@ -442,54 +484,52 @@
   // We must complete this write before we do any of the reads below.
   OrderAccess::storeload();
 
+  // Special handling for humongous regions.
+  if (isHumongous()) {
+    return do_oops_on_card_in_humongous(mr, cl, this, g1h);
+  }
+
+  // During GC we limit mr by scan_top. So we never get here with an
+  // mr covering objects allocated during GC.  Non-humongous objects
+  // are only allocated in the old-gen during GC.  So the parts of the
+  // heap that may be examined here are always parsable; there's no
+  // need to use klass_or_null here to detect in-progress allocations.
+
   // Cache the boundaries of the memory region in some const locals
   HeapWord* const start = mr.start();
   HeapWord* const end = mr.end();
 
-  // Update BOT as needed while finding start of (potential) object.
+  // Find the obj that extends onto mr.start().
+  // Update BOT as needed while finding start of (possibly dead)
+  // object containing the start of the region.
   HeapWord* cur = block_start(start);
-  assert(cur <= start, "Postcondition");
-
-  oop obj;
 
-  HeapWord* next = cur;
-  do {
-    cur = next;
-    obj = oop(cur);
-    if (obj->klass_or_null() == NULL) {
-      // Ran into an unparseable point.
-      assert(!g1h->is_gc_active(),
-             err_msg("Unparsable heap during GC at " PTR_FORMAT, p2i(cur)));
-      return false;
-    }
-    // Otherwise...
-    next = cur + block_size(cur);
-  } while (next <= start);
-
-  // If we finish the above loop...We have a parseable object that
-  // begins on or before the start of the memory region, and ends
-  // inside or spans the entire region.
-  assert(cur <= start, "Loop postcondition");
-  assert(obj->klass_or_null() != NULL, "Loop postcondition");
+#ifdef ASSERT
+  {
+    assert(cur <= start,
+           err_msg("cur: " PTR_FORMAT ", start: " PTR_FORMAT, p2i(cur), p2i(start)));
+    HeapWord* next = cur + block_size(cur);
+    assert(start < next,
+           err_msg("start: " PTR_FORMAT ", next: " PTR_FORMAT, p2i(start), p2i(next)));
+  }
+#endif
 
   do {
-    obj = oop(cur);
-    assert((cur + block_size(cur)) > (HeapWord*)obj, "Loop invariant");
-    if (obj->klass_or_null() == NULL) {
-      // Ran into an unparseable point.
-      assert(!g1h->is_gc_active(),
-             err_msg("Unparsable heap during GC at " PTR_FORMAT, p2i(cur)));
-      return false;
-    }
+    oop obj = oop(cur);
+    assert(obj->is_oop(true), err_msg("Not an oop at " PTR_FORMAT, p2i(cur)));
+    assert(obj->klass_or_null() != NULL,
+           err_msg("Unparsable heap at " PTR_FORMAT, p2i(cur)));
 
-    // Advance the current pointer. "obj" still points to the object to iterate.
-    cur = cur + block_size(cur);
-
-    if (!g1h->is_obj_dead(obj)) {
-      // Non-objArrays are sometimes marked imprecise at the object start. We
-      // always need to iterate over them in full.
-      // We only iterate over object arrays in full if they are completely contained
-      // in the memory region.
+    if (g1h->is_obj_dead(obj, this)) {
+      // Carefully step over dead object.
+      cur += block_size(cur);
+    } else {
+      // Step over live object, and process its references.
+      cur += obj->size();
+      // Non-objArrays are usually marked imprecise at the object
+      // start, in which case we need to iterate over them in full.
+      // objArrays are precisely marked, but can still be iterated
+      // over in full if completely covered.
       if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
         obj->oop_iterate(cl);
       } else {
--- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -723,7 +723,7 @@
   // mr: the memory region covered by the card.
   // card_ptr: if we decide that the card is not young and we iterate
   // over it, we'll clean the card before we start the iteration.
-  // Returns true if card was successfully processed, false if an
+  // Returns true if the card was successfully processed, false if an
   // unparsable part of the heap was encountered, which should only
   // happen when invoked concurrently with the mutator.
   bool oops_on_card_seq_iterate_careful(MemRegion mr,
--- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1557,22 +1557,25 @@
      return false;
   }
   assert(prefix != NULL && prefix != BUSY, "Error");
-  size_t i = 1;
   oop cur = prefix;
-  while (i < objsFromOverflow && cur->klass_or_null() != NULL) {
-    i++; cur = cur->list_ptr_from_klass();
+  for (size_t i = 1; i < objsFromOverflow; ++i) {
+    oop next = cur->list_ptr_from_klass();
+    if (next == NULL) break;
+    cur = next;
   }
+  assert(cur != NULL, "Loop postcondition");
 
   // Reattach remaining (suffix) to overflow list
-  if (cur->klass_or_null() == NULL) {
+  oop suffix = cur->list_ptr_from_klass();
+  if (suffix == NULL) {
     // Write back the NULL in lieu of the BUSY we wrote
     // above and it is still the same value.
     if (_overflow_list == BUSY) {
       (void) Atomic::cmpxchg_ptr(NULL, &_overflow_list, BUSY);
     }
   } else {
-    assert(cur->klass_or_null() != (Klass*)(address)BUSY, "Error");
-    oop suffix = cur->list_ptr_from_klass();       // suffix will be put back on global list
+    assert(suffix != BUSY, "Error");
+    // suffix will be put back on global list
     cur->set_klass_to_list_ptr(NULL);     // break off suffix
     // It's possible that the list is still in the empty(busy) state
     // we left it in a short while ago; in that case we may be
@@ -1592,8 +1595,10 @@
       // Too bad, someone else got in in between; we'll need to do a splice.
       // Find the last item of suffix list
       oop last = suffix;
-      while (last->klass_or_null() != NULL) {
-        last = last->list_ptr_from_klass();
+      while (true) {
+        oop next = last->list_ptr_from_klass();
+        if (next == NULL) break;
+        last = next;
       }
       // Atomically prepend suffix to current overflow list
       observed_overflow_list = _overflow_list;
--- a/src/share/vm/jfr/recorder/storage/jfrStorage.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/jfr/recorder/storage/jfrStorage.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -483,7 +483,7 @@
 
 BufferPtr JfrStorage::flush_regular(BufferPtr cur, const u1* const cur_pos, size_t used, size_t req, bool native, Thread* t) {
   debug_only(assert_flush_regular_precondition(cur, cur_pos, used, req, t);)
-  // A flush is needed before memcpy since a non-large buffer is thread stable
+  // A flush is needed before memmove since a non-large buffer is thread stable
   // (thread local). The flush will not modify memory in addresses above pos()
   // which is where the "used / uncommitted" data resides. It is therefore both
   // possible and valid to migrate data after the flush. This is however only
@@ -495,7 +495,8 @@
   if (cur->free_size() >= req) {
     // simplest case, no switching of buffers
     if (used > 0) {
-      memcpy(cur->pos(), (void*)cur_pos, used);
+      // source and destination may overlap so memmove must be used instead of memcpy
+      memmove(cur->pos(), (void*)cur_pos, used);
     }
     assert(native ? t->jfr_thread_local()->native_buffer() == cur : t->jfr_thread_local()->java_buffer() == cur, "invariant");
     return cur;
--- a/src/share/vm/memory/allocation.inline.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/memory/allocation.inline.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -38,7 +38,7 @@
 // Increments unsigned long value for statistics (not atomic on MP).
 inline void inc_stat_counter(volatile julong* dest, julong add_value) {
 #if defined(SPARC) || defined(X86) || defined(AARCH64)
-  // Sparc and X86 have atomic jlong (8 bytes) instructions
+  // Sparc, X86 and AArch64 have atomic jlong (8 bytes) instructions
   julong value = Atomic::load((volatile jlong*)dest);
   value += add_value;
   Atomic::store((jlong)value, (volatile jlong*)dest);
--- a/src/share/vm/oops/markOop.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/oops/markOop.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -138,23 +138,15 @@
          epoch_mask_in_place      = epoch_mask << epoch_shift,
          cms_mask                 = right_n_bits(cms_bits),
          cms_mask_in_place        = cms_mask << cms_shift
-#ifndef _WIN64
-         ,hash_mask               = right_n_bits(hash_bits),
-         hash_mask_in_place       = (address_word)hash_mask << hash_shift
-#endif
   };
 
+  const static uintptr_t hash_mask = right_n_bits(hash_bits);
+  const static uintptr_t hash_mask_in_place = hash_mask << hash_shift;
+
   // Alignment of JavaThread pointers encoded in object header required by biased locking
   enum { biased_lock_alignment    = 2 << (epoch_shift + epoch_bits)
   };
 
-#ifdef _WIN64
-    // These values are too big for Win64
-    const static uintptr_t hash_mask = right_n_bits(hash_bits);
-    const static uintptr_t hash_mask_in_place  =
-                            (address_word)hash_mask << hash_shift;
-#endif
-
   enum { locked_value             = 0,
          unlocked_value           = 1,
          monitor_value            = 2,
--- a/src/share/vm/opto/graphKit.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/opto/graphKit.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -3848,7 +3848,11 @@
 
   // Smash zero into card
   if( !UseConcMarkSweepGC ) {
+#if defined(AARCH64)
     __ store(__ ctrl(), card_adr, zero, bt, adr_type, MemNode::unordered);
+#else
+    __ store(__ ctrl(), card_adr, zero, bt, adr_type, MemNode::release);
+#endif
   } else {
     // Specialized path for CM store barrier
     __ storeCM(__ ctrl(), card_adr, zero, oop_store, adr_idx, bt, adr_type);
--- a/src/share/vm/opto/macro.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/opto/macro.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1385,13 +1385,12 @@
     // MemBarStoreStore so that stores that initialize this object
     // can't be reordered with a subsequent store that makes this
     // object accessible by other threads.
-    if ( AARCH64_ONLY ( !alloc->does_not_escape_thread() &&
-	                (init == NULL ||
-			 !init->is_complete_with_arraycopy()) )
-         NOT_AARCH64  ( init == NULL ||
-			(!init->is_complete_with_arraycopy() &&
-			 !init->does_not_escape()) )
-       ) {
+#ifndef AARCH64
+    if (init == NULL || (!init->is_complete_with_arraycopy() && !init->does_not_escape())) {
+#else
+    if (!alloc->does_not_escape_thread() &&
+        (init == NULL || !init->is_complete_with_arraycopy())) {
+#endif
       if (init == NULL || init->req() < InitializeNode::RawStores) {
         // No InitializeNode or no stores captured by zeroing
         // elimination. Simply add the MemBarStoreStore after object
--- a/src/share/vm/opto/node.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/opto/node.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1153,8 +1153,8 @@
   if( this->is_Store() ) {
     // Condition for back-to-back stores folding.
     return n->Opcode() == op && n->in(MemNode::Memory) == this;
-  } else if (this->is_Load()) {
-    // Condition for removing an unused LoadNode from the MemBarAcquire precedence input
+  } else if (this->is_Load() || this->is_DecodeN()) {
+    // Condition for removing an unused LoadNode or DecodeNNode from the MemBarAcquire precedence input
     return n->Opcode() == Op_MemBarAcquire;
   } else if( op == Op_AddL ) {
     // Condition for convL2I(addL(x,y)) ==> addI(convL2I(x),convL2I(y))
--- a/src/share/vm/prims/jvmtiExport.hpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/prims/jvmtiExport.hpp	Sun Apr 25 18:18:49 2021 +0100
@@ -389,7 +389,7 @@
  public:
   JvmtiCodeBlobDesc(const char *name, address code_begin, address code_end) {
     assert(name != NULL, "all code blobs must be named");
-    strncpy(_name, name, sizeof(_name));
+    strncpy(_name, name, sizeof(_name) - 1);
     _name[sizeof(_name)-1] = '\0';
     _code_begin = code_begin;
     _code_end = code_end;
--- a/src/share/vm/runtime/arguments.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1161,9 +1161,12 @@
   }
   // Increase the code cache size - tiered compiles a lot more.
   if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
-    NOT_AARCH64(FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5));
-    AARCH64_ONLY(FLAG_SET_DEFAULT(ReservedCodeCacheSize,
-                                  MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5)));
+#ifndef AARCH64
+    FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
+#else
+    FLAG_SET_DEFAULT(ReservedCodeCacheSize,
+                     MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
+#endif
   }
   if (!UseInterpreter) { // -Xcomp
     Tier3InvokeNotifyFreqLog = 0;
--- a/src/share/vm/services/memoryPool.cpp	Thu Apr 22 01:38:42 2021 +0100
+++ b/src/share/vm/services/memoryPool.cpp	Sun Apr 25 18:18:49 2021 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2021, 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
@@ -273,8 +273,8 @@
 }
 
 size_t MetaspacePool::calculate_max_size() const {
-  return FLAG_IS_CMDLINE(MaxMetaspaceSize) ? MaxMetaspaceSize :
-                                             MemoryUsage::undefined_size();
+  return !FLAG_IS_DEFAULT(MaxMetaspaceSize) ? MaxMetaspaceSize :
+                                              MemoryUsage::undefined_size();
 }
 
 CompressedKlassSpacePool::CompressedKlassSpacePool() :
--- a/test/Makefile	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/Makefile	Sun Apr 25 18:18:49 2021 +0100
@@ -250,6 +250,21 @@
   endif
 endif
 
+# Problematic tests to be excluded
+PROBLEM_LISTS=$(call MixedDirs,$(wildcard ProblemList.txt closed/ProblemList.txt))
+
+# Create exclude list for this platform and arch
+ifdef NO_EXCLUDES
+  JTREG_EXCLUSIONS =
+else
+  JTREG_EXCLUSIONS = $(PROBLEM_LISTS:%=-exclude:%)
+endif
+
+# convert list of directories to dos paths
+define MixedDirs
+$(foreach i,$1,$(shell $(GETMIXEDPATH) "${i}"))
+endef
+
 # When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
 ifdef TESTDIRS
   TEST_SELECTION = $(TESTDIRS)
@@ -278,14 +293,6 @@
 # Set other vm and test options
 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
 
-# Option to tell jtreg to not run tests marked with "ignore"
-ifeq ($(PLATFORM), windows)
-  JTREG_KEY_OPTION = -k:!ignore
-else
-  JTREG_KEY_OPTION = -k:\!ignore
-endif
-JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
- 
 # Make sure jtreg exists
 $(JTREG): $(JT_HOME)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/ProblemList.txt	Sun Apr 25 18:18:49 2021 +0100
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#############################################################################
+#
+# List of quarantined tests -- tests that should not be run by default, because
+# they may fail due to known reason. The reason (CR#) must be mandatory specified.
+#
+# List items are testnames followed by labels, all MUST BE commented
+#   as to why they are here and use a label:
+#     generic-all   Problems on all platforms
+#     generic-ARCH  Where ARCH is one of: sparc, sparcv9, x64, i586, etc.
+#     OSNAME-all    Where OSNAME is one of: solaris, linux, windows, macosx, aix
+#     OSNAME-ARCH   Specific on to one OSNAME and ARCH, e.g. solaris-amd64
+#     OSNAME-REV    Specific on to one OSNAME and REV, e.g. solaris-5.8
+#
+# More than one label is allowed but must be on the same line.
+#
+#############################################################################
+
+# :hotspot_runtime
+
+runtime/SharedArchiveFile/SharedBaseAddress.java 8044600 solaris-sparc
+runtime/6929067/Test6929067.sh 8028740 generic-all
+runtime/CDSCompressedKPtrs/XShareAuto.java 8026154 generic-all
+runtime/XCheckJniJsig/XCheckJSig.java 8023735 generic-all
+runtime/6626217/Test6626217.sh 8028733 generic-all
+runtime/jsig/Test8017498.sh 8028806 generic-all
+runtime/LoadClass/LoadClassNegative.java 8028095 generic-all
+runtime/NMT/MallocStressTest.java 8166548 generic-all
+runtime/InitialThreadOverflow/testme.sh 8029139 generic-all
+runtime/memory/ReadFromNoaccessArea.java 8028398 generic-all
+
+# :hotspot_compiler
+
+compiler/rtm/locking/TestRTMAbortRatio.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMAbortThreshold.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMLockingCalculationDelay.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMLockingThreshold.java 8183263 generic-x64
+compiler/rtm/locking/TestRTMSpinLoopCount.java 8183263 generic-x64
+compiler/rtm/locking/TestUseRTMDeopt.java 8183263 generic-x64
+compiler/rtm/locking/TestUseRTMXendForLockBusy.java 8183263 generic-x64
+compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java 8183263 generic-x64
--- a/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh	Sun Apr 25 18:18:49 2021 +0100
@@ -62,6 +62,12 @@
     ;;
 esac
 
+# CriticalJNINatives is not supported for aarch64
+if [ $VM_CPU == "aarch64" ]; then
+    echo "Test Passed"
+    exit 0;
+fi
+
 THIS_DIR=.
 
 cp ${TESTSRC}${FS}*.java ${THIS_DIR}
--- a/test/runtime/6626217/Test6626217.sh	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/6626217/Test6626217.sh	Sun Apr 25 18:18:49 2021 +0100
@@ -22,7 +22,6 @@
 # 
 
 
-# @ignore 8028733
 # @test @(#)Test6626217.sh
 # @bug 6626217
 # @summary Loader-constraint table allows arrays instead of only the base-classes
--- a/test/runtime/6929067/Test6929067.sh	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/6929067/Test6929067.sh	Sun Apr 25 18:18:49 2021 +0100
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 ##
-## @ignore 8028740
 ## @test Test6929067.sh
 ## @bug 6929067
 ## @bug 8021296
--- a/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Sun Apr 25 18:18:49 2021 +0100
@@ -22,7 +22,6 @@
  */
 
 /*
- * @ignore 8026154
  * @test
  * @bug 8005933
  * @summary Test that -Xshare:auto uses CDS when explicitly specified with -server.
--- a/test/runtime/InitialThreadOverflow/testme.sh	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/InitialThreadOverflow/testme.sh	Sun Apr 25 18:18:49 2021 +0100
@@ -21,7 +21,6 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 
-# @ignore 8029139
 # @test testme.sh
 # @bug 8009062
 # @summary Poor performance of JNI AttachCurrentThread after fix for 7017193
--- a/test/runtime/LoadClass/LoadClassNegative.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/LoadClass/LoadClassNegative.java	Sun Apr 25 18:18:49 2021 +0100
@@ -22,7 +22,6 @@
  */
 
 /*
- * @ignore 8028095
  * @test
  * @key regression
  * @bug 8020675
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java	Sun Apr 25 18:18:49 2021 +0100
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2021, 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 8260349
+ * @summary test that setting via the env-var and options file shows up as expected
+ * @library /testlibrary
+ * @run driver MaxMetaspaceSizeEnvVarTest
+ */
+
+import java.io.PrintWriter;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryPoolMXBean;
+import java.util.NoSuchElementException;
+
+import com.oracle.java.testlibrary.ProcessTools;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+public class MaxMetaspaceSizeEnvVarTest {
+
+    // This is the test class we exec, passing the MaxMetaspaceSize flag
+    // by different mechanisms.
+    static class Main {
+        public static void main(String[] args) throws Exception {
+            long expected = Long.parseLong(args[0]);
+            MemoryPoolMXBean metaspaceMemoryPool =
+                ManagementFactory.getPlatformMXBeans(MemoryPoolMXBean.class)
+                .stream()
+                .filter(pool -> "Metaspace".equals(pool.getName()))
+                .findFirst()
+                .orElseThrow(() -> new NoSuchElementException("No value present"));
+            long max = metaspaceMemoryPool.getUsage().getMax();
+            System.out.println("Metaspace max usage is " + max);
+            if (max != expected) {
+                throw new RuntimeException("Metaspace max " + max +
+                                           " != " + expected);
+            }
+        }
+    }
+
+    static void report(String msg) {
+        System.out.println(msg);
+        System.err.println(msg);
+    }
+
+    public static void main(String... args) throws Exception {
+        final String max = String.valueOf(9 * 1024 * 1024); // 9 MB
+        final String flagRaw = "MaxMetaspaceSize=" + max;
+        final String flag = "-XX:" + flagRaw;
+        final String main = "MaxMetaspaceSizeEnvVarTest$Main";
+
+        ProcessBuilder pb = null;
+        OutputAnalyzer output = null;
+
+        int test = 1;
+        report("Test " + test + ": flag not set");
+
+        Main.main(new String[] { "-1" });  // -1 == undefined size
+        report("------ end Test " + test);
+        test++;
+
+        report("Test " + test + ": normal command-line flag");
+        pb = ProcessTools.createJavaProcessBuilder(flag, main, max);
+        output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+        output.reportDiagnosticSummary();
+        report("------ end Test " + test);
+        test++;
+
+        String[] envVars = {
+            "_JAVA_OPTIONS",
+            "JAVA_TOOL_OPTIONS"
+        };
+
+        for (String envVar :  envVars) {
+            report("Test " + test + ": " + envVar + " env-var");
+            pb = ProcessTools.createJavaProcessBuilder(main, max);
+            pb.environment().put(envVar, flag);
+            output = new OutputAnalyzer(pb.start());
+            output.shouldHaveExitValue(0);
+            output.reportDiagnosticSummary();
+            report("------ end Test " + test);
+            test++;
+        }
+
+        report("Test " + test + ": .hotspotrc file");
+        final String rcFile = ".hotspotrc";
+        final String rcFileFlag = "-XX:Flags=" + rcFile;
+
+        PrintWriter pw = new PrintWriter(rcFile);
+        pw.println(flagRaw);
+        pw.close();
+        pb = ProcessTools.createJavaProcessBuilder(rcFileFlag, main, max);
+        output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+        output.reportDiagnosticSummary();
+        report("------ end Test " + test);
+    }
+}
--- a/test/runtime/NMT/MallocStressTest.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/NMT/MallocStressTest.java	Sun Apr 25 18:18:49 2021 +0100
@@ -27,7 +27,6 @@
  * @key nmt jcmd stress
  * @library /testlibrary /testlibrary/whitebox
  * @build MallocStressTest
- * @ignore - This test is disabled since it will stress NMT and timeout during normal testing
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocStressTest
  */
--- a/test/runtime/SharedArchiveFile/SharedBaseAddress.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/SharedArchiveFile/SharedBaseAddress.java	Sun Apr 25 18:18:49 2021 +0100
@@ -41,8 +41,6 @@
     };
 
     public static void main(String[] args) throws Exception {
-        // Known issue on Solaris-Sparc
-        // @ignore JDK-8044600
         if (Platform.isSolaris() && Platform.isSparc())
             return;
 
--- a/test/runtime/XCheckJniJsig/XCheckJSig.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/XCheckJniJsig/XCheckJSig.java	Sun Apr 25 18:18:49 2021 +0100
@@ -22,7 +22,6 @@
  */
 
 /*
- * @ignore 8023735
  * @test
  * @bug 7051189 8023393
  * @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so
--- a/test/runtime/containers/docker/TestMemoryAwareness.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/containers/docker/TestMemoryAwareness.java	Sun Apr 25 18:18:49 2021 +0100
@@ -34,6 +34,7 @@
 import com.oracle.java.testlibrary.Common;
 import com.oracle.java.testlibrary.DockerRunOptions;
 import com.oracle.java.testlibrary.DockerTestUtils;
+import com.oracle.java.testlibrary.OutputAnalyzer;
 
 
 public class TestMemoryAwareness {
@@ -128,14 +129,26 @@
                 "--memory-swap", swapAllocation
             );
 
-        DockerTestUtils.dockerRunJava(opts)
-            .shouldHaveExitValue(0)
-            .shouldContain("Checking OperatingSystemMXBean")
-            .shouldContain("OperatingSystemMXBean.getTotalPhysicalMemorySize: " + expectedMemory)
-            .shouldMatch("OperatingSystemMXBean\\.getFreePhysicalMemorySize: [1-9][0-9]+")
-            .shouldContain("OperatingSystemMXBean.getTotalSwapSpaceSize: " + expectedSwap)
-            .shouldMatch("OperatingSystemMXBean\\.getFreeSwapSpaceSize: [1-9][0-9]+")
-            ;
+        OutputAnalyzer out = DockerTestUtils.dockerRunJava(opts);
+            out.shouldHaveExitValue(0)
+               .shouldContain("Checking OperatingSystemMXBean")
+               .shouldContain("OperatingSystemMXBean.getTotalPhysicalMemorySize: " + expectedMemory)
+               .shouldMatch("OperatingSystemMXBean\\.getFreePhysicalMemorySize: [1-9][0-9]+");
+        // in case of warnings like : "Your kernel does not support swap limit capabilities
+        // or the cgroup is not mounted. Memory limited without swap."
+        // the getTotalSwapSpaceSize and getFreeSwapSpaceSize return the system
+        // values as the container setup isn't supported in that case.
+        try {
+            out.shouldContain("OperatingSystemMXBean.getTotalSwapSpaceSize: " + expectedSwap);
+        } catch(RuntimeException ex) {
+            out.shouldMatch("OperatingSystemMXBean.getTotalSwapSpaceSize: [0-9]+");
+        }
+
+        try {
+            out.shouldMatch("OperatingSystemMXBean\\.getFreeSwapSpaceSize: [1-9][0-9]+");
+        } catch(RuntimeException ex) {
+            out.shouldMatch("OperatingSystemMXBean\\.getFreeSwapSpaceSize: 0");
+        }
     }
 
 }
--- a/test/runtime/jsig/Test8017498.sh	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/jsig/Test8017498.sh	Sun Apr 25 18:18:49 2021 +0100
@@ -24,7 +24,6 @@
 #
 
 ##
-## @ignore 8028806
 ## @test Test8017498.sh
 ## @bug 8017498
 ## @bug 8020791
--- a/test/runtime/memory/ReadFromNoaccessArea.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/runtime/memory/ReadFromNoaccessArea.java	Sun Apr 25 18:18:49 2021 +0100
@@ -22,7 +22,6 @@
  */
 
 /*
- * @ignore 8028398
  * @test
  * @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION
  * @library /testlibrary /testlibrary/whitebox
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/testlibrary/com/oracle/java/testlibrary/Container.java	Sun Apr 25 18:18:49 2021 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019, Red Hat Inc.
+ * 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.
+ */
+package com.oracle.java.testlibrary;
+
+public class Container {
+    // Use this property to specify docker location on your system.
+    // E.g.: "/usr/local/bin/docker". We define this constant here so
+    // that it can be used in VMProps as well which checks docker support
+    // via this command
+    public static final String ENGINE_COMMAND =
+        System.getProperty("jdk.test.container.command", "docker");
+}
--- a/test/testlibrary/com/oracle/java/testlibrary/DockerTestUtils.java	Thu Apr 22 01:38:42 2021 +0100
+++ b/test/testlibrary/com/oracle/java/testlibrary/DockerTestUtils.java	Sun Apr 25 18:18:49 2021 +0100
@@ -38,7 +38,7 @@
 import java.util.List;
 
 import com.oracle.java.testlibrary.Utils;
-import com.oracle.java.testlibrary.Platform;
+import com.oracle.java.testlibrary.Container;
 import com.oracle.java.testlibrary.OutputAnalyzer;
 import com.oracle.java.testlibrary.ProcessTools;
 
@@ -47,11 +47,6 @@
     private static boolean isDockerEngineAvailable = false;
     private static boolean wasDockerEngineChecked = false;
 
-    // Use this property to specify docker location on your system.
-    // E.g.: "/usr/local/bin/docker".
-    private static final String DOCKER_COMMAND =
-        System.getProperty("jdk.test.docker.command", "docker");
-
     // Set this property to true to retain image after test. By default
     // images are removed after test execution completes.
     // Retaining the image can be useful for diagnostics and image inspection.
@@ -111,7 +106,7 @@
      */
     private static boolean isDockerEngineAvailableCheck() throws Exception {
         try {
-            execute(DOCKER_COMMAND, "ps")
+            execute(Container.ENGINE_COMMAND, "ps")
                 .shouldHaveExitValue(0)
                 .shouldContain("CONTAINER")
                 .shouldContain("IMAGE");
@@ -172,9 +167,8 @@
                            DockerfileConfig.getBaseImageVersion());
 
         // Build the docker
-        execute(DOCKER_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString())
-            .shouldHaveExitValue(0)
-            .shouldContain("Successfully built");
+        execute(Container.ENGINE_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString())
+            .shouldHaveExitValue(0);
     }
 
 
@@ -189,7 +183,7 @@
     public static OutputAnalyzer dockerRunJava(DockerRunOptions opts) throws Exception {
         ArrayList<String> cmd = new ArrayList<>();
 
-        cmd.add(DOCKER_COMMAND);
+        cmd.add(Container.ENGINE_COMMAND);
         cmd.add("run");
         if (opts.tty)
             cmd.add("--tty=true");
@@ -218,7 +212,7 @@
      * @throws Exception
      */
     public static void removeDockerImage(String imageNameAndTag) throws Exception {
-            execute(DOCKER_COMMAND, "rmi", "--force", imageNameAndTag);
+            execute(Container.ENGINE_COMMAND, "rmi", "--force", imageNameAndTag);
     }