Version in base suite: 11.0.12+7-2 Base version: openjdk-11_11.0.12+7-2 Target version: openjdk-11_11.0.13+8-1~deb11u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/o/openjdk-11/openjdk-11_11.0.12+7-2.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/o/openjdk-11/openjdk-11_11.0.13+8-1~deb11u1.dsc /srv/release.debian.org/tmp/oCCCF7g173/openjdk-11-11.0.13+8/test/jdk/java/awt/print/MissedFontFamilyName/SampleFontMissedFontFamily.ttf |binary /srv/release.debian.org/tmp/oCCCF7g173/openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/barprovider.jar |binary /srv/release.debian.org/tmp/oCCCF7g173/openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/fooprovider.jar |binary openjdk-11-11.0.13+8/.gitattributes | 1 openjdk-11-11.0.13+8/.github/workflows/submit.yml | 1513 ++++++++++ openjdk-11-11.0.13+8/.hg_archival.txt | 5 openjdk-11-11.0.13+8/.hgtags | 2 openjdk-11-11.0.13+8/.jcheck/conf | 33 openjdk-11-11.0.13+8/debian/changelog | 39 openjdk-11-11.0.13+8/debian/control | 2 openjdk-11-11.0.13+8/debian/patches/harfbuzz-cflags.diff | 11 openjdk-11-11.0.13+8/debian/patches/hotspot-libpath.diff | 18 openjdk-11-11.0.13+8/debian/patches/series | 1 openjdk-11-11.0.13+8/debian/rules | 14 openjdk-11-11.0.13+8/debian/tests/control | 4 openjdk-11-11.0.13+8/doc/building.html | 103 openjdk-11-11.0.13+8/doc/building.md | 104 openjdk-11-11.0.13+8/make/autoconf/flags-other.m4 | 4 openjdk-11-11.0.13+8/make/autoconf/lib-freetype.m4 | 10 openjdk-11-11.0.13+8/make/autoconf/lib-x11.m4 | 4 openjdk-11-11.0.13+8/make/autoconf/platform.m4 | 37 openjdk-11-11.0.13+8/make/autoconf/toolchain_windows.m4 | 48 openjdk-11-11.0.13+8/make/autoconf/version-numbers | 6 openjdk-11-11.0.13+8/make/conf/jib-profiles.js | 9 openjdk-11-11.0.13+8/make/conf/test-dependencies | 43 openjdk-11-11.0.13+8/make/data/cacerts/identrustdstx3 | 27 openjdk-11-11.0.13+8/make/data/charsetmapping/SingleByte-X.java.template | 4 openjdk-11-11.0.13+8/make/devkit/createWindowsDevkit2019.sh | 209 + openjdk-11-11.0.13+8/make/jdk/src/classes/build/tools/charsetmapping/SBCS.java | 9 openjdk-11-11.0.13+8/make/lib/Awt2dLibraries.gmk | 125 openjdk-11-11.0.13+8/make/lib/Lib-jdk.hotspot.agent.gmk | 4 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64-asmtest.py | 8 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64.ad | 394 ++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64_ad.m4 | 145 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 33 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 46 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 11 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp | 46 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp | 10 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp | 14 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp | 186 - openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad | 18 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/immediate_aarch64.cpp | 107 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/immediate_aarch64.hpp | 8 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 141 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp | 28 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp | 18 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/pauth_aarch64.hpp | 35 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/register_aarch64.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp | 15 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 34 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp | 14 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp | 23 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/assembler_arm_32.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/sharedRuntime_arm.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/cpu/arm/templateTable_arm.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/cpu/s390/templateTable_s390.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/cpu/sparc/vm_version_sparc.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/cpu/sparc/vm_version_sparc.hpp | 7 openjdk-11-11.0.13+8/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp | 121 openjdk-11-11.0.13+8/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp | 13 openjdk-11-11.0.13+8/src/hotspot/cpu/x86/templateTable_x86.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/os/aix/attachListener_aix.cpp | 90 openjdk-11-11.0.13+8/src/hotspot/os/aix/os_aix.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/os/bsd/attachListener_bsd.cpp | 80 openjdk-11-11.0.13+8/src/hotspot/os/bsd/os_bsd.cpp | 14 openjdk-11-11.0.13+8/src/hotspot/os/linux/attachListener_linux.cpp | 80 openjdk-11-11.0.13+8/src/hotspot/os/linux/os_linux.cpp | 11 openjdk-11-11.0.13+8/src/hotspot/os/solaris/attachListener_solaris.cpp | 75 openjdk-11-11.0.13+8/src/hotspot/os/windows/attachListener_windows.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/os/windows/os_windows.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/os/windows/threadCritical_windows.cpp | 46 openjdk-11-11.0.13+8/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp | 11 openjdk-11-11.0.13+8/src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp | 42 openjdk-11-11.0.13+8/src/hotspot/os_cpu/solaris_sparc/vm_version_solaris_sparc.cpp | 14 openjdk-11-11.0.13+8/src/hotspot/share/c1/c1_GraphBuilder.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/c1/c1_LinearScan.cpp | 22 openjdk-11-11.0.13+8/src/hotspot/share/ci/ciEnv.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/ci/ciObjectFactory.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/classfile/classFileParser.cpp | 7 openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.cpp | 31 openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.inline.hpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderStats.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/classfile/dictionary.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/share/classfile/javaClasses.cpp | 38 openjdk-11-11.0.13+8/src/hotspot/share/classfile/javaClasses.hpp | 7 openjdk-11-11.0.13+8/src/hotspot/share/classfile/protectionDomainCache.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/classfile/stringTable.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/classfile/systemDictionary.cpp | 16 openjdk-11-11.0.13+8/src/hotspot/share/classfile/verifier.cpp | 21 openjdk-11-11.0.13+8/src/hotspot/share/code/dependencies.cpp | 31 openjdk-11-11.0.13+8/src/hotspot/share/code/dependencyContext.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/code/dependencyContext.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/compiler/compileBroker.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/compiler/compileBroker.hpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/gc/epsilon/epsilon_globals.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/gc/parallel/psCompactionManager.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/barrierSet.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/memAllocator.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp | 12 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp | 12 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp | 10 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp | 28 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp | 10 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/interpreter/bytecodeInterpreter.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/interpreter/interpreterRuntime.cpp | 7 openjdk-11-11.0.13+8/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp | 98 openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp | 39 openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp | 16 openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp | 71 openjdk-11-11.0.13+8/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp | 1 openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 10 openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciRuntime.cpp | 108 openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciRuntime.hpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/memory/iterator.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/share/memory/metaspaceShared.cpp | 14 openjdk-11-11.0.13+8/src/hotspot/share/memory/universe.cpp | 12 openjdk-11-11.0.13+8/src/hotspot/share/oops/access.cpp | 36 openjdk-11-11.0.13+8/src/hotspot/share/oops/access.hpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/oops/access.inline.hpp | 14 openjdk-11-11.0.13+8/src/hotspot/share/oops/accessBackend.hpp | 44 openjdk-11-11.0.13+8/src/hotspot/share/oops/constantPool.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/oops/instanceKlass.cpp | 16 openjdk-11-11.0.13+8/src/hotspot/share/oops/klassVtable.cpp | 42 openjdk-11-11.0.13+8/src/hotspot/share/oops/objArrayKlass.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/oops/oop.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/oops/oopsHierarchy.cpp | 3 openjdk-11-11.0.13+8/src/hotspot/share/oops/typeArrayKlass.cpp | 1 openjdk-11-11.0.13+8/src/hotspot/share/opto/addnode.cpp | 90 openjdk-11-11.0.13+8/src/hotspot/share/opto/addnode.hpp | 30 openjdk-11-11.0.13+8/src/hotspot/share/opto/block.cpp | 20 openjdk-11-11.0.13+8/src/hotspot/share/opto/block.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/opto/c2compiler.cpp | 16 openjdk-11-11.0.13+8/src/hotspot/share/opto/c2compiler.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/share/opto/callnode.cpp | 68 openjdk-11-11.0.13+8/src/hotspot/share/opto/callnode.hpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/opto/compile.cpp | 120 openjdk-11-11.0.13+8/src/hotspot/share/opto/compile.hpp | 19 openjdk-11-11.0.13+8/src/hotspot/share/opto/gcm.cpp | 42 openjdk-11-11.0.13+8/src/hotspot/share/opto/graphKit.cpp | 37 openjdk-11-11.0.13+8/src/hotspot/share/opto/graphKit.hpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/opto/lcm.cpp | 39 openjdk-11-11.0.13+8/src/hotspot/share/opto/library_call.cpp | 32 openjdk-11-11.0.13+8/src/hotspot/share/opto/locknode.cpp | 10 openjdk-11-11.0.13+8/src/hotspot/share/opto/locknode.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/opto/loopTransform.cpp | 96 openjdk-11-11.0.13+8/src/hotspot/share/opto/loopopts.cpp | 14 openjdk-11-11.0.13+8/src/hotspot/share/opto/macro.cpp | 24 openjdk-11-11.0.13+8/src/hotspot/share/opto/macroArrayCopy.cpp | 18 openjdk-11-11.0.13+8/src/hotspot/share/opto/node.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/opto/reg_split.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/opto/stringopts.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/prims/jni.cpp | 72 openjdk-11-11.0.13+8/src/hotspot/share/prims/jvm.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmti.xml | 4 openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExport.cpp | 50 openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExport.hpp | 7 openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExtensions.cpp | 9 openjdk-11-11.0.13+8/src/hotspot/share/prims/methodHandles.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/prims/resolvedMethodTable.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/prims/stackwalk.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/prims/unsafe.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/prims/whitebox.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/runtime/arguments.cpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/runtime/biasedLocking.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/runtime/handles.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/runtime/javaCalls.cpp | 16 openjdk-11-11.0.13+8/src/hotspot/share/runtime/jniHandles.inline.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/runtime/mutexLocker.cpp | 18 openjdk-11-11.0.13+8/src/hotspot/share/runtime/mutexLocker.hpp | 9 openjdk-11-11.0.13+8/src/hotspot/share/runtime/os.cpp | 26 openjdk-11-11.0.13+8/src/hotspot/share/runtime/reflection.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepoint.cpp | 1 openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.cpp | 12 openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.inline.hpp | 23 openjdk-11-11.0.13+8/src/hotspot/share/runtime/sweeper.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/runtime/sweeper.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/runtime/synchronizer.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/runtime/thread.cpp | 6 openjdk-11-11.0.13+8/src/hotspot/share/runtime/thread.hpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/runtime/threadSMR.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/runtime/threadSMR.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/runtime/unhandledOops.cpp | 23 openjdk-11-11.0.13+8/src/hotspot/share/runtime/unhandledOops.hpp | 9 openjdk-11-11.0.13+8/src/hotspot/share/runtime/vframe.cpp | 8 openjdk-11-11.0.13+8/src/hotspot/share/runtime/vframe.hpp | 5 openjdk-11-11.0.13+8/src/hotspot/share/runtime/vmStructs.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/services/attachListener.cpp | 23 openjdk-11-11.0.13+8/src/hotspot/share/services/attachListener.hpp | 38 openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticCommand.cpp | 21 openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticCommand.hpp | 1 openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticFramework.cpp | 9 openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticFramework.hpp | 1 openjdk-11-11.0.13+8/src/hotspot/share/services/gcNotifier.cpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/services/heapDumper.cpp | 547 +-- openjdk-11-11.0.13+8/src/hotspot/share/services/heapDumper.hpp | 15 openjdk-11-11.0.13+8/src/hotspot/share/services/memBaseline.cpp | 10 openjdk-11-11.0.13+8/src/hotspot/share/services/memBaseline.hpp | 3 openjdk-11-11.0.13+8/src/hotspot/share/services/memoryManager.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/services/memoryPool.hpp | 2 openjdk-11-11.0.13+8/src/hotspot/share/services/threadService.cpp | 7 openjdk-11-11.0.13+8/src/hotspot/share/utilities/debug.cpp | 12 openjdk-11-11.0.13+8/src/hotspot/share/utilities/debug.hpp | 10 openjdk-11-11.0.13+8/src/hotspot/share/utilities/decoder.cpp | 28 openjdk-11-11.0.13+8/src/hotspot/share/utilities/decoder.hpp | 1 openjdk-11-11.0.13+8/src/hotspot/share/utilities/exceptions.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/utilities/globalDefinitions_gcc.hpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/utilities/growableArray.hpp | 11 openjdk-11-11.0.13+8/src/hotspot/share/utilities/vmError.cpp | 4 openjdk-11-11.0.13+8/src/hotspot/share/utilities/vmError.hpp | 4 openjdk-11-11.0.13+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java | 5 openjdk-11-11.0.13+8/src/java.base/macosx/native/libjava/java_props_macosx.c | 43 openjdk-11-11.0.13+8/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java | 2 openjdk-11-11.0.13+8/src/java.base/share/classes/java/lang/StringCoding.java | 15 openjdk-11-11.0.13+8/src/java.base/share/classes/java/net/URLClassLoader.java | 5 openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/HashMap.java | 46 openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/HashSet.java | 11 openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/jar/JarFile.java | 8 openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/IvParameterSpec.java | 11 openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java | 9 openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java | 9 openjdk-11-11.0.13+8/src/java.base/share/classes/jdk/internal/loader/Resource.java | 8 openjdk-11-11.0.13+8/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java | 14 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/nio/cs/ArrayDecoder.java | 15 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/nio/cs/SingleByte.java | 29 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java | 3 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java | 72 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/CipherSuite.java | 308 +- openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java | 7 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java | 39 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java | 42 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java | 20 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java | 4 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/JsseJce.java | 5 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java | 53 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/NamedGroup.java | 84 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java | 3 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/RandomCookie.java | 10 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java | 8 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLCipher.java | 570 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLLogger.java | 2 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java | 12 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java | 13 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SessionId.java | 3 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/X509Authentication.java | 6 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/tools/keytool/CertAndKeyGen.java | 9 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/tools/keytool/Main.java | 76 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/AbstractAlgorithmConstraints.java | 39 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/ByteArrays.java | 67 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java | 280 + openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerInputStream.java | 24 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerValue.java | 29 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java | 28 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java | 2 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java | 2 openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java | 4 openjdk-11-11.0.13+8/src/java.compiler/share/classes/javax/tools/ToolProvider.java | 7 openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java | 290 - openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java | 32 openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java | 8 openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m | 12 openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m | 7 openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.h | 29 openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.m | 61 openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c | 10 openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libosxapp/JNIUtilities.m | 11 openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java | 7 openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties | 1 openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java | 14 openjdk-11-11.0.13+8/src/java.desktop/share/classes/java/awt/GridBagLayout.java | 20 openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/JPasswordField.java | 29 openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java | 302 + openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java | 317 -- openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java | 3 openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/Utilities.java | 8 openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java | 63 openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java | 72 openjdk-11-11.0.13+8/src/java.desktop/share/legal/mesa3d.md | 2 openjdk-11-11.0.13+8/src/java.desktop/share/native/common/java2d/opengl/J2D_GL/gl.h | 12 openjdk-11-11.0.13+8/src/java.desktop/share/native/common/java2d/opengl/J2D_GL/glext.h | 71 openjdk-11-11.0.13+8/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.h | 4 openjdk-11-11.0.13+8/src/java.desktop/unix/native/common/java2d/opengl/J2D_GL/glx.h | 5 openjdk-11-11.0.13+8/src/java.desktop/unix/native/common/java2d/opengl/J2D_GL/glxext.h | 37 openjdk-11-11.0.13+8/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c | 41 openjdk-11-11.0.13+8/src/java.desktop/unix/native/libawt/awt/awt_Mlib.c | 44 openjdk-11-11.0.13+8/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c | 14 openjdk-11-11.0.13+8/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java | 15 openjdk-11-11.0.13+8/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java | 91 openjdk-11-11.0.13+8/src/java.desktop/windows/native/libawt/java2d/opengl/J2D_GL/wglext.h | 40 openjdk-11-11.0.13+8/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp | 113 openjdk-11-11.0.13+8/src/java.naming/share/classes/com/sun/jndi/ldap/Obj.java | 8 openjdk-11-11.0.13+8/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java | 2 openjdk-11-11.0.13+8/src/java.net.http/share/classes/java/net/http/HttpResponse.java | 2 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/AuthenticationFilter.java | 17 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java | 9 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java | 12 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java | 1 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/HttpResponseImpl.java | 22 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/LineSubscriberAdapter.java | 12 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java | 6 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/RawChannelTube.java | 4 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java | 24 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/common/Log.java | 4 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/websocket/OpeningHandshake.java | 13 openjdk-11-11.0.13+8/src/java.net.http/share/classes/jdk/internal/net/http/websocket/RawChannel.java | 3 openjdk-11-11.0.13+8/src/java.security.jgss/share/classes/sun/security/jgss/krb5/SubjectComber.java | 160 - openjdk-11-11.0.13+8/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java | 70 openjdk-11-11.0.13+8/src/java.security.jgss/share/classes/sun/security/krb5/internal/ReferralsCache.java | 46 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java | 195 + openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java | 15 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java | 115 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithmSpi.java | 53 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java | 38 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java | 140 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureBaseRSA.java | 314 +- openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java | 104 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureECDSA.java | 147 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizationException.java | 6 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java | 178 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java | 97 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/InvalidCanonicalizerException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/C14nHelper.java | 71 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_OmitComments.java | 3 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_WithComments.java | 3 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java | 42 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java | 82 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclOmitComments.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclWithComments.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315OmitComments.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315WithComments.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java | 173 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java | 38 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java | 60 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/UtfHelpper.java | 40 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/XmlAttrStack.java | 35 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/AlgorithmAlreadyRegisteredException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/Base64DecodingException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityRuntimeException.java | 8 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/ContentHandlerAlreadyRegisteredException.java | 94 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java | 22 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyUtils.java | 82 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/DEREncodedKeyValue.java | 13 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java | 2 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/DSAKeyValue.java | 9 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/ECKeyValue.java | 8 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/RSAKeyValue.java | 6 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Certificate.java | 11 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Digest.java | 16 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/InvalidKeyResolverException.java | 91 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java | 244 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java | 162 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/DEREncodedKeyValueResolver.java | 40 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/DSAKeyValueResolver.java | 39 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/ECKeyValueResolver.java | 39 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/KeyInfoReferenceResolver.java | 86 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/PrivateKeyResolver.java | 86 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RSAKeyValueResolver.java | 30 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java | 159 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SecretKeyResolver.java | 78 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SingleKeyResolver.java | 105 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509CertificateResolver.java | 62 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509DigestResolver.java | 38 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509IssuerSerialResolver.java | 49 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SKIResolver.java | 86 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SubjectNameResolver.java | 82 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java | 45 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolverException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/CertsInFilesystemDirectoryResolver.java | 219 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java | 79 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java | 6 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParser.java | 36 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParserException.java | 83 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/parser/XMLParserImpl.java | 139 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/config.xml | 17 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_de.properties | 3 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties | 3 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/InvalidDigestValueException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/InvalidSignatureValueException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java | 50 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/MissingResourceFailureException.java | 8 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java | 113 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/ReferenceNotInitializedException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java | 11 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java | 173 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java | 230 + openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java | 65 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInputDebugger.java | 13 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceData.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceNodeSetData.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceOctetStreamData.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceSubTreeData.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/InvalidTransformException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java | 165 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformSpi.java | 60 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformationException.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transforms.java | 25 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java | 2 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.java | 62 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N.java | 52 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N11.java | 37 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N11_WithComments.java | 37 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusive.java | 78 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusiveWithComments.java | 66 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NWithComments.java | 47 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformEnvelopedSignature.java | 20 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath.java | 37 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath2Filter.java | 62 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPointer.java | 64 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java | 36 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java | 8 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPath2FilterContainer.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPath2FilterContainer04.java | 242 - openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPathFilterCHGPContainer.java | 323 -- openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java | 14 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ClassLoaderUtils.java | 3 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Constants.java | 15 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java | 131 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java | 20 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/EncryptionConstants.java | 234 + openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/I18n.java | 6 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java | 2 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathAPI.java | 2 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java | 26 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java | 8 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java | 6 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/WeakObjectPool.java | 121 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java | 444 -- openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFactory.java | 15 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XalanXPathAPI.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java | 335 -- openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverContext.java | 27 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverException.java | 6 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java | 133 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverAnonymous.java | 43 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java | 66 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java | 13 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java | 11 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java | 26 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/com/sun/org/slf4j/internal/Logger.java | 4 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/DigesterOutputStream.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/SignerOutputStream.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java | 74 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheData.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java | 9 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheOctetStreamData.java | 8 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java | 19 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMBase64Transform.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14N11Method.java | 9 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14NMethod.java | 9 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java | 36 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMCryptoBinary.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMDigestMethod.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMEnvelopedTransform.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java | 11 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java | 18 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyName.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java | 31 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java | 325 ++ openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java | 37 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java | 9 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java | 23 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java | 33 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMStructure.java | 34 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java | 36 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java | 127 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java | 19 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java | 34 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java | 7 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathFilter2Transform.java | 19 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathTransform.java | 17 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMXSLTTransform.java | 5 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/RSAPSSParameterSpec.java | 81 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java | 9 openjdk-11-11.0.13+8/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java | 29 openjdk-11-11.0.13+8/src/java.xml.crypto/share/legal/santuario.md | 4 openjdk-11-11.0.13+8/src/jdk.accessibility/windows/native/common/AccessBridgeDebug.cpp | 15 openjdk-11-11.0.13+8/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java | 11 openjdk-11-11.0.13+8/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | 8 openjdk-11-11.0.13+8/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java | 51 openjdk-11-11.0.13+8/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java | 23 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.c | 11 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h | 37 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c | 77 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h | 8 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h | 12 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c | 4 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c | 57 openjdk-11-11.0.13+8/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java | 8 openjdk-11-11.0.13+8/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java | 5 openjdk-11-11.0.13+8/src/jdk.httpserver/share/classes/sun/net/httpserver/SSLStreams.java | 18 openjdk-11-11.0.13+8/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java | 10 openjdk-11-11.0.13+8/src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/NonBlocking.java | 21 openjdk-11-11.0.13+8/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java | 5 openjdk-11-11.0.13+8/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java | 4 openjdk-11-11.0.13+8/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java | 27 openjdk-11-11.0.13+8/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java | 2 openjdk-11-11.0.13+8/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Analyzer.java | 8 openjdk-11-11.0.13+8/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsWriter.java | 2 openjdk-11-11.0.13+8/src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c | 11 openjdk-11-11.0.13+8/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java | 2 openjdk-11-11.0.13+8/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c | 18 openjdk-11-11.0.13+8/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c | 38 openjdk-11-11.0.13+8/src/jdk.management/macosx/native/libmanagement_ext/UnixOperatingSystem.c | 17 openjdk-11-11.0.13+8/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java | 184 - openjdk-11-11.0.13+8/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java | 8 openjdk-11-11.0.13+8/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java | 27 openjdk-11-11.0.13+8/test/hotspot/gtest/code/test_dependencyContext.cpp | 14 openjdk-11-11.0.13+8/test/hotspot/jtreg/ProblemList.txt | 3 openjdk-11-11.0.13+8/test/hotspot/jtreg/TEST.ROOT | 2 openjdk-11-11.0.13+8/test/hotspot/jtreg/TEST.groups | 1 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/arraycopy/TestIllegalArrayCopyBeforeInfiniteLoop.java | 61 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/arraycopy/TestNegArrayLengthAsIndex1.java | 54 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/arraycopy/TestNegArrayLengthAsIndex2.java | 52 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/arraycopy/TestNegativeArrayCopyAfterLoop.java | 60 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/c1/Test8267042.java | 170 + openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/c1/TestLinearScanHasFPURegisters.java | 56 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/c2/TestImplicitNullCheckDominance.java | 62 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java | 29 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesShenandoah.java | 20 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java | 13 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/exceptions/TestSpilling.java | 65 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/floatingpoint/NaNTest.java | 43 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java | 43 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java | 3 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java | 13 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/locks/TestNestedLocksElimination.java | 150 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/loopopts/TestDeadCountedLoop.java | 65 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/loopopts/TestIdomAfterLoopUnswitching.java | 72 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/loopopts/TestInfLoopNearUsePlacement.java | 72 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/loopopts/TestPeelingRemoveDominatedTest.java | 67 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/loopopts/superword/TestWronglyMarkedReduction.java | 67 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckLimits.java | 158 + openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/types/TestInterfaceArraySubtypeCheck.java | 79 openjdk-11-11.0.13+8/test/hotspot/jtreg/compiler/uncommontrap/TestNullCheckAntiDependence.java | 18 openjdk-11-11.0.13+8/test/hotspot/jtreg/gc/epsilon/TestClasses.java | 20 openjdk-11-11.0.13+8/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java | 27 openjdk-11-11.0.13+8/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java | 8 openjdk-11-11.0.13+8/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java | 39 openjdk-11-11.0.13+8/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java | 69 openjdk-11-11.0.13+8/test/hotspot/jtreg/gc/shenandoah/options/TestLargePagesWithSmallHeap.java | 71 openjdk-11-11.0.13+8/test/hotspot/jtreg/runtime/8251945/Test.java | 203 + openjdk-11-11.0.13+8/test/hotspot/jtreg/runtime/CheckUnhandledOops/TestOutOfMemory.java | 44 openjdk-11-11.0.13+8/test/hotspot/jtreg/runtime/Locals/TestLargeLocalVarsStackRegion.java | 50 openjdk-11-11.0.13+8/test/hotspot/jtreg/runtime/Locals/TestLargeLocalVarsStackRegionHelper.jasm | 58 openjdk-11-11.0.13+8/test/hotspot/jtreg/runtime/MemberName/ResolvedMethodTableHash.java | 15 openjdk-11-11.0.13+8/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c | 13 openjdk-11-11.0.13+8/test/hotspot/jtreg/serviceability/attach/ConcAttachTest.java | 126 openjdk-11-11.0.13+8/test/hotspot/jtreg/serviceability/attach/RemovingUnixDomainSocketTest.java | 96 openjdk-11-11.0.13+8/test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpTest.java | 15 openjdk-11-11.0.13+8/test/hotspot/jtreg/testlibrary/ctw/Makefile | 42 openjdk-11-11.0.13+8/test/hotspot/jtreg/vmTestbase/TEST.properties | 2 openjdk-11-11.0.13+8/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/ex03t001.c | 10 openjdk-11-11.0.13+8/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/sde/InstallSDE.java | 16 openjdk-11-11.0.13+8/test/hotspot/jtreg/vmTestbase/nsk/stress/except/except002.java | 4 openjdk-11-11.0.13+8/test/hotspot/jtreg/vmTestbase/nsk/stress/except/except003.java | 4 openjdk-11-11.0.13+8/test/jaxp/TEST.ROOT | 2 openjdk-11-11.0.13+8/test/jdk/ProblemList.txt | 5 openjdk-11-11.0.13+8/test/jdk/TEST.ROOT | 5 openjdk-11-11.0.13+8/test/jdk/com/sun/jdi/sde/InstallSDE.java | 16 openjdk-11-11.0.13+8/test/jdk/com/sun/net/httpserver/InputNotRead.java | 230 + openjdk-11-11.0.13+8/test/jdk/com/sun/org/apache/xml/internal/security/ShortECDSA.java | 196 + openjdk-11-11.0.13+8/test/jdk/com/sun/org/apache/xml/internal/security/TruncateHMAC.java | 4 openjdk-11-11.0.13+8/test/jdk/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java | 1 openjdk-11-11.0.13+8/test/jdk/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java | 13 openjdk-11-11.0.13+8/test/jdk/com/sun/security/auth/login/ConfigFile/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java | 235 - openjdk-11-11.0.13+8/test/jdk/java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java | 240 - openjdk-11-11.0.13+8/test/jdk/java/awt/Robot/InfiniteLoopException.java | 4 openjdk-11-11.0.13+8/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlSpace.java | 100 openjdk-11-11.0.13+8/test/jdk/java/awt/font/TextLayout/ArabicDiacriticTest.java | 16 openjdk-11-11.0.13+8/test/jdk/java/awt/print/MissedFontFamilyName/PrintFontWithMissedFontFamilyTest.java | 289 + openjdk-11-11.0.13+8/test/jdk/java/awt/print/PathPrecisionScaleFactor/PathPrecisionScaleFactorShapeTest.java | 265 + openjdk-11-11.0.13+8/test/jdk/java/awt/print/PathPrecisionScaleFactor/PathPrecisionScaleFactorTextTest.java | 254 + openjdk-11-11.0.13+8/test/jdk/java/awt/print/PrinterJob/TestSaveFileWithoutPrinter.java | 218 + openjdk-11-11.0.13+8/test/jdk/java/awt/regtesthelpers/VisibilityValidator.java | 307 -- openjdk-11-11.0.13+8/test/jdk/java/awt/regtesthelpers/Waypoint.java | 105 openjdk-11-11.0.13+8/test/jdk/java/io/Serializable/serialFilter/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/java/lang/ModuleTests/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/java/lang/Package/PackageFromManifest.java | 1 openjdk-11-11.0.13+8/test/jdk/java/lang/String/concat/IntegerMinValue.java | 60 openjdk-11-11.0.13+8/test/jdk/java/lang/invoke/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/java/math/BigInteger/PrimitiveConversionTests.java | 10 openjdk-11-11.0.13+8/test/jdk/java/net/DatagramSocket/ReportSocketClosed.java | 4 openjdk-11-11.0.13+8/test/jdk/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java | 2 openjdk-11-11.0.13+8/test/jdk/java/net/HttpURLConnection/HttpURLConWithProxy.java | 10 openjdk-11-11.0.13+8/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java | 3 openjdk-11-11.0.13+8/test/jdk/java/net/MulticastSocket/Promiscuous.java | 91 openjdk-11-11.0.13+8/test/jdk/java/net/MulticastSocket/SetLoopbackMode.java | 1 openjdk-11-11.0.13+8/test/jdk/java/net/MulticastSocket/SetLoopbackModeIPv4.java | 45 openjdk-11-11.0.13+8/test/jdk/java/net/MulticastSocket/SetOutgoingIf.java | 52 openjdk-11-11.0.13+8/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java | 1 openjdk-11-11.0.13+8/test/jdk/java/net/Socket/LingerTest.java | 37 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/AbstractConnectTimeout.java | 21 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/BodySubscribersTest.java | 159 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/DigestEchoClientSSL.java | 17 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/EchoHandler.java | 3 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java | 25 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersFromPublisher.java | 53 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersNoBody.java | 53 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersOfByteArray.java | 56 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersOfByteArrays.java | 53 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersOfFile.java | 72 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersOfInputStream.java | 51 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodyPublishersOfSubByteArray.java | 60 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersBuffering.java | 50 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersDiscarding.java | 49 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersFromLineSubscriber.java | 51 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersFromSubscriber.java | 51 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersMapping.java | 50 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfByteArray.java | 49 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfByteArrayConsumer.java | 49 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfFile.java | 50 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfInputStream.java | 49 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfLines.java | 51 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfPublisher.java | 79 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfPublisher1.java | 84 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfPublisherPublisher.java | 67 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersOfString.java | 51 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/BodySubscribersReplacing.java | 50 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/S.java | 277 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/SPublisherOfStream.java | 49 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/STest.java | 119 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck-tests/TckDriver.java | 156 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/FlowAdapters.java | 389 ++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/Processor.java | 34 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/Publisher.java | 52 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/Subscriber.java | 78 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/Subscription.java | 56 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/example/unicast/AsyncIterablePublisher.java | 281 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/example/unicast/AsyncSubscriber.java | 261 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/example/unicast/InfiniteIncrementNumberPublisher.java | 46 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/example/unicast/NumberIterablePublisher.java | 50 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/example/unicast/RangePublisher.java | 254 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/example/unicast/SyncSubscriber.java | 134 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/IdentityProcessorVerification.java | 896 +++++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/PublisherVerification.java | 1245 ++++++++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/SubscriberBlackboxVerification.java | 516 +++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/SubscriberWhiteboxVerification.java | 843 +++++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/TestEnvironment.java | 1168 +++++++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/WithHelperPublisher.java | 92 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/FlowPublisherVerification.java | 75 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/FlowSubscriberBlackboxVerification.java | 77 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/FlowSubscriberWhiteboxVerification.java | 60 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/IdentityFlowProcessorVerification.java | 80 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/Function.java | 28 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/HelperPublisher.java | 54 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/InfiniteHelperPublisher.java | 53 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/NonFatal.java | 55 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/Optional.java | 92 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/PublisherVerificationRules.java | 658 ++++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/SubscriberBlackboxVerificationRules.java | 395 ++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/SubscriberBufferOverflowException.java | 41 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/SubscriberWhiteboxVerificationRules.java | 58 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/TestException.java | 34 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/Abort.java | 489 +-- openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/AutomaticPong.java | 236 - openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/DummySecureWebSocketServer.java | 610 ++++ openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/SecureSupport.java | 172 + openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/SendTest.java | 86 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java | 97 openjdk-11-11.0.13+8/test/jdk/java/net/httpclient/websocket/WebSocketTest.java | 851 ++--- openjdk-11-11.0.13+8/test/jdk/java/nio/channels/DatagramChannel/ReceiveISA.java | 129 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/FileChannel/directio/DirectIOTest.java | 11 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java | 16 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/CloseTest.java | 8 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoService.java | 6 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java | 8 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java | 2 openjdk-11-11.0.13+8/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/StateTest.java | 8 openjdk-11-11.0.13+8/test/jdk/java/rmi/registry/serialFilter/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/java/security/KeyStore/TestKeyStoreBasic.java | 15 openjdk-11-11.0.13+8/test/jdk/java/security/Security/SecurityPropFile/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/java/time/tck/java/time/TCKLocalDateTime.java | 14 openjdk-11-11.0.13+8/test/jdk/java/time/tck/java/time/TCKLocalTime.java | 13 openjdk-11-11.0.13+8/test/jdk/java/time/tck/java/time/TCKZonedDateTime.java | 13 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/GenericTimeZoneNamesTest.java | 19 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/GenericTimeZoneNamesTest.sh | 46 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/NarrowNamesTest.java | 18 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/NarrowNamesTest.sh | 41 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.java | 29 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.sh | 74 openjdk-11-11.0.13+8/test/jdk/java/util/Calendar/SupplementalJapaneseEraTestRun.java | 126 openjdk-11-11.0.13+8/test/jdk/java/util/Locale/bcp47u/SystemPropertyTests.java | 5 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/BreakIteratorProviderTest.java | 38 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/BreakIteratorProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CalendarDataProviderTest.java | 25 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CalendarDataProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CalendarNameProviderTest.java | 36 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CalendarNameProviderTest.sh | 27 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/ClasspathTest.java | 20 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/ClasspathTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CollatorProviderTest.java | 38 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CollatorProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CurrencyNameProviderTest.java | 40 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/CurrencyNameProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/DateFormatProviderTest.java | 39 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/DateFormatProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java | 35 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/DateFormatSymbolsProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/DecimalFormatSymbolsProviderTest.java | 31 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/DecimalFormatSymbolsProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/ExecTest.sh | 145 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/GenericTest.java | 66 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/GenericTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.java | 34 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/NumberFormatProviderTest.java | 34 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/NumberFormatProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/PermissionTest.java | 64 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/PermissionTest.sh | 31 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/TimeZoneNameProviderTest.java | 38 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/TimeZoneNameProviderTest.sh | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/BreakIteratorProviderImpl.java | 140 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/CalendarDataProviderImpl.java | 54 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/CalendarNameProviderImpl.java | 102 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/CollatorProviderImpl.java | 68 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/CurrencyNameProviderImpl.java | 82 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/CurrencyNameProviderImpl2.java | 72 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/DateFormatProviderImpl.java | 95 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/DateFormatSymbolsProviderImpl.java | 230 - openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/DecimalFormatSymbolsProviderImpl.java | 110 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/FooDateFormat.java | 61 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/FooNumberFormat.java | 81 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java | 58 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/LocaleNameProviderImpl.java | 100 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames.properties | 25 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_ja.properties | 30 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_ja_JP_kyoto.properties | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_ja_JP_osaka.properties | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_xx.properties | 23 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/Makefile | 78 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/NumberFormatProviderImpl.java | 156 - openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/TimeZoneNameProviderImpl.java | 150 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/Utils.java | 68 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.CalendarDataProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.CalendarNameProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.CurrencyNameProvider | 8 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.LocaleNameProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.TimeZoneNameProvider | 8 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CalendarDataProviderImpl.java | 54 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CalendarNameProviderImpl.java | 102 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CurrencyNameProviderImpl.java | 82 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CurrencyNameProviderImpl2.java | 72 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/GenericTimeZoneNameProviderImpl.java | 58 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNameProviderImpl.java | 100 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames.properties | 25 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_ja.properties | 30 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_ja_JP_kyoto.properties | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_ja_JP_osaka.properties | 28 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_xx.properties | 23 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/TimeZoneNameProviderImpl.java | 150 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/foobarutils/com/foobar/Utils.java | 68 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.BreakIteratorProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.CollatorProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.DateFormatProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.DateFormatSymbolsProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.NumberFormatProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/BreakIteratorProviderImpl.java | 140 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/CollatorProviderImpl.java | 68 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/DateFormatProviderImpl.java | 95 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/DateFormatSymbolsProviderImpl.java | 230 + openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/DecimalFormatSymbolsProviderImpl.java | 110 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/FooDateFormat.java | 61 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/FooNumberFormat.java | 81 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/NumberFormatProviderImpl.java | 156 + openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.BreakIteratorProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.CollatorProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.DateFormatProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.DateFormatSymbolsProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.DecimalFormatSymbolsProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.NumberFormatProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.CalendarDataProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.CalendarNameProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.CurrencyNameProvider | 8 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.LocaleNameProvider | 7 openjdk-11-11.0.13+8/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider | 8 openjdk-11-11.0.13+8/test/jdk/java/util/ServiceLoader/basic/ServiceLoaderBasicTest.java | 162 + openjdk-11-11.0.13+8/test/jdk/java/util/ServiceLoader/basic/basic.sh | 156 - openjdk-11-11.0.13+8/test/jdk/java/util/logging/ParentLoggersTest.java | 2 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/CheckUserPrefFirst.java | 6 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/CheckUserPrefLater.java | 5 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/CheckUserPrefsStorage.java | 50 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/CheckUserPrefsStorage.sh | 68 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/PrefsSpi.java | 4 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/PrefsSpi.sh | 104 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/PrefsSpiTest.java | 109 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/StubPreferences.java | 37 openjdk-11-11.0.13+8/test/jdk/java/util/prefs/StubPreferencesFactory.java | 30 openjdk-11-11.0.13+8/test/jdk/java/util/zip/ZipFile/DeleteTempJar.java | 13 openjdk-11-11.0.13+8/test/jdk/java/util/zip/ZipFile/DeleteTempJarTest.java | 51 openjdk-11-11.0.13+8/test/jdk/java/util/zip/ZipFile/deletetempjar.sh | 40 openjdk-11-11.0.13+8/test/jdk/javax/imageio/plugins/tiff/LargeTIFFTagTest.java | 76 openjdk-11-11.0.13+8/test/jdk/javax/management/security/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/javax/naming/module/RunBasic.java | 122 openjdk-11-11.0.13+8/test/jdk/javax/naming/module/basic.sh | 104 openjdk-11-11.0.13+8/test/jdk/javax/net/ssl/TLSCommon/CipherSuite.java | 2 openjdk-11-11.0.13+8/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java | 3 openjdk-11-11.0.13+8/test/jdk/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java | 242 + openjdk-11-11.0.13+8/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java | 260 - openjdk-11-11.0.13+8/test/jdk/javax/security/auth/login/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/javax/swing/ButtonGroup/TestButtonGroupFocusTraversal.java | 217 + openjdk-11-11.0.13+8/test/jdk/javax/swing/JComboBox/8032878/bug8032878.java | 26 openjdk-11-11.0.13+8/test/jdk/javax/swing/JFormattedTextField/TestSelectedTextBackgroundColor.java | 151 openjdk-11-11.0.13+8/test/jdk/javax/swing/JPasswordField/TestSelectedTextBackgroundColor.java | 150 openjdk-11-11.0.13+8/test/jdk/javax/swing/JProgressBar/TestJProgressBarHighlightColor.java | 146 openjdk-11-11.0.13+8/test/jdk/javax/swing/JSlider/TestJSliderRendering.java | 148 openjdk-11-11.0.13+8/test/jdk/javax/swing/JSpinner/TestSelectedTextBackgroundColor.java | 168 + openjdk-11-11.0.13+8/test/jdk/javax/swing/JTextPane/TestJTextPaneBackgroundColor.java | 140 openjdk-11-11.0.13+8/test/jdk/javax/swing/JToolTip/TestTooltipBackgroundColor.java | 194 + openjdk-11-11.0.13+8/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java | 3 openjdk-11-11.0.13+8/test/jdk/javax/swing/text/Caret/TestCaretPositionJTextPane.java | 128 openjdk-11-11.0.13+8/test/jdk/javax/xml/crypto/dsig/GenerationTests.java | 7 openjdk-11-11.0.13+8/test/jdk/jdk/internal/jrtfs/remote/RemoteRuntimeImageTest.java | 21 openjdk-11-11.0.13+8/test/jdk/jdk/internal/reflect/Reflection/GetCallerClassTest.java | 13 openjdk-11-11.0.13+8/test/jdk/jdk/internal/reflect/Reflection/GetCallerClassTest.sh | 70 openjdk-11-11.0.13+8/test/jdk/jdk/internal/reflect/Reflection/SetupGetCallerClass.java | 43 openjdk-11-11.0.13+8/test/jdk/jdk/jfr/event/gc/detailed/ExecuteOOMApp.java | 4 openjdk-11-11.0.13+8/test/jdk/jdk/jfr/jvm/TestPrimitiveClasses.java | 86 openjdk-11-11.0.13+8/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java | 31 openjdk-11-11.0.13+8/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java | 5 openjdk-11-11.0.13+8/test/jdk/sanity/client/README | 4 openjdk-11-11.0.13+8/test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java | 2 openjdk-11-11.0.13+8/test/jdk/sanity/client/SwingSet/src/EditorPaneDemoTest.java | 2 openjdk-11-11.0.13+8/test/jdk/sanity/client/TEST.ROOT.template | 24 openjdk-11-11.0.13+8/test/jdk/sanity/client/TEST.properties | 28 openjdk-11-11.0.13+8/test/jdk/sun/net/InetAddress/nameservice/dns/CNameTest.java | 4 openjdk-11-11.0.13+8/test/jdk/sun/net/www/http/HttpClient/MultiThreadTest.java | 51 openjdk-11-11.0.13+8/test/jdk/sun/net/www/protocol/http/GetErrorStream.java | 89 openjdk-11-11.0.13+8/test/jdk/sun/security/krb5/auto/ReferralsTest.java | 22 openjdk-11-11.0.13+8/test/jdk/sun/security/krb5/canonicalize/Test.java | 15 openjdk-11-11.0.13+8/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java | 8 openjdk-11-11.0.13+8/test/jdk/sun/security/mscapi/nonUniqueAliases/NonUniqueAliases.java | 2 openjdk-11-11.0.13+8/test/jdk/sun/security/provider/SecureRandom/DrbgCavp.java | 7 openjdk-11-11.0.13+8/test/jdk/sun/security/ssl/SSLSessionContextImpl/Timeout.java | 40 openjdk-11-11.0.13+8/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java | 69 openjdk-11-11.0.13+8/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions.java | 24 openjdk-11-11.0.13+8/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketReset.java | 108 openjdk-11-11.0.13+8/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java | 19 openjdk-11-11.0.13+8/test/jdk/sun/security/tools/keytool/CheckCertAKID.java | 102 openjdk-11-11.0.13+8/test/jdk/sun/security/util/Resources/TEST.properties | 2 openjdk-11-11.0.13+8/test/jdk/sun/security/x509/URICertStore/ExtensionsWithLDAP.java | 22 openjdk-11-11.0.13+8/test/jdk/sun/text/IntHashtable/Bug4170614Test.sh | 81 openjdk-11-11.0.13+8/test/jdk/sun/text/IntHashtable/Bug4170614TestRun.java | 30 openjdk-11-11.0.13+8/test/jdk/sun/text/IntHashtable/patch-src/java.base/java/text/Bug4170614Test.java | 190 + openjdk-11-11.0.13+8/test/jdk/sun/text/IntHashtable/patch-src/java/text/Bug4170614Test.java | 191 - openjdk-11-11.0.13+8/test/jdk/tools/launcher/ExecutionEnvironment.java | 25 openjdk-11-11.0.13+8/test/jdk/tools/launcher/Test7029048.java | 75 openjdk-11-11.0.13+8/test/jdk/tools/launcher/TestHelper.java | 3 openjdk-11-11.0.13+8/test/langtools/TEST.ROOT | 2 openjdk-11-11.0.13+8/test/langtools/jdk/javadoc/tool/6176978/T6176978.java | 81 openjdk-11-11.0.13+8/test/langtools/jdk/javadoc/tool/6176978/X.java | 44 openjdk-11-11.0.13+8/test/langtools/jdk/javadoc/tool/InlineTagsWithBraces.java | 112 openjdk-11-11.0.13+8/test/langtools/jdk/javadoc/tool/LangVers.java | 96 openjdk-11-11.0.13+8/test/langtools/jdk/javadoc/tool/QuietOption.java | 15 openjdk-11-11.0.13+8/test/langtools/jdk/jshell/PasteAndMeasurementsUITest.java | 16 openjdk-11-11.0.13+8/test/langtools/jdk/jshell/ToolSimpleTest.java | 19 openjdk-11-11.0.13+8/test/langtools/jdk/jshell/UITesting.java | 3 openjdk-11-11.0.13+8/test/langtools/tools/javac/api/T6265137.java | 4 openjdk-11-11.0.13+8/test/langtools/tools/javac/file/MultiReleaseJar/MultiReleaseModuleInfoTest.java | 148 openjdk-11-11.0.13+8/test/langtools/tools/javac/file/MultiReleaseJar/MutliReleaseModuleInfoTest.java | 148 openjdk-11-11.0.13+8/test/langtools/tools/javac/lambda/8210495/T8210495.java | 66 openjdk-11-11.0.13+8/test/langtools/tools/javac/launcher/SourceLauncherTest.java | 14 openjdk-11-11.0.13+8/test/langtools/tools/javac/modules/AnnotationProcessing.java | 101 openjdk-11-11.0.13+8/test/langtools/tools/javac/processing/model/element/TestAnonClassNames.java | 15 openjdk-11-11.0.13+8/test/langtools/tools/javac/processing/model/element/TypeParamBounds.java | 20 openjdk-11-11.0.13+8/test/langtools/tools/javac/processing/warnings/LintProcessing/TestAnnotationsWithoutProcessors.java | 79 openjdk-11-11.0.13+8/test/langtools/tools/jdeps/DotFileTest.java | 19 openjdk-11-11.0.13+8/test/langtools/tools/jdeps/jdkinternals/RemovedJDKInternals.java | 66 openjdk-11-11.0.13+8/test/langtools/tools/lib/toolbox/ToolBox.java | 23 openjdk-11-11.0.13+8/test/lib/jdk/test/lib/NetworkConfiguration.java | 30 openjdk-11-11.0.13+8/test/lib/jdk/test/lib/Utils.java | 57 openjdk-11-11.0.13+8/test/lib/jdk/test/lib/apps/LingeredApp.java | 9 openjdk-11-11.0.13+8/test/lib/jdk/test/lib/cds/CDSTestUtils.java | 21 openjdk-11-11.0.13+8/test/lib/jdk/test/lib/security/KeyStoreUtils.java | 115 openjdk-11-11.0.13+8/test/lib/jtreg/SkippedException.java | 4 openjdk-11-11.0.13+8/test/micro/org/openjdk/bench/java/security/AlgorithmConstraintsPermits.java | 66 openjdk-11-11.0.13+8/test/nashorn/TEST.ROOT | 2 928 files changed, 35472 insertions(+), 15637 deletions(-) diff -Nru openjdk-11-11.0.12+7/.gitattributes openjdk-11-11.0.13+8/.gitattributes --- openjdk-11-11.0.12+7/.gitattributes 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/.gitattributes 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1 @@ +* -text diff -Nru openjdk-11-11.0.12+7/.github/workflows/submit.yml openjdk-11-11.0.13+8/.github/workflows/submit.yml --- openjdk-11-11.0.12+7/.github/workflows/submit.yml 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/.github/workflows/submit.yml 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1,1513 @@ +name: Pre-submit tests + +on: + push: + branches-ignore: + - master + - pr/* + workflow_dispatch: + inputs: + platforms: + description: "Platform(s) to execute on" + required: true + default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows x64, macOS x64" + +jobs: + prerequisites: + name: Prerequisites + runs-on: "ubuntu-20.04" + outputs: + should_run: ${{ steps.check_submit.outputs.should_run }} + bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }} + platform_linux_additional: ${{ steps.check_platforms.outputs.platform_linux_additional }} + platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }} + platform_linux_x86: ${{ steps.check_platforms.outputs.platform_linux_x86 }} + platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }} + platform_macos_x64: ${{ steps.check_platforms.outputs.platform_macos_x64 }} + dependencies: ${{ steps.check_deps.outputs.dependencies }} + + steps: + - name: Check if submit tests should actually run depending on secrets and manual triggering + id: check_submit + run: echo "::set-output name=should_run::${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}" + + - name: Check which platforms should be included + id: check_platforms + run: | + echo "::set-output name=platform_linux_additional::${{ contains(github.event.inputs.platforms, 'linux additional (hotspot only)') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux additional (hotspot only)'))) }}" + echo "::set-output name=platform_linux_x64::${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x64'))) }}" + echo "::set-output name=platform_linux_x86::${{ contains(github.event.inputs.platforms, 'linux x86') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x86'))) }}" + echo "::set-output name=platform_windows_x64::${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows x64'))) }}" + echo "::set-output name=platform_macos_x64::${{ contains(github.event.inputs.platforms, 'macos x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'macos x64'))) }}" + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine unique bundle identifier + id: check_bundle_id + run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}" + if: steps.check_submit.outputs.should_run != 'false' + + - name: Checkout the source + uses: actions/checkout@v2 + with: + path: jdk + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine versions and locations to be used for dependencies + id: check_deps + run: "echo ::set-output name=dependencies::`cat make/autoconf/version-numbers make/conf/test-dependencies | sed -e '1i {' -e 's/#.*//g' -e 's/\"//g' -e 's/\\(.*\\)=\\(.*\\)/\"\\1\": \"\\2\",/g' -e '$s/,\\s\\{0,\\}$/\\}/'`" + working-directory: jdk + if: steps.check_submit.outputs.should_run != 'false' + + - name: Print extracted dependencies to the log + run: "echo '${{ steps.check_deps.outputs.dependencies }}'" + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine the jtreg ref to checkout + run: "echo JTREG_REF=jtreg${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }} >> $GITHUB_ENV" + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine the jtreg version to build + run: echo "BUILD_VERSION=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}" >> $GITHUB_ENV + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine the jtreg build number to build + run: echo "BUILD_NUMBER=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }}" >> $GITHUB_ENV + if: steps.check_submit.outputs.should_run != 'false' + + - name: Check if a jtreg image is present in the cache + id: jtreg + uses: actions/cache@v2 + with: + path: ~/jtreg/ + key: jtreg-${{ env.JTREG_REF }}-v1 + if: steps.check_submit.outputs.should_run != 'false' + + - name: Checkout the jtreg source + uses: actions/checkout@v2 + with: + repository: "openjdk/jtreg" + ref: ${{ env.JTREG_REF }} + path: jtreg + if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' + + - name: Build jtreg + run: bash make/build-all.sh ${JAVA_HOME_8_X64} + working-directory: jtreg + if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' + + - name: Move jtreg image to destination folder + run: mv build/images/jtreg ~/ + working-directory: jtreg + if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' + + - name: Store jtreg for use by later steps + uses: actions/upload-artifact@v2 + with: + name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.check_submit.outputs.should_run != 'false' + + linux_x64_build: + name: Linux x64 + runs-on: "ubuntu-20.04" + needs: prerequisites + if: needs.prerequisites.outputs.should_run != 'false' && (needs.prerequisites.outputs.platform_linux_x64 != 'false' || needs.prerequisites.outputs.platform_linux_additional == 'true') + + strategy: + fail-fast: false + matrix: + flavor: + - build release + - build debug + include: + - flavor: build debug + flags: --enable-debug + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + with: + path: jdk + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Fix jtreg permissions + run: chmod -R a+rx ${HOME}/jtreg/ + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install gcc-9=9.3.0-17ubuntu1~20.04 g++-9=9.3.0-17ubuntu1~20.04 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + + - name: Configure + run: > + bash configure + --with-conf-name=linux-x64 + ${{ matrix.flags }} + --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA} + --with-version-build=0 + --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION} + --with-jtreg=${HOME}/jtreg + --with-default-make-target="product-bundles test-bundles" + --with-zlib=system + --with-jvm-features=shenandoahgc + --enable-jtreg-failure-handler + working-directory: jdk + + - name: Build + run: make CONF_NAME=linux-x64 + working-directory: jdk + + - name: Persist test bundles + uses: actions/upload-artifact@v2 + with: + name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: | + jdk/build/linux-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz + jdk/build/linux-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz + + linux_x64_test: + name: Linux x64 + runs-on: "ubuntu-20.04" + needs: + - prerequisites + - linux_x64_build + + strategy: + fail-fast: false + matrix: + test: + - jdk/tier1 part 1 + - jdk/tier1 part 2 + - jdk/tier1 part 3 + - langtools/tier1 + - hs/tier1 common + - hs/tier1 compiler + - hs/tier1 gc + - hs/tier1 runtime + - hs/tier1 serviceability + include: + - test: jdk/tier1 part 1 + suites: test/jdk/:tier1_part1 + - test: jdk/tier1 part 2 + suites: test/jdk/:tier1_part2 + - test: jdk/tier1 part 3 + suites: test/jdk/:tier1_part3 + - test: langtools/tier1 + suites: test/langtools/:tier1 + - test: hs/tier1 common + suites: test/hotspot/jtreg/:tier1_common + artifact: -debug + - test: hs/tier1 compiler + suites: test/hotspot/jtreg/:tier1_compiler + artifact: -debug + - test: hs/tier1 gc + suites: test/hotspot/jtreg/:tier1_gc + artifact: -debug + - test: hs/tier1 runtime + suites: test/hotspot/jtreg/:tier1_runtime + artifact: -debug + - test: hs/tier1 serviceability + suites: test/hotspot/jtreg/:tier1_serviceability + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Restore build artifacts + id: build_restore + uses: actions/download-artifact@v2 + with: + name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x64${{ matrix.artifact }} + continue-on-error: true + + - name: Restore build artifacts (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x64${{ matrix.artifact }} + if: steps.build_restore.outcome == 'failure' + + - name: Unpack jdk + run: | + mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}" + + - name: Unpack tests + run: | + mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}" + + - name: Find root of jdk image dir + run: | + imageroot=`find ${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }} -name release -type f` + echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV + + - name: Run tests + run: > + JDK_IMAGE_DIR=${{ env.imageroot }} + TEST_IMAGE_DIR=${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }} + BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION} + JT_HOME=${HOME}/jtreg + make run-test-prebuilt + CONF_NAME=run-test-prebuilt + LOG_CMDLINES=true + JTREG_VERBOSE=fail,error,time + TEST="${{ matrix.suites }}" + TEST_OPTS_JAVA_OPTIONS= + JTREG_KEYWORDS="!headful" + JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash" + + - name: Check that all tests executed successfully + if: always() + run: > + if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then + cat build/*/test-results/*/text/newfailures.txt ; + exit 1 ; + fi + + - name: Create suitable test log artifact name + if: always() + run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV + + - name: Package test results + if: always() + working-directory: build/run-test-prebuilt/test-results/ + run: > + zip -r9 + "$HOME/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip" + . + continue-on-error: true + + - name: Package test support + if: always() + working-directory: build/run-test-prebuilt/test-support/ + run: > + zip -r9 + "$HOME/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" + . + -i *.jtr + -i */hs_err*.log + -i */replay*.log + continue-on-error: true + + - name: Persist test results + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip + continue-on-error: true + + - name: Persist test outputs + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip + continue-on-error: true + + linux_additional_build: + name: Linux additional + runs-on: "ubuntu-20.04" + needs: + - prerequisites + - linux_x64_build + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_additional != 'false' + + strategy: + fail-fast: false + matrix: + flavor: + - hs x64 build only + - hs x64 zero build only + - hs x64 minimal build only + - hs x64 optimized build only + - hs aarch64 build only + - hs arm build only + - hs s390x build only + - hs ppc64le build only + include: + - flavor: hs x64 build only + flags: --enable-debug --disable-precompiled-headers + - flavor: hs x64 shenandoah build only + flags: --enable-debug --disable-precompiled-headers --with-jvm-features=shenandoahgc + - flavor: hs x64 zero build only + flags: --enable-debug --disable-precompiled-headers --with-jvm-variants=zero + - flavor: hs x64 minimal build only + flags: --enable-debug --disable-precompiled-headers --with-jvm-variants=minimal + - flavor: hs x64 optimized build only + flags: --with-debug-level=optimized --disable-precompiled-headers + - flavor: hs aarch64 build only + flags: --enable-debug --disable-precompiled-headers + debian-arch: arm64 + gnu-arch: aarch64 + - flavor: hs aarch64 shenandoah build only + flags: --enable-debug --disable-precompiled-headers --with-jvm-features=shenandoahgc + debian-arch: arm64 + gnu-arch: aarch64 + - flavor: hs arm build only + flags: --enable-debug --disable-precompiled-headers + debian-arch: armhf + gnu-arch: arm + gnu-flavor: eabihf + - flavor: hs s390x build only + flags: --enable-debug --disable-precompiled-headers + debian-arch: s390x + gnu-arch: s390x + - flavor: hs ppc64le build only + flags: --enable-debug --disable-precompiled-headers + debian-arch: ppc64el + gnu-arch: powerpc64le + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + with: + path: jdk + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore build JDK + id: build_restore + uses: actions/download-artifact@v2 + with: + name: transient_jdk-linux-x64_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x64 + continue-on-error: true + + - name: Restore build JDK (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jdk-linux-x64_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x64 + if: steps.build_restore.outcome == 'failure' + + - name: Unpack build JDK + run: | + mkdir -p "${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin" + tar -xf "${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin.tar.gz" -C "${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin" + + - name: Find root of build JDK image dir + run: | + build_jdk_root=`find ${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin -name release -type f` + echo "build_jdk_root=`dirname ${build_jdk_root}`" >> $GITHUB_ENV + + - name: Update apt + run: sudo apt-get update + + - name: Install native host dependencies + run: | + sudo apt-get install gcc-9=9.3.0-17ubuntu1~20.04 g++-9=9.3.0-17ubuntu1~20.04 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + if: matrix.debian-arch == '' + + - name: Install cross-compilation host dependencies + run: sudo apt-get install gcc-9-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}=9.3.0-17ubuntu1~20.04cross2 g++-9-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}=9.3.0-17ubuntu1~20.04cross2 + if: matrix.debian-arch != '' + + - name: Cache sysroot + id: cache-sysroot + uses: actions/cache@v2 + with: + path: ~/sysroot-${{ matrix.debian-arch }}/ + key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('jdk/.github/workflows/submit.yml') }} + if: matrix.debian-arch != '' + + - name: Install sysroot host dependencies + run: sudo apt-get install debootstrap qemu-user-static + if: matrix.debian-arch != '' && steps.cache-sysroot.outputs.cache-hit != 'true' + + - name: Create sysroot + run: > + sudo qemu-debootstrap + --arch=${{ matrix.debian-arch }} + --verbose + --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev + --resolve-deps + buster + ~/sysroot-${{ matrix.debian-arch }} + http://httpredir.debian.org/debian/ + if: matrix.debian-arch != '' && steps.cache-sysroot.outputs.cache-hit != 'true' + + - name: Prepare sysroot for caching + run: | + sudo chroot ~/sysroot-${{ matrix.debian-arch }} symlinks -cr . + sudo chown ${USER} -R ~/sysroot-${{ matrix.debian-arch }} + rm -rf ~/sysroot-${{ matrix.debian-arch }}/{dev,proc,run,sys} + if: matrix.debian-arch != '' && steps.cache-sysroot.outputs.cache-hit != 'true' + + - name: Configure cross compiler + run: | + echo "CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}-gcc-9" >> $GITHUB_ENV + echo "CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}-g++-9" >> $GITHUB_ENV + if: matrix.debian-arch != '' + + - name: Configure cross specific flags + run: > + echo "cross_flags= + --openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}} + --with-sysroot=${HOME}/sysroot-${{ matrix.debian-arch }}/ + " >> $GITHUB_ENV + if: matrix.debian-arch != '' + + - name: Configure + run: > + bash configure + --with-conf-name=linux-${{ matrix.gnu-arch }}-hotspot + ${{ matrix.flags }} + ${{ env.cross_flags }} + --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA} + --with-version-build=0 + --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION} + --with-build-jdk=${{ env.build_jdk_root }} + --with-default-make-target="hotspot" + --with-zlib=system + working-directory: jdk + + - name: Build + run: make CONF_NAME=linux-${{ matrix.gnu-arch }}-hotspot + working-directory: jdk + + linux_x86_build: + name: Linux x86 + runs-on: "ubuntu-20.04" + needs: prerequisites + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x86 != 'false' + + strategy: + fail-fast: false + matrix: + flavor: + - build release + - build debug + include: + - flavor: build debug + flags: --enable-debug + artifact: -debug + + # Reduced 32-bit build uses the same boot JDK as 64-bit build + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + with: + path: jdk + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Fix jtreg permissions + run: chmod -R a+rx ${HOME}/jtreg/ + + # Roll in the multilib environment and its dependencies. + # Some multilib libraries do not have proper inter-dependencies, so we have to + # install their dependencies manually. Additionally, upgrading apt solves + # the libc6 installation bugs until base image catches up, see JDK-8260460. + - name: Install dependencies + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install --only-upgrade apt + sudo apt-get install gcc-9-multilib g++-9-multilib libfreetype6-dev:i386 libxrandr-dev:i386 libxtst-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libcups2-dev:i386 libasound2-dev:i386 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + + - name: Configure + run: > + bash configure + --with-conf-name=linux-x86 + --with-target-bits=32 + ${{ matrix.flags }} + --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA} + --with-version-build=0 + --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION} + --with-jtreg=${HOME}/jtreg + --with-default-make-target="product-bundles test-bundles" + --with-zlib=system + --with-jvm-features=shenandoahgc + --enable-jtreg-failure-handler + working-directory: jdk + + - name: Build + run: make CONF_NAME=linux-x86 + working-directory: jdk + + - name: Persist test bundles + uses: actions/upload-artifact@v2 + with: + name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: | + jdk/build/linux-x86/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}.tar.gz + jdk/build/linux-x86/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}.tar.gz + + linux_x86_test: + name: Linux x86 + runs-on: "ubuntu-20.04" + needs: + - prerequisites + - linux_x86_build + + strategy: + fail-fast: false + matrix: + test: + - jdk/tier1 part 1 + - jdk/tier1 part 2 + - jdk/tier1 part 3 + - langtools/tier1 + - hs/tier1 common + - hs/tier1 compiler + - hs/tier1 gc + - hs/tier1 runtime + - hs/tier1 serviceability + include: + - test: jdk/tier1 part 1 + suites: test/jdk/:tier1_part1 + - test: jdk/tier1 part 2 + suites: test/jdk/:tier1_part2 + - test: jdk/tier1 part 3 + suites: test/jdk/:tier1_part3 + - test: langtools/tier1 + suites: test/langtools/:tier1 + - test: hs/tier1 common + suites: test/hotspot/jtreg/:tier1_common + artifact: -debug + - test: hs/tier1 compiler + suites: test/hotspot/jtreg/:tier1_compiler + artifact: -debug + - test: hs/tier1 gc + suites: test/hotspot/jtreg/:tier1_gc + artifact: -debug + - test: hs/tier1 runtime + suites: test/hotspot/jtreg/:tier1_runtime + artifact: -debug + - test: hs/tier1 serviceability + suites: test/hotspot/jtreg/:tier1_serviceability + artifact: -debug + + # Reduced 32-bit build uses the same boot JDK as 64-bit build + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Restore build artifacts + id: build_restore + uses: actions/download-artifact@v2 + with: + name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x86${{ matrix.artifact }} + continue-on-error: true + + - name: Restore build artifacts (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x86${{ matrix.artifact }} + if: steps.build_restore.outcome == 'failure' + + - name: Unpack jdk + run: | + mkdir -p "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}" + + - name: Unpack tests + run: | + mkdir -p "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}" + + - name: Find root of jdk image dir + run: | + imageroot=`find ${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }} -name release -type f` + echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV + + - name: Run tests + run: > + JDK_IMAGE_DIR=${{ env.imageroot }} + TEST_IMAGE_DIR=${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }} + BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION} + JT_HOME=${HOME}/jtreg + make run-test-prebuilt + CONF_NAME=run-test-prebuilt + LOG_CMDLINES=true + JTREG_VERBOSE=fail,error,time + TEST="${{ matrix.suites }}" + TEST_OPTS_JAVA_OPTIONS= + JTREG_KEYWORDS="!headful" + JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash" + + - name: Check that all tests executed successfully + if: always() + run: > + if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then + cat build/*/test-results/*/text/newfailures.txt ; + exit 1 ; + fi + + - name: Create suitable test log artifact name + if: always() + run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV + + - name: Package test results + if: always() + working-directory: build/run-test-prebuilt/test-results/ + run: > + zip -r9 + "$HOME/linux-x86${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip" + . + continue-on-error: true + + - name: Package test support + if: always() + working-directory: build/run-test-prebuilt/test-support/ + run: > + zip -r9 + "$HOME/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" + . + -i *.jtr + -i */hs_err*.log + -i */replay*.log + continue-on-error: true + + - name: Persist test results + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/linux-x86${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip + continue-on-error: true + + - name: Persist test outputs + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip + continue-on-error: true + + windows_x64_build: + name: Windows x64 + runs-on: "windows-2019" + needs: prerequisites + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_windows_x64 != 'false' + + strategy: + fail-fast: false + matrix: + flavor: + - build release + - build debug + include: + - flavor: build debug + flags: --enable-debug + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Restore cygwin packages from cache + id: cygwin + uses: actions/cache@v2 + with: + path: ~/cygwin/packages + key: cygwin-packages-${{ runner.os }}-v1 + + - name: Install cygwin + run: | + New-Item -Force -ItemType directory -Path "$HOME\cygwin" + & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe" + Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow + + - name: Checkout the source + uses: actions/checkout@v2 + with: + path: jdk + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION" + & curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" + $FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" + $FileHash.Hash -eq $env:BOOT_JDK_SHA256 + & tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION" + Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Ensure a specific version of MSVC is installed + run: > + Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -Wait -NoNewWindow -ArgumentList + 'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet + --add Microsoft.VisualStudio.Component.VC.14.28.x86.x64' + + - name: Configure + run: > + $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ; + $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ; + $env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ; + $env:JT_HOME = cygpath "$HOME/jtreg" ; + & bash configure + --with-conf-name=windows-x64 + --with-msvc-toolset-version=14.28 + ${{ matrix.flags }} + --with-version-opt="$env:GITHUB_ACTOR-$env:GITHUB_SHA" + --with-version-build=0 + --with-boot-jdk="$env:BOOT_JDK" + --with-jtreg="$env:JT_HOME" + --with-default-make-target="product-bundles test-bundles" + --with-jvm-features=shenandoahgc + --enable-jtreg-failure-handler + working-directory: jdk + + - name: Build + run: | + $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ; + $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ; + & make CONF_NAME=windows-x64 + working-directory: jdk + + - name: Persist test bundles + uses: actions/upload-artifact@v2 + with: + name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: | + jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}.zip + jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}.tar.gz + jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols.tar.gz + + windows_x64_test: + name: Windows x64 + runs-on: "windows-2019" + needs: + - prerequisites + - windows_x64_build + + strategy: + fail-fast: false + matrix: + test: + - jdk/tier1 part 1 + - jdk/tier1 part 2 + - jdk/tier1 part 3 + - langtools/tier1 + - hs/tier1 common + - hs/tier1 compiler + - hs/tier1 gc + - hs/tier1 runtime + - hs/tier1 serviceability + include: + - test: jdk/tier1 part 1 + suites: test/jdk/:tier1_part1 + - test: jdk/tier1 part 2 + suites: test/jdk/:tier1_part2 + - test: jdk/tier1 part 3 + suites: test/jdk/:tier1_part3 + - test: langtools/tier1 + suites: test/langtools/:tier1 + - test: hs/tier1 common + suites: test/hotspot/jtreg/:tier1_common + artifact: -debug + - test: hs/tier1 compiler + suites: test/hotspot/jtreg/:tier1_compiler + artifact: -debug + - test: hs/tier1 gc + suites: test/hotspot/jtreg/:tier1_gc + artifact: -debug + - test: hs/tier1 runtime + suites: test/hotspot/jtreg/:tier1_runtime + artifact: -debug + - test: hs/tier1 serviceability + suites: test/hotspot/jtreg/:tier1_serviceability + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION" + & curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" + $FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" + $FileHash.Hash -eq $env:BOOT_JDK_SHA256 + & tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION" + Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore cygwin packages from cache + id: cygwin + uses: actions/cache@v2 + with: + path: ~/cygwin/packages + key: cygwin-packages-${{ runner.os }}-v1 + + - name: Install cygwin + run: | + New-Item -Force -ItemType directory -Path "$HOME\cygwin" + & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe" + Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Restore build artifacts + id: build_restore + uses: actions/download-artifact@v2 + with: + name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-windows-x64${{ matrix.artifact }} + continue-on-error: true + + - name: Restore build artifacts (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-windows-x64${{ matrix.artifact }} + if: steps.build_restore.outcome == 'failure' + + - name: Unpack jdk + run: | + mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}.zip" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}" + + - name: Unpack symbols + run: | + mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols" + tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols.tar.gz" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols" + + - name: Unpack tests + run: | + mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}" + + - name: Find root of jdk image dir + run: echo ("imageroot=" + (Get-ChildItem -Path $HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }} -Filter release -Recurse -ErrorAction SilentlyContinue -Force).DirectoryName) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 + + - name: Run tests + run: > + $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ; + $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ; + $env:JDK_IMAGE_DIR = cygpath "${{ env.imageroot }}" ; + $env:SYMBOLS_IMAGE_DIR = cygpath "${{ env.imageroot }}" ; + $env:TEST_IMAGE_DIR = cygpath "$HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}" ; + $env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ; + $env:JT_HOME = cygpath "$HOME/jtreg" ; + & make run-test-prebuilt + CONF_NAME=run-test-prebuilt + LOG_CMDLINES=true + JTREG_VERBOSE=fail,error,time + TEST=${{ matrix.suites }} + TEST_OPTS_JAVA_OPTIONS= + JTREG_KEYWORDS="!headful" + JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash" + + - name: Check that all tests executed successfully + if: always() + run: > + if ((Get-ChildItem -Path build\*\test-results\test-summary.txt -Recurse | Select-String -Pattern "TEST SUCCESS" ).Count -eq 0) { + Get-Content -Path build\*\test-results\*\*\newfailures.txt ; + exit 1 + } + + - name: Create suitable test log artifact name + if: always() + run: echo ("logsuffix=" + ("${{ matrix.test }}" -replace "/", "_" -replace " ", "_")) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 + + - name: Package test results + if: always() + working-directory: build/run-test-prebuilt/test-results/ + run: > + $env:Path = "$HOME\cygwin\cygwin64\bin;$env:Path" ; + zip -r9 + "$HOME/windows-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip" + . + continue-on-error: true + + - name: Package test support + if: always() + working-directory: build/run-test-prebuilt/test-support/ + run: > + $env:Path = "$HOME\cygwin\cygwin64\bin;$env:Path" ; + zip -r9 + "$HOME/windows-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" + . + -i *.jtr + -i */hs_err*.log + -i */replay*.log + continue-on-error: true + + - name: Persist test results + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/windows-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip + continue-on-error: true + + - name: Persist test outputs + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/windows-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip + continue-on-error: true + + macos_x64_build: + name: macOS x64 + runs-on: "macos-10.15" + needs: prerequisites + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_macos_x64 != 'false' + + strategy: + fail-fast: false + matrix: + flavor: + - build release + - build debug + include: + - flavor: build release + - flavor: build debug + flags: --enable-debug + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + with: + path: jdk + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Fix jtreg permissions + run: chmod -R a+rx ${HOME}/jtreg/ + + - name: Install dependencies + run: brew install make + + - name: Select Xcode version + run: sudo xcode-select --switch /Applications/Xcode_11.3.1.app/Contents/Developer + + - name: Configure + run: > + bash configure + --with-conf-name=macos-x64 + ${{ matrix.flags }} + --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA} + --with-version-build=0 + --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home + --with-jtreg=${HOME}/jtreg + --with-default-make-target="product-bundles test-bundles" + --with-zlib=system + --with-jvm-features=shenandoahgc + --enable-jtreg-failure-handler + working-directory: jdk + + - name: Build + run: make CONF_NAME=macos-x64 + working-directory: jdk + + - name: Persist test bundles + uses: actions/upload-artifact@v2 + with: + name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: | + jdk/build/macos-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}.tar.gz + jdk/build/macos-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}.tar.gz + + macos_x64_test: + name: macOS x64 + runs-on: "macos-10.15" + needs: + - prerequisites + - macos_x64_build + + strategy: + fail-fast: false + matrix: + test: + - jdk/tier1 part 1 + - jdk/tier1 part 2 + - jdk/tier1 part 3 + - langtools/tier1 + - hs/tier1 common + - hs/tier1 compiler + - hs/tier1 gc + - hs/tier1 runtime + - hs/tier1 serviceability + include: + - test: jdk/tier1 part 1 + suites: test/jdk/:tier1_part1 + - test: jdk/tier1 part 2 + suites: test/jdk/:tier1_part2 + - test: jdk/tier1 part 3 + suites: test/jdk/:tier1_part3 + - test: langtools/tier1 + suites: test/langtools/:tier1 + - test: hs/tier1 common + suites: test/hotspot/jtreg/:tier1_common + artifact: -debug + - test: hs/tier1 compiler + suites: test/hotspot/jtreg/:tier1_compiler + artifact: -debug + - test: hs/tier1 gc + suites: test/hotspot/jtreg/:tier1_gc + artifact: -debug + - test: hs/tier1 runtime + suites: test/hotspot/jtreg/:tier1_runtime + artifact: -debug + - test: hs/tier1 serviceability + suites: test/hotspot/jtreg/:tier1_serviceability + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_INTERIM }}.${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_UPDATE }}" + BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}" + BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}" + BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}" + BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v2 + + - name: Restore boot JDK from cache + id: bootjdk + uses: actions/cache@v2 + with: + path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }} + key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1 + + - name: Download boot JDK + run: | + mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true + wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}" + echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null - + tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}" + mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/" + if: steps.bootjdk.outputs.cache-hit != 'true' + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Restore build artifacts + id: build_restore + uses: actions/download-artifact@v2 + with: + name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-macos-x64${{ matrix.artifact }} + continue-on-error: true + + - name: Restore build artifacts (retry) + uses: actions/download-artifact@v2 + with: + name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-macos-x64${{ matrix.artifact }} + if: steps.build_restore.outcome == 'failure' + + - name: Unpack jdk + run: | + mkdir -p "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }}" + + - name: Unpack tests + run: | + mkdir -p "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}" + tar -xf "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }}" + + - name: Install dependencies + run: brew install make + + - name: Select Xcode version + run: sudo xcode-select --switch /Applications/Xcode_11.3.1.app/Contents/Developer + + - name: Find root of jdk image dir + run: | + imageroot=`find ${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin${{ matrix.artifact }} -name release -type f` + echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV + + - name: Run tests + run: > + JDK_IMAGE_DIR=${{ env.imageroot }} + TEST_IMAGE_DIR=${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_osx-x64_bin-tests${{ matrix.artifact }} + BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home + JT_HOME=${HOME}/jtreg + gmake run-test-prebuilt + CONF_NAME=run-test-prebuilt + LOG_CMDLINES=true + JTREG_VERBOSE=fail,error,time + TEST=${{ matrix.suites }} + TEST_OPTS_JAVA_OPTIONS= + JTREG_KEYWORDS="!headful" + JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash" + + - name: Check that all tests executed successfully + if: always() + run: > + if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then + cat build/*/test-results/*/text/newfailures.txt ; + exit 1 ; + fi + + - name: Create suitable test log artifact name + if: always() + run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV + + - name: Package test results + if: always() + working-directory: build/run-test-prebuilt/test-results/ + run: > + zip -r9 + "$HOME/macos-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip" + . + continue-on-error: true + + - name: Package test support + if: always() + working-directory: build/run-test-prebuilt/test-support/ + run: > + zip -r9 + "$HOME/macos-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" + . + -i *.jtr + -i */hs_err*.log + -i */replay*.log + continue-on-error: true + + - name: Persist test results + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/macos-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip + continue-on-error: true + + - name: Persist test outputs + if: always() + uses: actions/upload-artifact@v2 + with: + path: ~/macos-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip + continue-on-error: true + + artifacts: + name: Post-process artifacts + runs-on: "ubuntu-20.04" + if: always() + continue-on-error: true + needs: + - prerequisites + - linux_additional_build + - linux_x64_test + - linux_x86_test + - windows_x64_test + - macos_x64_test + + steps: + - name: Determine current artifacts endpoint + id: actions_runtime + uses: actions/github-script@v3 + with: + script: "return { url: process.env['ACTIONS_RUNTIME_URL'], token: process.env['ACTIONS_RUNTIME_TOKEN'] }" + + - name: Display current artifacts + run: > + curl -s -H 'Accept: application/json;api-version=6.0-preview' + -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}' + '${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' + + - name: Delete transient artifacts + run: > + for url in ` + curl -s -H 'Accept: application/json;api-version=6.0-preview' + -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}' + '${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' | + jq -r -c '.value | map(select(.name|startswith("transient_"))) | .[].url'`; do + curl -s -H 'Accept: application/json;api-version=6.0-preview' + -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}' + -X DELETE "${url}"; + done + + - name: Fetch remaining artifacts (test results) + uses: actions/download-artifact@v2 + with: + path: test-results + + - name: Delete remaining artifacts + run: > + for url in ` + curl -s -H 'Accept: application/json;api-version=6.0-preview' + -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}' + '${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' | + jq -r -c '.value | .[].url'`; do + curl -s -H 'Accept: application/json;api-version=6.0-preview' + -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}' + -X DELETE "${url}"; + done + + - name: Upload a combined test results artifact + uses: actions/upload-artifact@v2 + with: + name: test-results_${{ needs.prerequisites.outputs.bundle_id }} + path: test-results diff -Nru openjdk-11-11.0.12+7/.hg_archival.txt openjdk-11-11.0.13+8/.hg_archival.txt --- openjdk-11-11.0.12+7/.hg_archival.txt 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/.hg_archival.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -repo: fd16c54261b32be1aaedd863b7e856801b7f8543 -node: f412f2537f1502a9697a9684c77bea8d848db1ab -branch: default -tag: jdk-11.0.12+7 -tag: jdk-11.0.12-ga diff -Nru openjdk-11-11.0.12+7/.hgtags openjdk-11-11.0.13+8/.hgtags --- openjdk-11-11.0.12+7/.hgtags 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/.hgtags 2021-10-12 20:42:15.000000000 +0000 @@ -648,3 +648,5 @@ 40d1e784e1937aaea696a9654cc2d944d3d78996 jdk-11.0.12+4 6aa6f6860508fca3a97aea1de7a36574498d22bf jdk-11.0.12+5 91e81ac088545abdc3eaaa707853d31a6cf99af3 jdk-11.0.12+6 +f412f2537f1502a9697a9684c77bea8d848db1ab jdk-11.0.12+7 +f412f2537f1502a9697a9684c77bea8d848db1ab jdk-11.0.12-ga diff -Nru openjdk-11-11.0.12+7/.jcheck/conf openjdk-11-11.0.13+8/.jcheck/conf --- openjdk-11-11.0.12+7/.jcheck/conf 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/.jcheck/conf 2021-10-12 20:42:15.000000000 +0000 @@ -1,2 +1,31 @@ -project=jdk10 -bugids=dup +[general] +project=jdk-updates +jbs=JDK +version=11.0.13 + +[checks] +error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace + +[repository] +tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d) +branches= + +[census] +version=0 +domain=openjdk.org + +[checks "whitespace"] +files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java + +[checks "merge"] +message=Merge + +[checks "reviewers"] +reviewers=1 +ignore=duke + +[checks "committer"] +role=committer + +[checks "issues"] +pattern=^([124-8][0-9]{6}): (\S.*)$ diff -Nru openjdk-11-11.0.12+7/debian/changelog openjdk-11-11.0.13+8/debian/changelog --- openjdk-11-11.0.12+7/debian/changelog 2021-07-21 07:03:54.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/changelog 2021-10-22 09:48:40.000000000 +0000 @@ -1,3 +1,42 @@ +openjdk-11 (11.0.13+8-1~deb11u1) bullseye-security; urgency=medium + + * Rebuild for bullseye + + -- Moritz Muehlenhoff Fri, 22 Oct 2021 09:48:40 +0000 + +openjdk-11 (11.0.13+8-1) unstable; urgency=medium + + * OpenJDK 11.0.13+8 build (release). + * Security fixes + - JDK-8163326, CVE-2021-35550: Update the default enabled cipher suites preference + - JDK-8254967, CVE-2021-35565: com.sun.net.HttpsServer spins on TLS session close + - JDK-8263314: Enhance XML Dsig modes + - JDK-8265167, CVE-2021-35556: Richer Text Editors + - JDK-8265574: Improve handling of sheets + - JDK-8265580, CVE-2021-35559: Enhanced style for RTF kit + - JDK-8265776: Improve Stream handling for SSL + - JDK-8266097, CVE-2021-35561: Better hashing support + - JDK-8266103: Better specified spec values + - JDK-8266109: More Resilient Classloading + - JDK-8266115: More Manifest Jar Loading + - JDK-8266137, CVE-2021-35564: Improve Keystore integrity + - JDK-8266689, CVE-2021-35567: More Constrained Delegation + - JDK-8267086: ArrayIndexOutOfBoundsException in java.security.KeyFactory.generatePublic + - JDK-8267712: Better LDAP reference processing + - JDK-8267729, CVE-2021-35578: Improve TLS client handshaking + - JDK-8267735, CVE-2021-35586: Better BMP support + - JDK-8268193: Improve requests of certificates + - JDK-8268199: Correct certificate requests + - JDK-8268205: Enhance DTLS client handshake + - JDK-8268506: More Manifest Digests + - JDK-8269618, CVE-2021-35603: Better session identification + - JDK-8269624: Enhance method selection support + - JDK-8270398: Enhance canonicalization + - JDK-8270404: Better canonicalization + * Remove patches applied upstream. + + -- Matthias Klose Wed, 20 Oct 2021 11:01:48 +0200 + openjdk-11 (11.0.12+7-2) unstable; urgency=high * OpenJDK 11.0.12+7 build (release). diff -Nru openjdk-11-11.0.12+7/debian/control openjdk-11-11.0.13+8/debian/control --- openjdk-11-11.0.12+7/debian/control 2021-07-21 05:09:12.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/control 2021-10-22 09:48:40.000000000 +0000 @@ -7,7 +7,7 @@ m4, lsb-release, zip, unzip, sharutils, gawk, cpio, pkg-config, procps, wdiff, fastjar (>= 2:0.96-0ubuntu2), time, strip-nondeterminism, debugedit (>= 4.16), - jtreg (>= 4.2-b13-0~) , testng , xvfb , xauth , xfonts-base , libgl1-mesa-dri [!x32] , xfwm4 , x11-xkb-utils , dbus-x11 , + jtreg (>= 5.1-b1-0~) , testng , xvfb , xauth , xfonts-base , libgl1-mesa-dri [!x32] , xfwm4 , x11-xkb-utils , dbus-x11 , autoconf, automake, autotools-dev, ant, ant-optional, g++-10 , openjdk-11-jdk-headless:native | openjdk-10-jdk-headless:native, diff -Nru openjdk-11-11.0.12+7/debian/patches/harfbuzz-cflags.diff openjdk-11-11.0.13+8/debian/patches/harfbuzz-cflags.diff --- openjdk-11-11.0.12+7/debian/patches/harfbuzz-cflags.diff 2021-07-21 05:09:12.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/patches/harfbuzz-cflags.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ ---- a/make/lib/Awt2dLibraries.gmk -+++ b/make/lib/Awt2dLibraries.gmk -@@ -645,7 +645,7 @@ LIBFONTMANAGER_EXTRA_HEADER_DIRS := \ - libawt/java2d/loops \ - # - --LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS) $(HARFBUZZ_FLAGS) -+LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS) $(HARFBUZZ_CFLAGS) - BUILD_LIBFONTMANAGER_FONTLIB += $(LIBHARFBUZZ_LIBS) $(LIBFREETYPE_LIBS) - - LIBFONTMANAGER_OPTIMIZATION := HIGH diff -Nru openjdk-11-11.0.12+7/debian/patches/hotspot-libpath.diff openjdk-11-11.0.13+8/debian/patches/hotspot-libpath.diff --- openjdk-11-11.0.12+7/debian/patches/hotspot-libpath.diff 2021-07-21 05:09:12.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/patches/hotspot-libpath.diff 2021-10-20 09:01:48.000000000 +0000 @@ -1,19 +1,31 @@ --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -411,10 +411,10 @@ void os::init_system_properties_values() +@@ -411,18 +411,22 @@ void os::init_system_properties_values() // 1: ... // ... // 7: The default directories, normally /lib and /usr/lib. --#if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390) -- #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" +#ifdef DEB_MULTIARCH +#define DEFAULT_LIBPATH "/usr/lib/" DEB_MULTIARCH "/jni" ":/lib/" DEB_MULTIARCH ":/usr/lib/" DEB_MULTIARCH ":/usr/lib/jni:/lib:/usr/lib" ++#else + #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390) +- #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" ++ #define DEFAULT_LIBPATH "/usr/lib64/jni:/usr/lib64:/lib64:/usr/lib/jni:/lib:/usr/lib" + #else + #if defined(AARCH64) + // Use 32-bit locations first for AARCH64 (a 64-bit architecture), since some systems + // might not adhere to the FHS and it would be a change in behaviour if we used + // DEFAULT_LIBPATH of other 64-bit architectures which prefer the 64-bit paths. +- #define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/lib64:/lib64" ++ #define DEFAULT_LIBPATH "/usr/lib/jni:/lib:/usr/lib:/usr/lib64/jni:/usr/lib64:/lib64" #else - #define DEFAULT_LIBPATH "/lib:/usr/lib" + #define DEFAULT_LIBPATH "/usr/lib/jni:/lib:/usr/lib" + #endif // AARCH64 #endif ++#endif // Base path of extensions installed on the system. + #define SYS_EXT_DIR "/usr/java/packages" --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -131,6 +131,11 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TAR diff -Nru openjdk-11-11.0.12+7/debian/patches/series openjdk-11-11.0.13+8/debian/patches/series --- openjdk-11-11.0.12+7/debian/patches/series 2021-07-21 05:09:12.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/patches/series 2021-10-20 09:01:48.000000000 +0000 @@ -43,6 +43,5 @@ reproducible-copyright-headers.diff reproducible-build-user.diff reproducible-build-jmod.diff -harfbuzz-cflags.diff 8222825.diff 8262085.diff diff -Nru openjdk-11-11.0.12+7/debian/rules openjdk-11-11.0.13+8/debian/rules --- openjdk-11-11.0.12+7/debian/rules 2021-07-21 07:03:54.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/rules 2021-10-20 09:01:48.000000000 +0000 @@ -1842,22 +1842,24 @@ is_release = yes hg_project = jdk11u hg_tag = jdk-11.0.12+7 -package_version = $(subst jdk-,,$(hg_tag)) +git_project = jdk11u +git_tag = jdk-11.0.13+8 +package_version = $(subst jdk-,,$(git_tag)) package_version = $(shell echo $(PKGVERSION) | sed 's/-[^-][^-]*$$//') ifneq ($(is_release),yes) package_version := $(subst +,~,$(package_version)) endif -hg_url = http://hg.openjdk.java.net/jdk-updates/$(hg_project) +git_url = https://github.com/openjdk/$(git_project) origdir = ../$(basename)-$(package_version).orig topdir = $(basename)-$(package_version) get-orig: mkdir $(origdir) - wget -O $(origdir)/jdk.tar.bz2 $(hg_url)/archive/$(hg_tag).tar.bz2 + wget -O $(origdir)/jdk.tar.gz $(git_url)/archive/$(git_tag).tar.gz set -ex; \ repo=jdk; \ - d=$$(tar tf $(origdir)/$$repo.tar.bz2 | head -1 | sed 's,/.*,,'); \ - tar xf $(origdir)/$$repo.tar.bz2; \ + d=$$(tar tf $(origdir)/$$repo.tar.gz | head -1 | sed 's,/.*,,'); \ + tar xf $(origdir)/$$repo.tar.gz; \ chmod 755 $$d/configure; \ case $$repo in jdk) \ rm -v -rf $$d/src/java.base/share/native/libzip/zlib; \ @@ -1869,6 +1871,8 @@ rm -v -f $$d/src/java.desktop/share/native/liblcms/cms*.c; \ rm -v -f $$d/src/java.desktop/share/native/liblcms/lcms2*.h; \ rm -v -rf $$d/src/java.smartcardio/unix/native/libj2pcsc/MUSCLE; \ + rm -v -rf $$d/.github; \ + rm -v -f $$d/.gitattributes; \ esac; \ mv $$d $(topdir); \ tar cfJ ../$(basename)_$(package_version).orig.tar.xz $(topdir); \ diff -Nru openjdk-11-11.0.12+7/debian/tests/control openjdk-11-11.0.13+8/debian/tests/control --- openjdk-11-11.0.12+7/debian/tests/control 2021-07-21 05:09:12.000000000 +0000 +++ openjdk-11-11.0.13+8/debian/tests/control 2021-10-22 09:48:40.000000000 +0000 @@ -7,9 +7,9 @@ Restrictions: superficial #Tests: hotspot, jaxp, langtools -#Depends: @, default-jre-headless, jtreg:native (>= 4.2-b13-0~), testng:native, build-essential +#Depends: @, default-jre-headless, jtreg:native (>= 5.1-b1-0~), testng:native, build-essential #Restrictions: allow-stderr, skippable, flaky #Tests: jdk -#Depends: @, default-jre-headless, jtreg:native (>= 4.2-b13-0~), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11 +#Depends: @, default-jre-headless, jtreg:native (>= 5.1-b1-0~), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11 #Restrictions: allow-stderr, skippable, flaky diff -Nru openjdk-11-11.0.12+7/doc/building.html openjdk-11-11.0.13+8/doc/building.html --- openjdk-11-11.0.12+7/doc/building.html 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/doc/building.html 2021-10-12 20:42:15.000000000 +0000 @@ -93,12 +93,10 @@
  • Getting Help
  • Hints and Suggestions for Advanced Users
  • Understanding the Build System

    TL;DR (Instructions for the Impatient)

    -

    If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Mercurial (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.

    +

    If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Git (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.

    1. Get the complete source code:
      -hg clone http://hg.openjdk.java.net/jdk/jdk

    2. +git clone https://git.openjdk.java.net/jdk/

    3. Run configure:
      bash configure

      If configure fails due to missing dependencies (to either the toolchain, build tools, external libraries or the boot JDK), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running bash configure again.

    4. @@ -131,8 +129,8 @@

      The JDK is a complex software project. Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware.

      If you just want to use the JDK and not build it yourself, this document is not for you. See for instance OpenJDK installation for some methods of installing a prebuilt JDK.

      Getting the Source Code

      -

      Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the OpenJDK Mercurial server you can see a list of all available forests. If you want to build an older version, e.g. JDK 8, it is recommended that you get the jdk8u forest, which contains incremental updates, instead of the jdk8 forest, which was frozen at JDK 8 GA.

      -

      If you are new to Mercurial, a good place to start is the Mercurial Beginner's Guide. The rest of this document assumes a working knowledge of Mercurial.

      +

      Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the OpenJDK Git site you can see a list of all available repositories. If you want to build an older version, e.g. JDK 8, it is recommended that you get the jdk8u forest, which contains incremental updates, instead of the jdk8 forest, which was frozen at JDK 8 GA.

      +

      If you are new to Git, a good place to start is the book Pro Git. The rest of this document assumes a working knowledge of Git.

      Special Considerations

      For a smooth building experience, it is recommended that you follow these rules on where and how to check out the source code.

        @@ -143,7 +141,11 @@
        • Create the directory that is going to contain the top directory of the JDK clone by using the mkdir command in the Cygwin bash shell. That is, do not create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it's children will inherit those attributes.

        • Do not put the JDK clone in a path under your Cygwin home directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters.

        • -
        • Clone the JDK repository using the Cygwin command line hg client as instructed in this document. That is, do not use another Mercurial client such as TortoiseHg.

        • +
        • You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice.

          +
            +
          • The Cygwin git client has no line ending issues and understands Cygwin paths (which are used throughout the JDK build system). However, it does not currently work well with the Skara CLI tooling. Please see the Skara wiki on Git clients for up-to-date information about the Skara git client support.

          • +
          • The Git for Windows client has issues with line endings, and do not understand Cygwin paths. It does work well with the Skara CLI tooling, however. To alleviate the line ending problems, make sure you set core.autocrlf to false (this is asked during installation).

          • +

        Failure to follow this procedure might result in hard-to-debug build problems.

      @@ -193,7 +195,7 @@

      Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.

      On Windows, it is important that you pay attention to the instructions in the Special Considerations.

      Windows is the only non-POSIX OS supported by the JDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. Currently, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require effort to implement.)

      -

      Internally in the build system, all paths are represented as Unix-style paths, e.g. /cygdrive/c/hg/jdk9/Makefile rather than C:\hg\jdk9\Makefile. This rule also applies to input to the build system, e.g. in arguments to configure. So, use --with-msvcr-dll=/cygdrive/c/msvcr100.dll rather than --with-msvcr-dll=c:\msvcr100.dll. For details on this conversion, see the section on Fixpath.

      +

      Internally in the build system, all paths are represented as Unix-style paths, e.g. /cygdrive/c/git/jdk/Makefile rather than C:\git\jdk\Makefile. This rule also applies to input to the build system, e.g. in arguments to configure. So, use --with-msvcr-dll=/cygdrive/c/msvcr100.dll rather than --with-msvcr-dll=c:\msvcr100.dll. For details on this conversion, see the section on Fixpath.

      Cygwin

      A functioning Cygwin environment is thus required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.

      Note: Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the JDK build process, and that can cause unexpected build problems.

      @@ -355,7 +357,7 @@ $ CC -V CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30

      Microsoft Visual Studio

      -

      The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by configure. The maximum accepted version of Visual Studio is 2017. Versions older than 2017 are unlikely to continue working for long.

      +

      The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by configure. The maximum accepted version of Visual Studio is 2019. Versions older than 2017 are unlikely to continue working for long.

      If you have multiple versions of Visual Studio installed, configure will by default pick the latest. You can request a specific version to be used by setting --with-toolchain-version, e.g. --with-toolchain-version=2015.

      If you get LINK: fatal error LNK1123: failure during conversion to COFF: file invalid when building using Visual Studio 2010, you have encountered KB2757355, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See this stackoverflow discussion for other suggestions.

      IBM XL C/C++

      @@ -577,27 +579,27 @@ - + - + - + - + - + - + - +
      Supported devkit targetsSupported devkit targets
      x86_64-linux-gnux86_64-linux-gnu
      aarch64-linux-gnuaarch64-linux-gnu
      arm-linux-gnueabihfarm-linux-gnueabihf
      ppc64-linux-gnuppc64-linux-gnu
      ppc64le-linux-gnuppc64le-linux-gnu
      s390x-linux-gnus390x-linux-gnu
      @@ -700,8 +702,8 @@ Target CC CXX ---arch=... ---openjdk-target=... +--arch=... +--openjdk-target=... @@ -709,36 +711,36 @@ x86 default default -i386 -i386-linux-gnu +i386 +i386-linux-gnu armhf gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -armhf -arm-linux-gnueabihf +armhf +arm-linux-gnueabihf aarch64 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -arm64 -aarch64-linux-gnu +arm64 +aarch64-linux-gnu ppc64el gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu -ppc64el -powerpc64le-linux-gnu +ppc64el +powerpc64le-linux-gnu s390x gcc-s390x-linux-gnu g++-s390x-linux-gnu -s390x -s390x-linux-gnu +s390x +s390x-linux-gnu @@ -789,14 +791,14 @@ === Output from failing command(s) repeated here === * For target hotspot_variant-server_libjvm_objs_psMemoryPool.o: -/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type +/localhome/git/jdk-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type ... (rest of output omitted) -* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs. +* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs. === End of repeated output === === Make failed targets repeated here === -lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed +lib/CompileJvm.gmk:207: recipe for target '/localhome/git/jdk-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed === End of repeated output === @@ -819,11 +821,11 @@

      Verify that the summary at the end looks correct. Are you indeed using the Boot JDK and native toolchain that you expect?

      By default, the JDK has a strict approach where warnings from the compiler is considered errors which fail the build. For very new or very old compiler versions, this can trigger new classes of warnings, which thus fails the build. Run configure with --disable-warnings-as-errors to turn of this behavior. (The warnings will still show, but not make the build fail.)

      Problems with Incremental Rebuilds

      -

      Incremental rebuilds mean that when you modify part of the product, only the affected parts get rebuilt. While this works great in most cases, and significantly speed up the development process, from time to time complex interdependencies will result in an incorrect build result. This is the most common cause for unexpected build problems, together with inconsistencies between the different Mercurial repositories in the forest.

      +

      Incremental rebuilds mean that when you modify part of the product, only the affected parts get rebuilt. While this works great in most cases, and significantly speed up the development process, from time to time complex interdependencies will result in an incorrect build result. This is the most common cause for unexpected build problems.

      Here are a suggested list of things to try if you are having unexpected build problems. Each step requires more time than the one before, so try them in order. Most issues will be solved at step 1 or 2.

        -
      1. Make sure your forest is up-to-date

        -

        Run bash get_source.sh to make sure you have the latest version of all repositories.

      2. +
      3. Make sure your repository is up-to-date

        +

        Run git pull origin master to make sure you have the latest changes.

      4. Clean build results

        The simplest way to fix incremental rebuild issues is to run make clean. This will remove all build results, but not the configuration or any build system support artifacts. In most cases, this will solve build errors resulting from incremental build mismatches.

      5. Completely clean the build directory.

        @@ -832,8 +834,8 @@ make dist-clean bash configure $(cat current-configuration) make
      6. -
      7. Re-clone the Mercurial forest

        -

        Sometimes the Mercurial repositories themselves gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire forest, and re-clone it. If you have local changes, save them first to a different location using hg export.

      8. +
      9. Re-clone the Git repository

        +

        Sometimes the Git repository gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire repository, and re-clone it. If you have local changes, save them first to a different location using git format-patch.

      Specific Build Issues

      Clock Skew

      @@ -852,28 +854,9 @@ spawn failed

      This can be a sign of a Cygwin problem. See the information about solving problems in the Cygwin section. Rebooting the computer might help temporarily.

      Getting Help

      -

      If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to . Please include the relevant parts of the configure and/or build log.

      +

      If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to build-dev@openjdk.java.net. Please include the relevant parts of the configure and/or build log.

      If you need general help or advice about developing for the JDK, you can also contact the Adoption Group. See the section on Contributing to OpenJDK for more information.

      Hints and Suggestions for Advanced Users

      -

      Setting Up a Forest for Pushing Changes (defpath)

      -

      To help you prepare a proper push path for a Mercurial repository, there exists a useful tool known as defpath. It will help you setup a proper push path for pushing changes to the JDK.

      -

      Install the extension by cloning http://hg.openjdk.java.net/code-tools/defpath and updating your .hgrc file. Here's one way to do this:

      -
      cd ~
      -mkdir hg-ext
      -cd hg-ext
      -hg clone http://hg.openjdk.java.net/code-tools/defpath
      -cat << EOT >> ~/.hgrc
      -[extensions]
      -defpath=~/hg-ext/defpath/defpath.py
      -EOT
      -

      You can now setup a proper push path using:

      -
      hg defpath -d -u <your OpenJDK username>
      -

      If you also have the trees extension installed in Mercurial, you will automatically get a tdefpath command, which is even more useful. By running hg tdefpath -du <username> in the top repository of your forest, all repos will get setup automatically. This is the recommended usage.

      Bash Completion

      The configure and make commands tries to play nice with bash command-line completion (using <tab> or <tab><tab>). To use this functionality, make sure you enable completion in your ~/.bashrc (see instructions for bash in your operating system).

      Make completion will work out of the box, and will complete valid make targets. For instance, typing make jdk-i<tab> will complete to make jdk-image.

      @@ -927,14 +910,6 @@

      Rebuilding Part of java.base (JDK_FILTER)

      If you are modifying files in java.base, which is the by far largest module in the JDK, then you need to rebuild all those files whenever a single file has changed. (This inefficiency will hopefully be addressed in JDK 10.)

      As a hack, you can use the make control variable JDK_FILTER to specify a pattern that will be used to limit the set of files being recompiled. For instance, make java.base JDK_FILTER=javax/crypto (or, to combine methods, make java.base-java-only JDK_FILTER=javax/crypto) will limit the compilation to files in the javax.crypto package.

      -

      Learn About Mercurial

      -

      To become an efficient JDK developer, it is recommended that you invest in learning Mercurial properly. Here are some links that can get you started:

      -

      Understanding the Build System

      This section will give you a more technical description on the details of the build system.

      Configurations

      diff -Nru openjdk-11-11.0.12+7/doc/building.md openjdk-11-11.0.13+8/doc/building.md --- openjdk-11-11.0.12+7/doc/building.md 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/doc/building.md 2021-10-12 20:42:15.000000000 +0000 @@ -3,11 +3,11 @@ ## TL;DR (Instructions for the Impatient) If you are eager to try out building the JDK, these simple steps works most of -the time. They assume that you have installed Mercurial (and Cygwin if running +the time. They assume that you have installed Git (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build. 1. [Get the complete source code](#getting-the-source-code): \ - `hg clone http://hg.openjdk.java.net/jdk/jdk` + `git clone https://git.openjdk.java.net/jdk/` 2. [Run configure](#running-configure): \ `bash configure` @@ -47,14 +47,14 @@ Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single -repository. At the [OpenJDK Mercurial server](http://hg.openjdk.java.net/) you -can see a list of all available forests. If you want to build an older version, +repository. At the [OpenJDK Git site](https://git.openjdk.java.net/) you +can see a list of all available repositories. If you want to build an older version, e.g. JDK 8, it is recommended that you get the `jdk8u` forest, which contains incremental updates, instead of the `jdk8` forest, which was frozen at JDK 8 GA. -If you are new to Mercurial, a good place to start is the [Mercurial Beginner's -Guide](http://www.mercurial-scm.org/guide). The rest of this document assumes a -working knowledge of Mercurial. +If you are new to Git, a good place to start is the book [Pro +Git](https://git-scm.com/book/en/v2). The rest of this document +assumes a working knowledge of Git. ### Special Considerations @@ -89,9 +89,21 @@ directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters. - * Clone the JDK repository using the Cygwin command line `hg` client - as instructed in this document. That is, do *not* use another Mercurial - client such as TortoiseHg. + * You need to install a git client. You have two choices, Cygwin git or + Git for Windows. Unfortunately there are pros and cons with each choice. + + * The Cygwin `git` client has no line ending issues and understands + Cygwin paths (which are used throughout the JDK build system). + However, it does not currently work well with the Skara CLI tooling. + Please see the [Skara wiki on Git clients]( + https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git) for + up-to-date information about the Skara git client support. + + * The [Git for Windows](https://gitforwindows.org) client has issues + with line endings, and do not understand Cygwin paths. It does work + well with the Skara CLI tooling, however. To alleviate the line ending + problems, make sure you set `core.autocrlf` to `false` (this is asked + during installation). Failure to follow this procedure might result in hard-to-debug build problems. @@ -171,7 +183,7 @@ require effort to implement.) Internally in the build system, all paths are represented as Unix-style paths, -e.g. `/cygdrive/c/hg/jdk9/Makefile` rather than `C:\hg\jdk9\Makefile`. This +e.g. `/cygdrive/c/git/jdk/Makefile` rather than `C:\git\jdk\Makefile`. This rule also applies to input to the build system, e.g. in arguments to `configure`. So, use `--with-msvcr-dll=/cygdrive/c/msvcr100.dll` rather than `--with-msvcr-dll=c:\msvcr100.dll`. For details on this conversion, see the section @@ -371,7 +383,7 @@ The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by `configure`. The maximum accepted version of Visual Studio is -2017. Versions older than 2017 are unlikely to continue working for long. +2019. Versions older than 2017 are unlikely to continue working for long. If you have multiple versions of Visual Studio installed, `configure` will by default pick the latest. You can request a specific version to be used by @@ -1261,14 +1273,14 @@ === Output from failing command(s) repeated here === * For target hotspot_variant-server_libjvm_objs_psMemoryPool.o: -/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type +/localhome/git/jdk-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type ... (rest of output omitted) -* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs. +* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs. === End of repeated output === === Make failed targets repeated here === -lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed +lib/CompileJvm.gmk:207: recipe for target '/localhome/git/jdk-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed === End of repeated output === @@ -1358,17 +1370,15 @@ affected parts get rebuilt. While this works great in most cases, and significantly speed up the development process, from time to time complex interdependencies will result in an incorrect build result. This is the most -common cause for unexpected build problems, together with inconsistencies -between the different Mercurial repositories in the forest. +common cause for unexpected build problems. Here are a suggested list of things to try if you are having unexpected build problems. Each step requires more time than the one before, so try them in order. Most issues will be solved at step 1 or 2. - 1. Make sure your forest is up-to-date + 1. Make sure your repository is up-to-date - Run `bash get_source.sh` to make sure you have the latest version of all - repositories. + Run `git pull origin master` to make sure you have the latest changes. 2. Clean build results @@ -1393,13 +1403,13 @@ make ``` - 4. Re-clone the Mercurial forest + 4. Re-clone the Git repository - Sometimes the Mercurial repositories themselves gets in a state that causes - the product to be un-buildable. In such a case, the simplest solution is - often the "sledgehammer approach": delete the entire forest, and re-clone - it. If you have local changes, save them first to a different location - using `hg export`. + Sometimes the Git repository gets in a state that causes the product + to be un-buildable. In such a case, the simplest solution is often the + "sledgehammer approach": delete the entire repository, and re-clone it. + If you have local changes, save them first to a different location using + `git format-patch`. ### Specific Build Issues @@ -1450,38 +1460,6 @@ ## Hints and Suggestions for Advanced Users -### Setting Up a Forest for Pushing Changes (defpath) - -To help you prepare a proper push path for a Mercurial repository, there exists -a useful tool known as [defpath]( -http://openjdk.java.net/projects/code-tools/defpath). It will help you setup a -proper push path for pushing changes to the JDK. - -Install the extension by cloning -`http://hg.openjdk.java.net/code-tools/defpath` and updating your `.hgrc` file. -Here's one way to do this: - -``` -cd ~ -mkdir hg-ext -cd hg-ext -hg clone http://hg.openjdk.java.net/code-tools/defpath -cat << EOT >> ~/.hgrc -[extensions] -defpath=~/hg-ext/defpath/defpath.py -EOT -``` - -You can now setup a proper push path using: -``` -hg defpath -d -u -``` - -If you also have the `trees` extension installed in Mercurial, you will -automatically get a `tdefpath` command, which is even more useful. By running -`hg tdefpath -du ` in the top repository of your forest, all repos -will get setup automatically. This is the recommended usage. - ### Bash Completion The `configure` and `make` commands tries to play nice with bash command-line @@ -1624,16 +1602,6 @@ `make java.base-java-only JDK_FILTER=javax/crypto`) will limit the compilation to files in the `javax.crypto` package. -### Learn About Mercurial - -To become an efficient JDK developer, it is recommended that you invest in -learning Mercurial properly. Here are some links that can get you started: - - * [Mercurial for git users](http://www.mercurial-scm.org/wiki/GitConcepts) - * [The official Mercurial tutorial](http://www.mercurial-scm.org/wiki/Tutorial) - * [hg init](http://hginit.com/) - * [Mercurial: The Definitive Guide](http://hgbook.red-bean.com/read/) - ## Understanding the Build System This section will give you a more technical description on the details of the diff -Nru openjdk-11-11.0.12+7/make/autoconf/flags-other.m4 openjdk-11-11.0.13+8/make/autoconf/flags-other.m4 --- openjdk-11-11.0.12+7/make/autoconf/flags-other.m4 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/autoconf/flags-other.m4 2021-10-12 20:42:15.000000000 +0000 @@ -110,11 +110,11 @@ # Fix linker warning. # Code taken from make/autoconf/flags-cflags.m4 and adapted. - JVM_BASIC_ASFLAGS+="-DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \ + JVM_BASIC_ASFLAGS+=" -DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \ -mmacosx-version-min=$MACOSX_VERSION_MIN" if test -n "$MACOSX_VERSION_MAX"; then - JVM_BASIC_ASFLAGS+="$OS_CFLAGS \ + JVM_BASIC_ASFLAGS+=" $OS_CFLAGS \ -DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS" fi fi diff -Nru openjdk-11-11.0.12+7/make/autoconf/lib-freetype.m4 openjdk-11-11.0.13+8/make/autoconf/lib-freetype.m4 --- openjdk-11-11.0.12+7/make/autoconf/lib-freetype.m4 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/autoconf/lib-freetype.m4 2021-10-12 20:42:15.000000000 +0000 @@ -173,6 +173,16 @@ FREETYPE_BASE_DIR="$SYSROOT/usr" LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + if test "x$FOUND_FREETYPE" != "xyes" ; then + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], + [$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI], [well-known location]) + fi + + if test "x$FOUND_FREETYPE" != "xyes" ; then + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], + [$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI], [well-known location]) + fi + if (test "x$FOUND_FREETYPE" != "xyes"); then FREETYPE_BASE_DIR="$SYSROOT/usr/X11" LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) diff -Nru openjdk-11-11.0.12+7/make/autoconf/lib-x11.m4 openjdk-11-11.0.13+8/make/autoconf/lib-x11.m4 --- openjdk-11-11.0.12+7/make/autoconf/lib-x11.m4 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/autoconf/lib-x11.m4 2021-10-12 20:42:15.000000000 +0000 @@ -68,6 +68,10 @@ x_libraries="$SYSROOT/usr/lib64" elif test -f "$SYSROOT/usr/lib/libX11.so"; then x_libraries="$SYSROOT/usr/lib" + elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then + x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so" + elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then + x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so" fi fi fi diff -Nru openjdk-11-11.0.12+7/make/autoconf/platform.m4 openjdk-11-11.0.13+8/make/autoconf/platform.m4 --- openjdk-11-11.0.12+7/make/autoconf/platform.m4 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/autoconf/platform.m4 2021-10-12 20:42:15.000000000 +0000 @@ -196,6 +196,33 @@ esac ]) +# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. +# Converts autoconf style OS name to OpenJDK style, into +# VAR_ABI. +AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_ABI], +[ + case "$1" in + *linux*-musl) + VAR_ABI=musl + ;; + *linux*-gnu) + VAR_ABI=gnu + ;; + *linux*-gnueabi) + VAR_ABI=gnueabi + ;; + *linux*-gnueabihf) + VAR_ABI=gnueabihf + ;; + *linux*-gnuabi64) + VAR_ABI=gnuabi64 + ;; + *) + VAR_ABI=default + ;; + esac +]) + # Expects $host_os $host_cpu $build_os and $build_cpu # and $with_target_bits to have been setup! # @@ -216,6 +243,7 @@ # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. PLATFORM_EXTRACT_VARS_FROM_OS($build_os) PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) + PLATFORM_EXTRACT_VARS_FROM_ABI($build_os) # ..and setup our own variables. (Do this explicitly to facilitate searching) OPENJDK_BUILD_OS="$VAR_OS" if test "x$VAR_OS_TYPE" != x; then @@ -232,6 +260,8 @@ OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" + OPENJDK_BUILD_CPU_AUTOCONF="$build_cpu" + OPENJDK_BUILD_ABI="$VAR_ABI" AC_SUBST(OPENJDK_BUILD_OS) AC_SUBST(OPENJDK_BUILD_OS_TYPE) AC_SUBST(OPENJDK_BUILD_OS_ENV) @@ -239,6 +269,8 @@ AC_SUBST(OPENJDK_BUILD_CPU_ARCH) AC_SUBST(OPENJDK_BUILD_CPU_BITS) AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) + AC_SUBST(OPENJDK_BUILD_CPU_AUTOCONF) + AC_SUBST(OPENJDK_BUILD_ABI) AC_MSG_CHECKING([openjdk-build os-cpu]) AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) @@ -246,6 +278,7 @@ # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. PLATFORM_EXTRACT_VARS_FROM_OS($host_os) PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) + PLATFORM_EXTRACT_VARS_FROM_ABI($host_os) # ... and setup our own variables. (Do this explicitly to facilitate searching) OPENJDK_TARGET_OS="$VAR_OS" if test "x$VAR_OS_TYPE" != x; then @@ -262,7 +295,9 @@ OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" + OPENJDK_TARGET_CPU_AUTOCONF="$host_cpu" OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + OPENJDK_TARGET_ABI="$VAR_ABI" AC_SUBST(OPENJDK_TARGET_OS) AC_SUBST(OPENJDK_TARGET_OS_TYPE) @@ -272,6 +307,8 @@ AC_SUBST(OPENJDK_TARGET_CPU_ARCH) AC_SUBST(OPENJDK_TARGET_CPU_BITS) AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) + AC_SUBST(OPENJDK_TARGET_CPU_AUTOCONF) + AC_SUBST(OPENJDK_TARGET_ABI) AC_MSG_CHECKING([openjdk-target os-cpu]) AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) diff -Nru openjdk-11-11.0.12+7/make/autoconf/toolchain_windows.m4 openjdk-11-11.0.13+8/make/autoconf/toolchain_windows.m4 --- openjdk-11-11.0.12+7/make/autoconf/toolchain_windows.m4 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/autoconf/toolchain_windows.m4 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 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 @@ -25,7 +25,7 @@ ################################################################################ # The order of these defines the priority by which we try to find them. -VALID_VS_VERSIONS="2017 2013 2015 2012 2010" +VALID_VS_VERSIONS="2017 2019 2013 2015 2012 2010" VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" VS_VERSION_INTERNAL_2010=100 @@ -87,6 +87,21 @@ VS_VS_PLATFORM_NAME_2017="v141" VS_SDK_PLATFORM_NAME_2017= VS_SUPPORTED_2017=true +VS_TOOLSET_SUPPORTED_2017=true + +VS_DESCRIPTION_2019="Microsoft Visual Studio 2019" +VS_VERSION_INTERNAL_2019=141 +VS_MSVCR_2019=vcruntime140.dll +VS_MSVCP_2019=msvcp140.dll +VS_ENVVAR_2019="VS160COMNTOOLS" +VS_USE_UCRT_2019="true" +VS_VS_INSTALLDIR_2019="Microsoft Visual Studio/2019" +VS_EDITIONS_2019="BuildTools Community Professional Enterprise" +VS_SDK_INSTALLDIR_2019= +VS_VS_PLATFORM_NAME_2019="v142" +VS_SDK_PLATFORM_NAME_2019= +VS_SUPPORTED_2019=false +VS_TOOLSET_SUPPORTED_2019=false ################################################################################ @@ -98,7 +113,7 @@ METHOD="$3" BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE) - # In VS 2017, the default installation is in a subdir named after the edition. + # In VS 2017 and VS 2019, the default installation is in a subdir named after the edition. # Find the first one present and use that. if test "x$VS_EDITIONS" != x; then for edition in $VS_EDITIONS; do @@ -177,6 +192,15 @@ # build environment and assigns it to VS_ENV_CMD AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], [ + # VS2017 provides the option to install previous minor versions of the MSVC + # toolsets. It is not possible to directly download earlier minor versions of + # VS2017 and in order to build with a previous minor compiler toolset version, + # it is now possible to compile with earlier minor versions by passing + # -vcvars_ver= argument to vcvarsall.bat. + AC_ARG_WITH(msvc-toolset-version, [AS_HELP_STRING([--with-msvc-toolset-version], + [specific MSVC toolset version to use, passed as -vcvars_ver argument to + pass to vcvarsall.bat (Windows only)])]) + VS_VERSION="$1" eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" @@ -184,6 +208,7 @@ eval VS_EDITIONS="\${VS_EDITIONS_${VS_VERSION}}" eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" eval VS_ENV_ARGS="\${VS_ENV_ARGS_${VS_VERSION}}" + eval VS_TOOLSET_SUPPORTED="\${VS_TOOLSET_SUPPORTED_${VS_VERSION}}" VS_ENV_CMD="" @@ -241,6 +266,12 @@ TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], [C:/Program Files (x86)/$SDK_INSTALL_DIR], [well-known name]) fi + + if test "x$VS_TOOLSET_SUPPORTED" != x; then + if test "x$with_msvc_toolset_version" != x; then + VS_ENV_ARGS="$VS_ENV_ARGS -vcvars_ver=$with_msvc_toolset_version" + fi + fi ]) ################################################################################ @@ -397,6 +428,8 @@ >> $EXTRACT_VC_ENV_BAT_FILE $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \ >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO "$WINPATH_BASH -c 'echo VCToolsRedistDir="'\"$VCToolsRedistDir \" >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \ >> $EXTRACT_VC_ENV_BAT_FILE $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \ @@ -442,6 +475,7 @@ VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'` VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'` VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` + VCToolsRedistDir=`$ECHO "$VCToolsRedistDir" | $SED 's/\\\\* *$//'` WindowsSdkDir=`$ECHO "$WindowsSdkDir" | $SED 's/\\\\* *$//'` WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` if test -z "$WINDOWSSDKDIR"; then @@ -561,11 +595,13 @@ POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" fi else - # Probe: Using well-known location from VS 2017 + CYGWIN_VC_TOOLS_REDIST_DIR="$VCToolsRedistDir" + BASIC_FIXUP_PATH(CYGWIN_VC_TOOLS_REDIST_DIR) + # Probe: Using well-known location from VS 2017 and VS 2019 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" + POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" else - POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" + POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" fi fi # In case any of the above finds more than one file, loop over them. diff -Nru openjdk-11-11.0.12+7/make/autoconf/version-numbers openjdk-11-11.0.13+8/make/autoconf/version-numbers --- openjdk-11-11.0.12+7/make/autoconf/version-numbers 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/autoconf/version-numbers 2021-10-12 20:42:15.000000000 +0000 @@ -28,16 +28,16 @@ DEFAULT_VERSION_FEATURE=11 DEFAULT_VERSION_INTERIM=0 -DEFAULT_VERSION_UPDATE=12 +DEFAULT_VERSION_UPDATE=13 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2021-07-20 +DEFAULT_VERSION_DATE=2021-10-19 DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11" -DEFAULT_PROMOTED_VERSION_PRE=ea +DEFAULT_PROMOTED_VERSION_PRE= LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK diff -Nru openjdk-11-11.0.12+7/make/conf/jib-profiles.js openjdk-11-11.0.13+8/make/conf/jib-profiles.js --- openjdk-11-11.0.12+7/make/conf/jib-profiles.js 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/conf/jib-profiles.js 2021-10-12 20:42:15.000000000 +0000 @@ -918,11 +918,12 @@ }, jtreg: { - server: "javare", - revision: "4.2", - build_number: "b13", + server: "jpg", + product: "jtreg", + version: "5.1", + build_number: "b01", checksum_file: "MD5_VALUES", - file: "jtreg_bin-4.2.zip", + file: "bundles/jtreg_bin-5.1.zip", environment_name: "JT_HOME", environment_path: input.get("jtreg", "install_path") + "/jtreg/bin" }, diff -Nru openjdk-11-11.0.12+7/make/conf/test-dependencies openjdk-11-11.0.13+8/make/conf/test-dependencies --- openjdk-11-11.0.12+7/make/conf/test-dependencies 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/make/conf/test-dependencies 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1,43 @@ +# +# Copyright (c) 2020, 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. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Versions and download locations for dependencies used by pre-submit testing. + +BOOT_JDK_VERSION=11 +JTREG_VERSION=5.1 +JTREG_BUILD=b01 +GTEST_VERSION=1.8.1 + +LINUX_X64_BOOT_JDK_FILENAME=openjdk-11_linux-x64_bin.tar.gz +LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +LINUX_X64_BOOT_JDK_SHA256=8770f600fc3b89bf331213c7aa21f8eedd9ca5d96036d1cd48cb2748a3dbefd2 + +WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-11_windows-x64_bin.zip +WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.zip +WINDOWS_X64_BOOT_JDK_SHA256=c54123dd4b0d6473221539e7003b8ca1c1757c5588c46465565b03bf8781f807 + +MACOS_X64_BOOT_JDK_FILENAME=openjdk-11_osx-x64_bin.tar.gz +MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_mac_hotspot_11.0.12_7.tar.gz +MACOS_X64_BOOT_JDK_SHA256=13d056ee9a57bf2d5b3af4504c8f8cf7a246c4dff78f96b70dd05dad98075855 diff -Nru openjdk-11-11.0.12+7/make/data/cacerts/identrustdstx3 openjdk-11-11.0.13+8/make/data/cacerts/identrustdstx3 --- openjdk-11-11.0.12+7/make/data/cacerts/identrustdstx3 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/data/cacerts/identrustdstx3 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Owner: CN=DST Root CA X3, O=Digital Signature Trust Co. -Issuer: CN=DST Root CA X3, O=Digital Signature Trust Co. -Serial number: 44afb080d6a327ba893039862ef8406b -Valid from: Sat Sep 30 21:12:19 GMT 2000 until: Thu Sep 30 14:01:15 GMT 2021 -Signature algorithm name: SHA1withRSA -Subject Public Key Algorithm: 2048-bit RSA key -Version: 3 ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow -PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD -Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O -rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq -OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b -xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw -7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD -aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG -SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 -ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr -AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz -R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 -JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo -Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- diff -Nru openjdk-11-11.0.12+7/make/data/charsetmapping/SingleByte-X.java.template openjdk-11-11.0.13+8/make/data/charsetmapping/SingleByte-X.java.template --- openjdk-11-11.0.12+7/make/data/charsetmapping/SingleByte-X.java.template 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/data/charsetmapping/SingleByte-X.java.template 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -48,7 +48,7 @@ } public CharsetDecoder newDecoder() { - return new SingleByte.Decoder(this, b2c, $ASCIICOMPATIBLE$); + return new SingleByte.Decoder(this, b2c, $ASCIICOMPATIBLE$, $LATIN1DECODABLE$); } public CharsetEncoder newEncoder() { diff -Nru openjdk-11-11.0.12+7/make/devkit/createWindowsDevkit2019.sh openjdk-11-11.0.13+8/make/devkit/createWindowsDevkit2019.sh --- openjdk-11-11.0.12+7/make/devkit/createWindowsDevkit2019.sh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/make/devkit/createWindowsDevkit2019.sh 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1,209 @@ +#!/bin/bash +# +# Copyright (c) 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script copies parts of a Visual Studio installation into a devkit +# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin or WSL. +# erik.joelsson@oracle.com + +VS_VERSION="2019" +VS_VERSION_NUM_NODOT="160" +VS_DLL_VERSION="140" +SDK_VERSION="10" +SDK_FULL_VERSION="10.0.17763.0" +MSVC_DIR="Microsoft.VC141.CRT" +MSVC_FULL_VERSION="14.12.27508" +REDIST_FULL_VERSION="14.20.27508" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" + +################################################################################ +# Prepare settings + +UNAME_SYSTEM=`uname -s` +UNAME_RELEASE=`uname -r` + +# Detect cygwin or WSL +IS_CYGWIN=`echo $UNAME_SYSTEM | grep -i CYGWIN` +IS_WSL=`echo $UNAME_RELEASE | grep Microsoft` +if test "x$IS_CYGWIN" != "x"; then + BUILD_ENV="cygwin" +elif test "x$IS_WSL" != "x"; then + BUILD_ENV="wsl" +else + echo "Unknown environment; only Cygwin and WSL are supported." + exit 1 +fi + +if test "x$BUILD_ENV" = "xcygwin"; then + WINDOWS_PATH_TO_UNIX_PATH="cygpath -u" +elif test "x$BUILD_ENV" = "xwsl"; then + WINDOWS_PATH_TO_UNIX_PATH="wslpath -u" +fi + +# Work around the insanely named ProgramFiles(x86) env variable +PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(cmd.exe /c set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")" + +# Find Visual Studio installation dir +VSNNNCOMNTOOLS=`cmd.exe /c echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'` +if [ -d "$VSNNNCOMNTOOLS" ]; then + VS_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS/../..")" +else + VS_INSTALL_DIR="${PROGRAMFILES_X86}/Microsoft Visual Studio/2019" + VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional,Enterprise} 2>/dev/null | head -n1)" +fi +echo "VS_INSTALL_DIR: $VS_INSTALL_DIR" + +# Extract semantic version +POTENTIAL_INI_FILES="Common7/IDE/wdexpress.isolation.ini Common7/IDE/devenv.isolation.ini" +for f in $POTENTIAL_INI_FILES; do + if [ -f "$VS_INSTALL_DIR/$f" ]; then + VS_VERSION_SP="$(grep ^SemanticVersion= "$VS_INSTALL_DIR/$f")" + # Remove SemnaticVersion= + VS_VERSION_SP="${VS_VERSION_SP#*=}" + # Remove suffix of too detailed numbering starting with + + VS_VERSION_SP="${VS_VERSION_SP%+*}" + break + fi +done +if [ -z "$VS_VERSION_SP" ]; then + echo "Failed to find SP version" + exit 1 +fi +echo "Found Version SP: $VS_VERSION_SP" + +# Setup output dirs +DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Creating devkit in $DEVKIT_ROOT" + +MSVCR_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}.dll +MSVCP_DLL=${MSVC_DIR}/msvcp${VS_DLL_VERSION}.dll + +################################################################################ +# Copy Visual Studio files + +TOOLS_VERSION="$(ls "$VS_INSTALL_DIR/VC/Tools/MSVC" | sort -r -n | head -n1)" +echo "Found Tools version: $TOOLS_VERSION" +VC_SUBDIR="VC/Tools/MSVC/$TOOLS_VERSION" +REDIST_VERSION="$(ls "$VS_INSTALL_DIR/VC/Redist/MSVC" | sort -r -n | head -n1)" +echo "Found Redist version: $REDIST_VERSION" +REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION" +echo "Copying VC..." +rm -rf $DEVKIT_ROOT/VC +mkdir -p $DEVKIT_ROOT/VC/bin +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/ +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/ +mkdir -p $DEVKIT_ROOT/VC/lib +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x64" $DEVKIT_ROOT/VC/lib/ +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x86" $DEVKIT_ROOT/VC/lib/ +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/include" $DEVKIT_ROOT/VC/ +mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x64" $DEVKIT_ROOT/VC/atlmfc/lib/ +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x86" $DEVKIT_ROOT/VC/atlmfc/lib/ +cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/ +mkdir -p $DEVKIT_ROOT/VC/Auxiliary +cp -r "$VS_INSTALL_DIR/VC/Auxiliary/Build" $DEVKIT_ROOT/VC/Auxiliary/ +mkdir -p $DEVKIT_ROOT/VC/redist +cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x64" $DEVKIT_ROOT/VC/redist/ +cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x86" $DEVKIT_ROOT/VC/redist/ + +# The redist runtime libs are needed to run the compiler but may not be +# installed on the machine where the devkit will be used. +cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x86 +cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x86 +cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x64 +cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x64 + +################################################################################ +# Copy SDK files + +SDK_INSTALL_DIR="$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION" +echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR" + +SDK_FULL_VERSION="$(ls "$SDK_INSTALL_DIR/bin" | sort -r -n | head -n1)" +echo "Found SDK version: $SDK_FULL_VERSION" +UCRT_VERSION="$(ls "$SDK_INSTALL_DIR/Redist" | grep $SDK_VERSION | sort -r -n | head -n1)" +echo "Found UCRT version: $UCRT_VERSION" +echo "Copying SDK..." +rm -rf $DEVKIT_ROOT/$SDK_VERSION +mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin +cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/ +cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/ +mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib +cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/ +cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/ +cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/ +cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/ +mkdir -p $DEVKIT_ROOT/$SDK_VERSION/Redist +cp -r "$SDK_INSTALL_DIR/Redist/$UCRT_VERSION/ucrt" $DEVKIT_ROOT/$SDK_VERSION/Redist/ +mkdir -p $DEVKIT_ROOT/$SDK_VERSION/include +cp -r "$SDK_INSTALL_DIR/include/$SDK_FULL_VERSION/"* $DEVKIT_ROOT/$SDK_VERSION/include/ + +################################################################################ +# Generate devkit.info + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\"" +echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\"" +echo-info "" +echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin/x86:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" +echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\"" +echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib/x86;\$DEVKIT_ROOT/VC/atlmfc/lib/x86;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\"" +echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\"" +echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\"" +echo-info "DEVKIT_UCRT_DLL_DIR_x86=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x86\"" +echo-info "" +echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" +echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\"" +echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/x64;\$DEVKIT_ROOT/VC/atlmfc/lib/x64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\"" +echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\"" +echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\"" +echo-info "DEVKIT_UCRT_DLL_DIR_x86_64=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x64\"" +echo-info "" +echo-info "DEVKIT_TOOLS_VERSION=\"$TOOLS_VERSION\"" +echo-info "DEVKIT_REDIST_VERSION=\"$REDIST_VERSION\"" +echo-info "DEVKIT_SDK_VERSION=\"$SDK_FULL_VERSION\"" +echo-info "DEVKIT_UCRT_VERSION=\"$UCRT_VERSION\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle: $DEVKIT_BUNDLE" +(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .) diff -Nru openjdk-11-11.0.12+7/make/jdk/src/classes/build/tools/charsetmapping/SBCS.java openjdk-11-11.0.13+8/make/jdk/src/classes/build/tools/charsetmapping/SBCS.java --- openjdk-11-11.0.12+7/make/jdk/src/classes/build/tools/charsetmapping/SBCS.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/jdk/src/classes/build/tools/charsetmapping/SBCS.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ String hisName = cs.hisName; String pkgName = cs.pkgName; boolean isASCII = cs.isASCII; + boolean isLatin1Decodable = true; StringBuilder b2cSB = new StringBuilder(); StringBuilder b2cNRSB = new StringBuilder(); @@ -69,6 +70,9 @@ c2bOff += 0x100; c2bIndex[e.cp>>8] = 1; } + if (e.cp > 0xFF) { + isLatin1Decodable = false; + } } Formatter fm = new Formatter(b2cSB); @@ -178,6 +182,9 @@ if (line.indexOf("$ASCIICOMPATIBLE$") != -1) { line = line.replace("$ASCIICOMPATIBLE$", isASCII ? "true" : "false"); } + if (line.indexOf("$LATIN1DECODABLE$") != -1) { + line = line.replace("$LATIN1DECODABLE$", isLatin1Decodable ? "true" : "false"); + } if (line.indexOf("$B2CTABLE$") != -1) { line = line.replace("$B2CTABLE$", b2c); } diff -Nru openjdk-11-11.0.12+7/make/lib/Awt2dLibraries.gmk openjdk-11-11.0.13+8/make/lib/Awt2dLibraries.gmk --- openjdk-11-11.0.12+7/make/lib/Awt2dLibraries.gmk 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/lib/Awt2dLibraries.gmk 2021-10-12 20:42:15.000000000 +0000 @@ -535,26 +535,13 @@ ########################################################################### + ifeq ($(USE_EXTERNAL_HARFBUZZ), true) - LIBHARFBUZZ_LIBS := $(HARFBUZZ_LIBS) + LIBFONTMANAGER_EXTRA_SRC = + BUILD_LIBFONTMANAGER_FONTLIB += $(HARFBUZZ_LIBS) else + LIBFONTMANAGER_EXTRA_SRC = libharfbuzz HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN -DHAVE_ROUND - # This is better than adding EXPORT_ALL_SYMBOLS - ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang solstudio), ) - HARFBUZZ_CFLAGS += -DHB_EXTERN=__attribute__\(\(visibility\(\"default\"\)\)\) - else ifeq ($(TOOLCHAIN_TYPE), microsoft) - HARFBUZZ_CFLAGS += -DHB_EXTERN=__declspec\(dllexport\) - endif - - LIBHARFBUZZ_LDFLAGS := $(LDFLAGS_JDKLIB) \ - $(call SET_SHARED_LIBRARY_ORIGIN) - ifeq ($(TOOLCHAIN_TYPE), gcc) - ifeq ($(CC_VERSION_NUMBER), 4.4.7) - LIBHARFBUZZ_LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ - $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) \ - $(call SET_SHARED_LIBRARY_ORIGIN) - endif - endif ifneq ($(OPENJDK_TARGET_OS), windows) HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \ @@ -571,73 +558,34 @@ HARFBUZZ_CFLAGS += -DHAVE_CORETEXT endif ifneq ($(OPENJDK_TARGET_OS), macosx) - LIBHARFBUZZ_EXCLUDE_FILES += harfbuzz/hb-coretext.cc + LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-coretext.cc endif # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later. - LIBHARFBUZZ_EXCLUDE_FILES += harfbuzz/hb-ft.cc - - LIBHARFBUZZ_CFLAGS += $(HARFBUZZ_CFLAGS) - - # For use by libfontmanager: - ifeq ($(OPENJDK_TARGET_OS), windows) - LIBHARFBUZZ_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libharfbuzz/harfbuzz.lib - else - LIBHARFBUZZ_LIBS := -lharfbuzz - endif - - LIBHARFBUZZ_EXTRA_HEADER_DIRS := \ - libharfbuzz/hb-ucdn \ - # - - LIBHARFBUZZ_OPTIMIZATION := HIGH - - LIBHARFBUZZ_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS + LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc - $(eval $(call SetupJdkLibrary, BUILD_LIBHARFBUZZ, \ - NAME := harfbuzz, \ - EXCLUDE_FILES := $(LIBHARFBUZZ_EXCLUDE_FILES), \ - TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ - CFLAGS := $(CFLAGS_JDKLIB) $(LIBHARFBUZZ_CFLAGS), \ - CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBHARFBUZZ_CFLAGS), \ - OPTIMIZATION := $(LIBHARFBUZZ_OPTIMIZATION), \ - CFLAGS_windows = -DCC_NOEX, \ - EXTRA_HEADER_DIRS := $(LIBHARFBUZZ_EXTRA_HEADER_DIRS), \ - WARNINGS_AS_ERRORS_xlc := false, \ - DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing, \ - DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ - maybe-uninitialized class-memaccess, \ - DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ - tautological-constant-out-of-range-compare int-to-pointer-cast \ - undef missing-field-initializers, \ - DISABLED_WARNINGS_C_solstudio := \ - E_INTEGER_OVERFLOW_DETECTED \ - E_ARG_INCOMPATIBLE_WITH_ARG_L \ - E_ENUM_VAL_OVERFLOWS_INT_MAX, \ - DISABLED_WARNINGS_CXX_solstudio := \ - truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \ - hidevf w_novirtualdescr arrowrtn2 unknownpragma, \ - DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138, \ - LDFLAGS := $(LIBHARFBUZZ_LDFLAGS), \ - LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \ - LDFLAGS_aix := -Wl$(COMMA)-berok, \ - LIBS := $(BUILD_LIBHARFBUZZ), \ - LIBS_unix := $(LIBM) $(LIBCXX), \ - LIBS_macosx := -framework CoreText -framework CoreFoundation -framework CoreGraphics, \ - LIBS_windows := user32.lib, \ - )) - - ifeq ($(FREETYPE_TO_USE), bundled) - $(BUILD_LIBHARFBUZZ): $(BUILD_LIBFREETYPE) - endif + HARFBUZZ_DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing + HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ + maybe-uninitialized class-memaccess + HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ + tautological-constant-out-of-range-compare int-to-pointer-cast \ + undef missing-field-initializers + HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138 + HARFBUZZ_DISABLED_WARNINGS_C_solstudio := \ + E_INTEGER_OVERFLOW_DETECTED \ + E_ARG_INCOMPATIBLE_WITH_ARG_L \ + E_ENUM_VAL_OVERFLOWS_INT_MAX + HARFBUZZ_DISABLED_WARNINGS_CXX_solstudio := \ + truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \ + hidevf w_novirtualdescr arrowrtn2 unknownpragma - TARGETS += $(BUILD_LIBHARFBUZZ) + LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS) endif -########################################################################### LIBFONTMANAGER_EXTRA_HEADER_DIRS := \ libharfbuzz \ + libharfbuzz/hb-ucdn \ common/awt \ common/font \ libawt/java2d \ @@ -645,10 +593,10 @@ libawt/java2d/loops \ # -LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS) $(HARFBUZZ_FLAGS) -BUILD_LIBFONTMANAGER_FONTLIB += $(LIBHARFBUZZ_LIBS) $(LIBFREETYPE_LIBS) +LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS) +BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS) -LIBFONTMANAGER_OPTIMIZATION := HIGH +LIBFONTMANAGER_OPTIMIZATION := HIGHEST ifeq ($(OPENJDK_TARGET_OS), windows) LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ @@ -686,17 +634,14 @@ OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \ CFLAGS_windows = -DCC_NOEX, \ EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \ + EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \ WARNINGS_AS_ERRORS_xlc := false, \ - DISABLED_WARNINGS_gcc := sign-compare unused-function int-to-pointer-cast, \ - DISABLED_WARNINGS_clang := sign-compare, \ - DISABLED_WARNINGS_C_solstudio := \ - E_INTEGER_OVERFLOW_DETECTED \ - E_ARG_INCOMPATIBLE_WITH_ARG_L \ - E_ENUM_VAL_OVERFLOWS_INT_MAX, \ - DISABLED_WARNINGS_CXX_solstudio := \ - truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \ - hidevf w_novirtualdescr arrowrtn2 unknownpragma, \ - DISABLED_WARNINGS_microsoft := 4018 4146 4244 4996 4996 4146 4334 4819 4101 4068 4805 4138, \ + DISABLED_WARNINGS_gcc := sign-compare unused-function int-to-pointer-cast $(HARFBUZZ_DISABLED_WARNINGS_gcc), \ + DISABLED_WARNINGS_CXX_gcc := $(HARFBUZZ_DISABLED_WARNINGS_CXX_gcc), \ + DISABLED_WARNINGS_clang := sign-compare $(HARFBUZZ_DISABLED_WARNINGS_clang), \ + DISABLED_WARNINGS_C_solstudio := $(HARFBUZZ_DISABLED_WARNINGS_C_solstudio), \ + DISABLED_WARNINGS_CXX_solstudio := $(HARFBUZZ_DISABLED_WARNINGS_CXX_solstudio), \ + DISABLED_WARNINGS_microsoft := 4018 4996 $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \ LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -704,17 +649,13 @@ LDFLAGS_aix := -Wl$(COMMA)-berok, \ LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \ LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \ - LIBS_macosx := -lawt_lwawt, \ + LIBS_macosx := -lawt_lwawt -framework CoreText -framework CoreFoundation -framework CoreGraphics, \ LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \ $(WIN_AWT_LIB), \ )) $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT) -ifeq ($(USE_EXTERNAL_HARFBUZZ), false) - $(BUILD_LIBFONTMANAGER): $(BUILD_LIBHARFBUZZ) -endif - ifeq ($(OPENJDK_TARGET_OS), macosx) $(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt) endif diff -Nru openjdk-11-11.0.12+7/make/lib/Lib-jdk.hotspot.agent.gmk openjdk-11-11.0.13+8/make/lib/Lib-jdk.hotspot.agent.gmk --- openjdk-11-11.0.12+7/make/lib/Lib-jdk.hotspot.agent.gmk 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/make/lib/Lib-jdk.hotspot.agent.gmk 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 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 @@ -65,7 +65,7 @@ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_CFLAGS) $(SA_CXXFLAGS), \ EXTRA_SRC := $(LIBSA_EXTRA_SRC), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \ - LIBS_linux := -lthread_db $(LIBDL), \ + LIBS_linux := $(LIBDL), \ LIBS_solaris := -ldl -ldemangle -lthread -lproc, \ LIBS_macosx := -framework Foundation \ -framework JavaRuntimeSupport -framework Security -framework CoreFoundation, \ diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/aarch64-asmtest.py openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64-asmtest.py --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/aarch64-asmtest.py 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64-asmtest.py 2021-10-12 20:42:15.000000000 +0000 @@ -1,8 +1,8 @@ import random -AARCH64_AS = "" -AARCH64_OBJDUMP = "" -AARCH64_OBJCOPY = "" +AARCH64_AS = "as" +AARCH64_OBJDUMP = "objdump" +AARCH64_OBJCOPY = "objcopy" class Operand(object): @@ -348,7 +348,7 @@ + ', #0x%x' % self.immed) def cstr(self): - return super(AddSubImmOp, self).cstr() + "l);" + return super(AddSubImmOp, self).cstr() + "ll);" class MultiOp(): diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/aarch64.ad openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64.ad --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/aarch64.ad 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64.ad 2021-10-12 20:42:15.000000000 +0000 @@ -201,43 +201,43 @@ reg_def V7_J ( SOC, SOC, Op_RegF, 7, v7->as_VMReg()->next(2) ); reg_def V7_K ( SOC, SOC, Op_RegF, 7, v7->as_VMReg()->next(3) ); - reg_def V8 ( SOC, SOC, Op_RegF, 8, v8->as_VMReg() ); - reg_def V8_H ( SOC, SOC, Op_RegF, 8, v8->as_VMReg()->next() ); + reg_def V8 ( SOC, SOE, Op_RegF, 8, v8->as_VMReg() ); + reg_def V8_H ( SOC, SOE, Op_RegF, 8, v8->as_VMReg()->next() ); reg_def V8_J ( SOC, SOC, Op_RegF, 8, v8->as_VMReg()->next(2) ); reg_def V8_K ( SOC, SOC, Op_RegF, 8, v8->as_VMReg()->next(3) ); - reg_def V9 ( SOC, SOC, Op_RegF, 9, v9->as_VMReg() ); - reg_def V9_H ( SOC, SOC, Op_RegF, 9, v9->as_VMReg()->next() ); + reg_def V9 ( SOC, SOE, Op_RegF, 9, v9->as_VMReg() ); + reg_def V9_H ( SOC, SOE, Op_RegF, 9, v9->as_VMReg()->next() ); reg_def V9_J ( SOC, SOC, Op_RegF, 9, v9->as_VMReg()->next(2) ); reg_def V9_K ( SOC, SOC, Op_RegF, 9, v9->as_VMReg()->next(3) ); - reg_def V10 ( SOC, SOC, Op_RegF, 10, v10->as_VMReg() ); - reg_def V10_H( SOC, SOC, Op_RegF, 10, v10->as_VMReg()->next() ); + reg_def V10 ( SOC, SOE, Op_RegF, 10, v10->as_VMReg() ); + reg_def V10_H( SOC, SOE, Op_RegF, 10, v10->as_VMReg()->next() ); reg_def V10_J( SOC, SOC, Op_RegF, 10, v10->as_VMReg()->next(2)); reg_def V10_K( SOC, SOC, Op_RegF, 10, v10->as_VMReg()->next(3)); - reg_def V11 ( SOC, SOC, Op_RegF, 11, v11->as_VMReg() ); - reg_def V11_H( SOC, SOC, Op_RegF, 11, v11->as_VMReg()->next() ); + reg_def V11 ( SOC, SOE, Op_RegF, 11, v11->as_VMReg() ); + reg_def V11_H( SOC, SOE, Op_RegF, 11, v11->as_VMReg()->next() ); reg_def V11_J( SOC, SOC, Op_RegF, 11, v11->as_VMReg()->next(2)); reg_def V11_K( SOC, SOC, Op_RegF, 11, v11->as_VMReg()->next(3)); - reg_def V12 ( SOC, SOC, Op_RegF, 12, v12->as_VMReg() ); - reg_def V12_H( SOC, SOC, Op_RegF, 12, v12->as_VMReg()->next() ); + reg_def V12 ( SOC, SOE, Op_RegF, 12, v12->as_VMReg() ); + reg_def V12_H( SOC, SOE, Op_RegF, 12, v12->as_VMReg()->next() ); reg_def V12_J( SOC, SOC, Op_RegF, 12, v12->as_VMReg()->next(2)); reg_def V12_K( SOC, SOC, Op_RegF, 12, v12->as_VMReg()->next(3)); - reg_def V13 ( SOC, SOC, Op_RegF, 13, v13->as_VMReg() ); - reg_def V13_H( SOC, SOC, Op_RegF, 13, v13->as_VMReg()->next() ); + reg_def V13 ( SOC, SOE, Op_RegF, 13, v13->as_VMReg() ); + reg_def V13_H( SOC, SOE, Op_RegF, 13, v13->as_VMReg()->next() ); reg_def V13_J( SOC, SOC, Op_RegF, 13, v13->as_VMReg()->next(2)); reg_def V13_K( SOC, SOC, Op_RegF, 13, v13->as_VMReg()->next(3)); - reg_def V14 ( SOC, SOC, Op_RegF, 14, v14->as_VMReg() ); - reg_def V14_H( SOC, SOC, Op_RegF, 14, v14->as_VMReg()->next() ); + reg_def V14 ( SOC, SOE, Op_RegF, 14, v14->as_VMReg() ); + reg_def V14_H( SOC, SOE, Op_RegF, 14, v14->as_VMReg()->next() ); reg_def V14_J( SOC, SOC, Op_RegF, 14, v14->as_VMReg()->next(2)); reg_def V14_K( SOC, SOC, Op_RegF, 14, v14->as_VMReg()->next(3)); - reg_def V15 ( SOC, SOC, Op_RegF, 15, v15->as_VMReg() ); - reg_def V15_H( SOC, SOC, Op_RegF, 15, v15->as_VMReg()->next() ); + reg_def V15 ( SOC, SOE, Op_RegF, 15, v15->as_VMReg() ); + reg_def V15_H( SOC, SOE, Op_RegF, 15, v15->as_VMReg()->next() ); reg_def V15_J( SOC, SOC, Op_RegF, 15, v15->as_VMReg()->next(2)); reg_def V15_K( SOC, SOC, Op_RegF, 15, v15->as_VMReg()->next(3)); @@ -1615,7 +1615,7 @@ MacroAssembler _masm(&cbuf); // n.b. frame size includes space for return pc and rfp - const long framesize = C->frame_size_in_bytes(); + const int framesize = C->frame_size_in_bytes(); assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment"); // insert a nop at the start of the prolog so we can patch in a @@ -2968,7 +2968,7 @@ enc_class aarch64_enc_movw_imm(iRegI dst, immI src) %{ MacroAssembler _masm(&cbuf); - u_int32_t con = (u_int32_t)$src$$constant; + uint32_t con = (uint32_t)$src$$constant; Register dst_reg = as_Register($dst$$reg); if (con == 0) { __ movw(dst_reg, zr); @@ -2980,7 +2980,7 @@ enc_class aarch64_enc_mov_imm(iRegL dst, immL src) %{ MacroAssembler _masm(&cbuf); Register dst_reg = as_Register($dst$$reg); - u_int64_t con = (u_int64_t)$src$$constant; + uint64_t con = (uint64_t)$src$$constant; if (con == 0) { __ mov(dst_reg, zr); } else { @@ -3005,7 +3005,7 @@ if (con < (address)(uintptr_t)os::vm_page_size()) { __ mov(dst_reg, con); } else { - unsigned long offset; + uintptr_t offset; __ adrp(dst_reg, con, offset); __ add(dst_reg, dst_reg, offset); } @@ -3022,14 +3022,14 @@ enc_class aarch64_enc_mov_p1(iRegP dst, immP_1 src) %{ MacroAssembler _masm(&cbuf); Register dst_reg = as_Register($dst$$reg); - __ mov(dst_reg, (u_int64_t)1); + __ mov(dst_reg, (uint64_t)1); %} enc_class aarch64_enc_mov_poll_page(iRegP dst, immPollPage src) %{ MacroAssembler _masm(&cbuf); address page = (address)$src$$constant; Register dst_reg = as_Register($dst$$reg); - unsigned long off; + uint64_t off; __ adrp(dst_reg, Address(page, relocInfo::poll_type), off); assert(off == 0, "assumed offset == 0"); %} @@ -3156,7 +3156,7 @@ enc_class aarch64_enc_cmpw_imm(iRegI src1, immI src2) %{ MacroAssembler _masm(&cbuf); Register reg1 = as_Register($src1$$reg); - u_int32_t val = (u_int32_t)$src2$$constant; + uint32_t val = (uint32_t)$src2$$constant; __ movw(rscratch1, val); __ cmpw(reg1, rscratch1); %} @@ -3178,7 +3178,7 @@ __ adds(zr, reg, -val); } else { // aargh, Long.MIN_VALUE is a special case - __ orr(rscratch1, zr, (u_int64_t)val); + __ orr(rscratch1, zr, (uint64_t)val); __ subs(zr, reg, rscratch1); } %} @@ -3186,7 +3186,7 @@ enc_class aarch64_enc_cmp_imm(iRegL src1, immL src2) %{ MacroAssembler _masm(&cbuf); Register reg1 = as_Register($src1$$reg); - u_int64_t val = (u_int64_t)$src2$$constant; + uint64_t val = (uint64_t)$src2$$constant; __ mov(rscratch1, val); __ cmp(reg1, rscratch1); %} @@ -4079,7 +4079,7 @@ // 32 bit integer valid for add sub immediate operand immIAddSub() %{ - predicate(Assembler::operand_valid_for_add_sub_immediate((long)n->get_int())); + predicate(Assembler::operand_valid_for_add_sub_immediate((int64_t)n->get_int())); match(ConI); op_cost(0); format %{ %} @@ -4090,7 +4090,7 @@ // TODO -- check this is right when e.g the mask is 0x80000000 operand immILog() %{ - predicate(Assembler::operand_valid_for_logical_immediate(/*is32*/true, (unsigned long)n->get_int())); + predicate(Assembler::operand_valid_for_logical_immediate(/*is32*/true, (uint64_t)n->get_int())); match(ConI); op_cost(0); @@ -4168,7 +4168,7 @@ // 64 bit integer valid for logical immediate operand immLLog() %{ - predicate(Assembler::operand_valid_for_logical_immediate(/*is32*/false, (unsigned long)n->get_long())); + predicate(Assembler::operand_valid_for_logical_immediate(/*is32*/false, (uint64_t)n->get_long())); match(ConL); op_cost(0); format %{ %} @@ -9660,7 +9660,7 @@ ins_encode %{ __ sbfiz(as_Register($dst$$reg), as_Register($src$$reg), - $scale$$constant & 63, MIN(32, (-$scale$$constant) & 63)); + $scale$$constant & 63, MIN2(32, (int)((-$scale$$constant) & 63))); %} ins_pipe(ialu_reg_shift); @@ -10260,6 +10260,10 @@ // BEGIN This section of the file is automatically generated. Do not edit -------------- + + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct regL_not_reg(iRegLNoSp dst, iRegL src1, immL_M1 m1, rFlagsReg cr) %{ @@ -10276,6 +10280,9 @@ ins_pipe(ialu_reg); %} + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct regI_not_reg(iRegINoSp dst, iRegIorL2I src1, immI_M1 m1, rFlagsReg cr) %{ @@ -10293,6 +10300,8 @@ ins_pipe(ialu_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1, rFlagsReg cr) %{ @@ -10310,6 +10319,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immL_M1 m1, rFlagsReg cr) %{ @@ -10327,6 +10338,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1, rFlagsReg cr) %{ @@ -10344,6 +10357,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immL_M1 m1, rFlagsReg cr) %{ @@ -10361,6 +10376,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1, rFlagsReg cr) %{ @@ -10378,6 +10395,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immL_M1 m1, rFlagsReg cr) %{ @@ -10395,6 +10414,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_URShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10413,6 +10434,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_URShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10431,6 +10454,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_RShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10449,6 +10474,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_RShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10467,6 +10494,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_LShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10485,6 +10514,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_LShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10503,6 +10534,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_URShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10521,6 +10554,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_URShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10539,6 +10574,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_RShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10557,6 +10594,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_RShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10575,6 +10614,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_LShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10593,6 +10634,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_LShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10611,6 +10654,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_URShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10629,6 +10674,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_URShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10647,6 +10694,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_RShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10665,6 +10714,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_RShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10683,6 +10734,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_LShift_not_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, immI_M1 src4, rFlagsReg cr) %{ @@ -10701,6 +10754,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_LShift_not_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, immL_M1 src4, rFlagsReg cr) %{ @@ -10719,6 +10774,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_URShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10738,6 +10795,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_URShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10757,6 +10816,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_RShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10776,6 +10837,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_RShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10795,6 +10858,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndI_reg_LShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10814,6 +10879,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AndL_reg_LShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10833,6 +10900,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_URShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10852,6 +10921,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_URShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10871,6 +10942,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_RShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10890,6 +10963,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_RShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10909,6 +10984,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorI_reg_LShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10928,6 +11005,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct XorL_reg_LShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10947,6 +11026,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_URShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -10966,6 +11047,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_URShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -10985,6 +11068,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_RShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11004,6 +11089,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_RShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11023,6 +11110,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrI_reg_LShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11042,6 +11131,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct OrL_reg_LShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11061,6 +11152,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddI_reg_URShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11080,6 +11173,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddL_reg_URShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11099,6 +11194,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddI_reg_RShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11118,6 +11215,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddL_reg_RShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11137,6 +11236,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddI_reg_LShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11156,6 +11257,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddL_reg_LShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11175,6 +11278,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubI_reg_URShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11194,6 +11299,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubL_reg_URShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11213,6 +11320,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubI_reg_RShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11232,6 +11341,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubL_reg_RShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11251,6 +11362,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubI_reg_LShift_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI src3, rFlagsReg cr) %{ @@ -11270,6 +11383,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubL_reg_LShift_reg(iRegLNoSp dst, iRegL src1, iRegL src2, immI src3, rFlagsReg cr) %{ @@ -11289,7 +11404,9 @@ ins_pipe(ialu_reg_reg_shift); %} - + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE // Shift Left followed by Shift Right. // This idiom is used by the compiler for the i2b bytecode etc. @@ -11311,6 +11428,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // Shift Left followed by Shift Right. // This idiom is used by the compiler for the i2b bytecode etc. instruct sbfmwI(iRegINoSp dst, iRegIorL2I src, immI lshift_count, immI rshift_count) @@ -11331,6 +11451,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // Shift Left followed by Shift Right. // This idiom is used by the compiler for the i2b bytecode etc. instruct ubfmL(iRegLNoSp dst, iRegL src, immI lshift_count, immI rshift_count) @@ -11351,6 +11474,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // Shift Left followed by Shift Right. // This idiom is used by the compiler for the i2b bytecode etc. instruct ubfmwI(iRegINoSp dst, iRegIorL2I src, immI lshift_count, immI rshift_count) @@ -11370,8 +11496,11 @@ ins_pipe(ialu_reg_shift); %} + // Bitfield extract with shift & mask +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct ubfxwI(iRegINoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask) %{ match(Set dst (AndI (URShiftI src rshift) mask)); @@ -11382,13 +11511,16 @@ format %{ "ubfxw $dst, $src, $rshift, $mask" %} ins_encode %{ int rshift = $rshift$$constant & 31; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfxw(as_Register($dst$$reg), as_Register($src$$reg), rshift, width); %} ins_pipe(ialu_reg_shift); %} + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct ubfxL(iRegLNoSp dst, iRegL src, immI rshift, immL_bitmask mask) %{ match(Set dst (AndL (URShiftL src rshift) mask)); @@ -11399,7 +11531,7 @@ format %{ "ubfx $dst, $src, $rshift, $mask" %} ins_encode %{ int rshift = $rshift$$constant & 63; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2_long(mask+1); __ ubfx(as_Register($dst$$reg), as_Register($src$$reg), rshift, width); @@ -11407,6 +11539,10 @@ ins_pipe(ialu_reg_shift); %} + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // We can use ubfx when extending an And with a mask when we know mask // is positive. We know that because immI_bitmask guarantees it. instruct ubfxIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask) @@ -11419,7 +11555,7 @@ format %{ "ubfx $dst, $src, $rshift, $mask" %} ins_encode %{ int rshift = $rshift$$constant & 31; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfx(as_Register($dst$$reg), as_Register($src$$reg), rshift, width); @@ -11428,6 +11564,9 @@ %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // We can use ubfiz when masking by a positive number and then left shifting the result. // We know that the mask is positive because immI_bitmask guarantees it. instruct ubfizwI(iRegINoSp dst, iRegIorL2I src, immI lshift, immI_bitmask mask) @@ -11439,7 +11578,7 @@ format %{ "ubfizw $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & 31; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfizw(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -11447,6 +11586,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // We can use ubfiz when masking by a positive number and then left shifting the result. // We know that the mask is positive because immL_bitmask guarantees it. instruct ubfizL(iRegLNoSp dst, iRegL src, immI lshift, immL_bitmask mask) @@ -11458,7 +11600,7 @@ format %{ "ubfiz $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & 63; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2_long(mask+1); __ ubfiz(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -11466,6 +11608,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // We can use ubfiz when masking by a positive number and then left shifting the result. // We know that the mask is positive because immI_bitmask guarantees it. instruct ubfizwIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI lshift, immI_bitmask mask) @@ -11477,7 +11622,7 @@ format %{ "ubfizw $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & 31; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfizw(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -11485,6 +11630,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // We can use ubfiz when masking by a positive number and then left shifting the result. // We know that the mask is positive because immL_bitmask guarantees it. instruct ubfizLConvL2I(iRegINoSp dst, iRegL src, immI lshift, immL_positive_bitmaskI mask) @@ -11496,7 +11644,7 @@ format %{ "ubfiz $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & 63; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2_long(mask+1); __ ubfiz(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -11505,6 +11653,9 @@ %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // If there is a convert I to L block between and AndI and a LShiftL, we can also match ubfiz instruct ubfizIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI lshift, immI_bitmask mask) %{ @@ -11515,7 +11666,7 @@ format %{ "ubfiz $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & 63; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfiz(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -11523,6 +11674,9 @@ ins_pipe(ialu_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // If there is a convert L to I block between and AndL and a LShiftI, we can also match ubfiz instruct ubfizLConvL2Ix(iRegINoSp dst, iRegL src, immI lshift, immL_positive_bitmaskI mask) %{ @@ -11533,7 +11687,7 @@ format %{ "ubfiz $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & 31; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfiz(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -11553,8 +11707,10 @@ ins_pipe(ialu_reg_shift); %} -// Rotations +// Rotations +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct extrOrL(iRegLNoSp dst, iRegL src1, iRegL src2, immI lshift, immI rshift, rFlagsReg cr) %{ match(Set dst (OrL (LShiftL src1 lshift) (URShiftL src2 rshift))); @@ -11570,6 +11726,9 @@ ins_pipe(ialu_reg_reg_extr); %} + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct extrOrI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI lshift, immI rshift, rFlagsReg cr) %{ match(Set dst (OrI (LShiftI src1 lshift) (URShiftI src2 rshift))); @@ -11585,6 +11744,9 @@ ins_pipe(ialu_reg_reg_extr); %} + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct extrAddL(iRegLNoSp dst, iRegL src1, iRegL src2, immI lshift, immI rshift, rFlagsReg cr) %{ match(Set dst (AddL (LShiftL src1 lshift) (URShiftL src2 rshift))); @@ -11600,6 +11762,9 @@ ins_pipe(ialu_reg_reg_extr); %} + +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct extrAddI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI lshift, immI rshift, rFlagsReg cr) %{ match(Set dst (AddI (LShiftI src1 lshift) (URShiftI src2 rshift))); @@ -11616,8 +11781,10 @@ %} -// rol expander +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +// rol expander instruct rolL_rReg(iRegLNoSp dst, iRegL src, iRegI shift, rFlagsReg cr) %{ effect(DEF dst, USE src, USE shift); @@ -11632,8 +11799,10 @@ ins_pipe(ialu_reg_reg_vshift); %} -// rol expander +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +// rol expander instruct rolI_rReg(iRegINoSp dst, iRegI src, iRegI shift, rFlagsReg cr) %{ effect(DEF dst, USE src, USE shift); @@ -11648,6 +11817,8 @@ ins_pipe(ialu_reg_reg_vshift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rolL_rReg_Var_C_64(iRegLNoSp dst, iRegL src, iRegI shift, immI_64 c_64, rFlagsReg cr) %{ match(Set dst (OrL (LShiftL src shift) (URShiftL src (SubI c_64 shift)))); @@ -11657,6 +11828,8 @@ %} %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rolL_rReg_Var_C0(iRegLNoSp dst, iRegL src, iRegI shift, immI0 c0, rFlagsReg cr) %{ match(Set dst (OrL (LShiftL src shift) (URShiftL src (SubI c0 shift)))); @@ -11666,6 +11839,8 @@ %} %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rolI_rReg_Var_C_32(iRegINoSp dst, iRegI src, iRegI shift, immI_32 c_32, rFlagsReg cr) %{ match(Set dst (OrI (LShiftI src shift) (URShiftI src (SubI c_32 shift)))); @@ -11675,6 +11850,8 @@ %} %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rolI_rReg_Var_C0(iRegINoSp dst, iRegI src, iRegI shift, immI0 c0, rFlagsReg cr) %{ match(Set dst (OrI (LShiftI src shift) (URShiftI src (SubI c0 shift)))); @@ -11684,8 +11861,10 @@ %} %} -// ror expander +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +// ror expander instruct rorL_rReg(iRegLNoSp dst, iRegL src, iRegI shift, rFlagsReg cr) %{ effect(DEF dst, USE src, USE shift); @@ -11699,8 +11878,10 @@ ins_pipe(ialu_reg_reg_vshift); %} -// ror expander +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +// ror expander instruct rorI_rReg(iRegINoSp dst, iRegI src, iRegI shift, rFlagsReg cr) %{ effect(DEF dst, USE src, USE shift); @@ -11714,6 +11895,8 @@ ins_pipe(ialu_reg_reg_vshift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rorL_rReg_Var_C_64(iRegLNoSp dst, iRegL src, iRegI shift, immI_64 c_64, rFlagsReg cr) %{ match(Set dst (OrL (URShiftL src shift) (LShiftL src (SubI c_64 shift)))); @@ -11723,6 +11906,8 @@ %} %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rorL_rReg_Var_C0(iRegLNoSp dst, iRegL src, iRegI shift, immI0 c0, rFlagsReg cr) %{ match(Set dst (OrL (URShiftL src shift) (LShiftL src (SubI c0 shift)))); @@ -11732,6 +11917,8 @@ %} %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rorI_rReg_Var_C_32(iRegINoSp dst, iRegI src, iRegI shift, immI_32 c_32, rFlagsReg cr) %{ match(Set dst (OrI (URShiftI src shift) (LShiftI src (SubI c_32 shift)))); @@ -11741,6 +11928,8 @@ %} %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct rorI_rReg_Var_C0(iRegINoSp dst, iRegI src, iRegI shift, immI0 c0, rFlagsReg cr) %{ match(Set dst (OrI (URShiftI src shift) (LShiftI src (SubI c0 shift)))); @@ -11750,8 +11939,11 @@ %} %} + // Add/subtract (extended) +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI(iRegLNoSp dst, iRegL src1, iRegIorL2I src2, rFlagsReg cr) %{ match(Set dst (AddL src1 (ConvI2L src2))); @@ -11763,8 +11955,10 @@ as_Register($src2$$reg), ext::sxtw); %} ins_pipe(ialu_reg_reg); -%}; +%} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI(iRegLNoSp dst, iRegL src1, iRegIorL2I src2, rFlagsReg cr) %{ match(Set dst (SubL src1 (ConvI2L src2))); @@ -11776,9 +11970,10 @@ as_Register($src2$$reg), ext::sxtw); %} ins_pipe(ialu_reg_reg); -%}; - +%} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_sxth(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_16 lshift, immI_16 rshift, rFlagsReg cr) %{ match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift))); @@ -11792,6 +11987,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_sxtb(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr) %{ match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift))); @@ -11805,6 +12002,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_uxtb(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr) %{ match(Set dst (AddI src1 (URShiftI (LShiftI src2 lshift) rshift))); @@ -11818,6 +12017,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_sxth(iRegLNoSp dst, iRegL src1, iRegL src2, immI_48 lshift, immI_48 rshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (RShiftL (LShiftL src2 lshift) rshift))); @@ -11831,6 +12032,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_sxtw(iRegLNoSp dst, iRegL src1, iRegL src2, immI_32 lshift, immI_32 rshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (RShiftL (LShiftL src2 lshift) rshift))); @@ -11844,6 +12047,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_sxtb(iRegLNoSp dst, iRegL src1, iRegL src2, immI_56 lshift, immI_56 rshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (RShiftL (LShiftL src2 lshift) rshift))); @@ -11857,6 +12062,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxtb(iRegLNoSp dst, iRegL src1, iRegL src2, immI_56 lshift, immI_56 rshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (URShiftL (LShiftL src2 lshift) rshift))); @@ -11870,7 +12077,8 @@ ins_pipe(ialu_reg_reg); %} - +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_uxtb_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, rFlagsReg cr) %{ match(Set dst (AddI src1 (AndI src2 mask))); @@ -11884,6 +12092,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_uxth_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, rFlagsReg cr) %{ match(Set dst (AddI src1 (AndI src2 mask))); @@ -11897,6 +12107,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxtb_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_255 mask, rFlagsReg cr) %{ match(Set dst (AddL src1 (AndL src2 mask))); @@ -11910,6 +12122,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxth_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_65535 mask, rFlagsReg cr) %{ match(Set dst (AddL src1 (AndL src2 mask))); @@ -11923,6 +12137,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxtw_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_4294967295 mask, rFlagsReg cr) %{ match(Set dst (AddL src1 (AndL src2 mask))); @@ -11936,6 +12152,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_uxtb_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, rFlagsReg cr) %{ match(Set dst (SubI src1 (AndI src2 mask))); @@ -11949,6 +12167,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_uxth_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, rFlagsReg cr) %{ match(Set dst (SubI src1 (AndI src2 mask))); @@ -11962,6 +12182,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_uxtb_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_255 mask, rFlagsReg cr) %{ match(Set dst (SubL src1 (AndL src2 mask))); @@ -11975,6 +12197,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_uxth_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_65535 mask, rFlagsReg cr) %{ match(Set dst (SubL src1 (AndL src2 mask))); @@ -11988,6 +12212,8 @@ ins_pipe(ialu_reg_reg); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_uxtw_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_4294967295 mask, rFlagsReg cr) %{ match(Set dst (SubL src1 (AndL src2 mask))); @@ -12002,6 +12228,8 @@ %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_sxtb_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immIExt lshift2, immI_56 lshift1, immI_56 rshift1, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (RShiftL (LShiftL src2 lshift1) rshift1) lshift2))); @@ -12015,6 +12243,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_sxth_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immIExt lshift2, immI_48 lshift1, immI_48 rshift1, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (RShiftL (LShiftL src2 lshift1) rshift1) lshift2))); @@ -12028,6 +12258,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_sxtw_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immIExt lshift2, immI_32 lshift1, immI_32 rshift1, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (RShiftL (LShiftL src2 lshift1) rshift1) lshift2))); @@ -12041,6 +12273,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_sxtb_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immIExt lshift2, immI_56 lshift1, immI_56 rshift1, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (RShiftL (LShiftL src2 lshift1) rshift1) lshift2))); @@ -12054,6 +12288,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_sxth_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immIExt lshift2, immI_48 lshift1, immI_48 rshift1, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (RShiftL (LShiftL src2 lshift1) rshift1) lshift2))); @@ -12067,6 +12303,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_sxtw_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immIExt lshift2, immI_32 lshift1, immI_32 rshift1, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (RShiftL (LShiftL src2 lshift1) rshift1) lshift2))); @@ -12080,6 +12318,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_sxtb_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immIExt lshift2, immI_24 lshift1, immI_24 rshift1, rFlagsReg cr) %{ match(Set dst (AddI src1 (LShiftI (RShiftI (LShiftI src2 lshift1) rshift1) lshift2))); @@ -12093,6 +12333,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_sxth_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immIExt lshift2, immI_16 lshift1, immI_16 rshift1, rFlagsReg cr) %{ match(Set dst (AddI src1 (LShiftI (RShiftI (LShiftI src2 lshift1) rshift1) lshift2))); @@ -12106,6 +12348,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_sxtb_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immIExt lshift2, immI_24 lshift1, immI_24 rshift1, rFlagsReg cr) %{ match(Set dst (SubI src1 (LShiftI (RShiftI (LShiftI src2 lshift1) rshift1) lshift2))); @@ -12119,6 +12363,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_sxth_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immIExt lshift2, immI_16 lshift1, immI_16 rshift1, rFlagsReg cr) %{ match(Set dst (SubI src1 (LShiftI (RShiftI (LShiftI src2 lshift1) rshift1) lshift2))); @@ -12132,7 +12378,8 @@ ins_pipe(ialu_reg_reg_shift); %} - +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_shift(iRegLNoSp dst, iRegL src1, iRegIorL2I src2, immIExt lshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (ConvI2L src2) lshift))); @@ -12144,8 +12391,10 @@ as_Register($src2$$reg), ext::sxtw, ($lshift$$constant)); %} ins_pipe(ialu_reg_reg_shift); -%}; +%} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_shift(iRegLNoSp dst, iRegL src1, iRegIorL2I src2, immIExt lshift, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (ConvI2L src2) lshift))); @@ -12157,9 +12406,10 @@ as_Register($src2$$reg), ext::sxtw, ($lshift$$constant)); %} ins_pipe(ialu_reg_reg_shift); -%}; - +%} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxtb_and_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immL_255 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (AndL src2 mask) lshift))); @@ -12173,6 +12423,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxth_and_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immL_65535 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (AndL src2 mask) lshift))); @@ -12186,6 +12438,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtL_uxtw_and_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immL_4294967295 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (AddL src1 (LShiftL (AndL src2 mask) lshift))); @@ -12199,6 +12453,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_uxtb_and_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immL_255 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (AndL src2 mask) lshift))); @@ -12212,6 +12468,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_uxth_and_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immL_65535 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (AndL src2 mask) lshift))); @@ -12225,6 +12483,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtL_uxtw_and_shift(iRegLNoSp dst, iRegL src1, iRegL src2, immL_4294967295 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (SubL src1 (LShiftL (AndL src2 mask) lshift))); @@ -12238,6 +12498,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_uxtb_and_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (AddI src1 (LShiftI (AndI src2 mask) lshift))); @@ -12251,6 +12513,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct AddExtI_uxth_and_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (AddI src1 (LShiftI (AndI src2 mask) lshift))); @@ -12264,6 +12528,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_uxtb_and_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (SubI src1 (LShiftI (AndI src2 mask) lshift))); @@ -12277,6 +12543,8 @@ ins_pipe(ialu_reg_reg_shift); %} +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct SubExtI_uxth_and_shift(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst (SubI src1 (LShiftI (AndI src2 mask) lshift))); @@ -12289,8 +12557,12 @@ %} ins_pipe(ialu_reg_reg_shift); %} + + + // END This section of the file is automatically generated. Do not edit -------------- + // ============================================================================ // Floating Point Arithmetic Instructions @@ -12830,7 +13102,7 @@ ins_encode %{ __ andw(as_Register($dst$$reg), as_Register($src1$$reg), - (unsigned long)($src2$$constant)); + (uint64_t)($src2$$constant)); %} ins_pipe(ialu_reg_imm); @@ -12862,7 +13134,7 @@ ins_encode %{ __ orrw(as_Register($dst$$reg), as_Register($src1$$reg), - (unsigned long)($src2$$constant)); + (uint64_t)($src2$$constant)); %} ins_pipe(ialu_reg_imm); @@ -12894,7 +13166,7 @@ ins_encode %{ __ eorw(as_Register($dst$$reg), as_Register($src1$$reg), - (unsigned long)($src2$$constant)); + (uint64_t)($src2$$constant)); %} ins_pipe(ialu_reg_imm); @@ -12927,7 +13199,7 @@ ins_encode %{ __ andr(as_Register($dst$$reg), as_Register($src1$$reg), - (unsigned long)($src2$$constant)); + (uint64_t)($src2$$constant)); %} ins_pipe(ialu_reg_imm); @@ -12959,7 +13231,7 @@ ins_encode %{ __ orr(as_Register($dst$$reg), as_Register($src1$$reg), - (unsigned long)($src2$$constant)); + (uint64_t)($src2$$constant)); %} ins_pipe(ialu_reg_imm); @@ -12991,7 +13263,7 @@ ins_encode %{ __ eor(as_Register($dst$$reg), as_Register($src1$$reg), - (unsigned long)($src2$$constant)); + (uint64_t)($src2$$constant)); %} ins_pipe(ialu_reg_imm); @@ -13444,8 +13716,8 @@ instruct clearArray_imm_reg(immL cnt, iRegP_R10 base, Universe dummy, rFlagsReg cr) %{ - predicate((u_int64_t)n->in(2)->get_long() - < (u_int64_t)(BlockZeroingLowLimit >> LogBytesPerWord)); + predicate((uint64_t)n->in(2)->get_long() + < (uint64_t)(BlockZeroingLowLimit >> LogBytesPerWord)); match(Set dummy (ClearArray cnt base)); effect(USE_KILL base); @@ -13453,7 +13725,7 @@ format %{ "ClearArray $cnt, $base" %} ins_encode %{ - __ zero_words($base$$Register, (u_int64_t)$cnt$$constant); + __ zero_words($base$$Register, (uint64_t)$cnt$$constant); %} ins_pipe(pipe_class_memory); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/aarch64_ad.m4 openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64_ad.m4 --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/aarch64_ad.m4 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/aarch64_ad.m4 2021-10-12 20:42:15.000000000 +0000 @@ -1,4 +1,4 @@ -dnl Copyright (c) 2014, Red Hat Inc. All rights reserved. +dnl Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. dnl DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. dnl dnl This code is free software; you can redistribute it and/or modify it @@ -23,12 +23,12 @@ dnl Process this file with m4 aarch64_ad.m4 to generate the arithmetic dnl and shift patterns patterns used in aarch64.ad. dnl -// BEGIN This section of the file is automatically generated. Do not edit -------------- dnl define(`ORL2I', `ifelse($1,I,orL2I)') dnl define(`BASE_SHIFT_INSN', -` +`// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $2$1_reg_$4_reg(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI src3, rFlagsReg cr) %{ @@ -46,9 +46,11 @@ %} ins_pipe(ialu_reg_reg_shift); -%}')dnl +%} +')dnl define(`BASE_INVERTED_INSN', -` +`// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $2$1_reg_not_reg(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_M1 m1, rFlagsReg cr) %{ @@ -68,9 +70,11 @@ %} ins_pipe(ialu_reg_reg); -%}')dnl +%} +')dnl define(`INVERTED_SHIFT_INSN', -` +`// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $2$1_reg_$4_not_reg(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI src3, imm$1_M1 src4, rFlagsReg cr) %{ @@ -91,9 +95,12 @@ %} ins_pipe(ialu_reg_reg_shift); -%}')dnl +%} +')dnl define(`NOT_INSN', -`instruct reg$1_not_reg(iReg$1NoSp dst, +`// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct reg$1_not_reg(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, imm$1_M1 m1, rFlagsReg cr) %{ match(Set dst (Xor$1 src1 m1)); @@ -108,7 +115,8 @@ %} ins_pipe(ialu_reg); -%}')dnl +%} +')dnl dnl define(`BOTH_SHIFT_INSNS', `BASE_SHIFT_INSN(I, $1, ifelse($2,andr,andw,$2w), $3, $4) @@ -120,7 +128,7 @@ dnl define(`BOTH_INVERTED_SHIFT_INSNS', `INVERTED_SHIFT_INSN(I, $1, $2w, $3, $4, ~0, int) -INVERTED_SHIFT_INSN(L, $1, $2, $3, $4, ~0l, long)')dnl +INVERTED_SHIFT_INSN(L, $1, $2, $3, $4, ~0l, jlong)')dnl dnl define(`ALL_SHIFT_KINDS', `BOTH_SHIFT_INSNS($1, $2, URShift, LSR) @@ -147,8 +155,10 @@ ALL_SHIFT_KINDS(Sub, sub) dnl dnl EXTEND mode, rshift_op, src, lshift_count, rshift_count -define(`EXTEND', `($2$1 (LShift$1 $3 $4) $5)') -define(`BFM_INSN',` +define(`EXTEND', `($2$1 (LShift$1 $3 $4) $5)') dnl +define(`BFM_INSN',`// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // Shift Left followed by Shift Right. // This idiom is used by the compiler for the i2b bytecode etc. instruct $4$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI lshift_count, immI rshift_count) @@ -167,7 +177,8 @@ %} ins_pipe(ialu_reg_shift); -%}') +%} +') BFM_INSN(L, 63, RShift, sbfm) BFM_INSN(I, 31, RShift, sbfmw) BFM_INSN(L, 63, URShift, ubfm) @@ -175,7 +186,9 @@ dnl // Bitfield extract with shift & mask define(`BFX_INSN', -`instruct $3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI rshift, imm$1_bitmask mask) +`// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct $3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI rshift, imm$1_bitmask mask) %{ match(Set dst (And$1 ($2$1 src rshift) mask)); // Make sure we are not going to exceed what $3 can do. @@ -185,16 +198,20 @@ format %{ "$3 $dst, $src, $rshift, $mask" %} ins_encode %{ int rshift = $rshift$$constant & $4; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2$6(mask+1); __ $3(as_Register($dst$$reg), as_Register($src$$reg), rshift, width); %} ins_pipe(ialu_reg_shift); -%}') +%} +') BFX_INSN(I, URShift, ubfxw, 31, int) BFX_INSN(L, URShift, ubfx, 63, long, _long) +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + // We can use ubfx when extending an And with a mask when we know mask // is positive. We know that because immI_bitmask guarantees it. instruct ubfxIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask) @@ -207,7 +224,7 @@ format %{ "ubfx $dst, $src, $rshift, $mask" %} ins_encode %{ int rshift = $rshift$$constant & 31; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfx(as_Register($dst$$reg), as_Register($src$$reg), rshift, width); @@ -215,7 +232,10 @@ ins_pipe(ialu_reg_shift); %} -define(`UBFIZ_INSN', `// We can use ubfiz when masking by a positive number and then left shifting the result. +define(`UBFIZ_INSN', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + +// We can use ubfiz when masking by a positive number and then left shifting the result. // We know that the mask is positive because imm$1_bitmask guarantees it. instruct $3$1$8(iReg$2NoSp dst, iReg$1`'ORL2I($1) src, immI lshift, $7 mask) %{ @@ -230,7 +250,7 @@ format %{ "$3 $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & $4; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = $6(mask+1); __ $3(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -243,7 +263,10 @@ UBFIZ_INSN(I, L, ubfizw, 31, int, exact_log2, immI_bitmask, ConvI2L) UBFIZ_INSN(L, I, ubfiz, 63, long, exact_log2_long, immL_positive_bitmaskI, ConvL2I) -define(`BFX1_INSN', `// If there is a convert $1 to $2 block between and And$1 and a LShift$2, we can also match ubfiz +define(`BFX1_INSN', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE + +// If there is a convert $1 to $2 block between and And$1 and a LShift$2, we can also match ubfiz instruct ubfiz$1Conv$3$9(iReg$2NoSp dst, iReg$1`'ORL2I($1) src, immI lshift, $8 mask) %{ match(Set dst (LShift$2 (Conv$3 (And$1 src mask)) lshift)); @@ -253,7 +276,7 @@ format %{ "ubfiz $dst, $src, $lshift, $mask" %} ins_encode %{ int lshift = $lshift$$constant & $6; - long mask = $mask$$constant; + intptr_t mask = $mask$$constant; int width = exact_log2(mask+1); __ ubfiz(as_Register($dst$$reg), as_Register($src$$reg), lshift, width); @@ -275,10 +298,12 @@ ins_pipe(ialu_reg_shift); %} -// Rotations -define(`EXTRACT_INSN', -`instruct extr$3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI lshift, immI rshift, rFlagsReg cr) +// Rotations dnl +define(`EXTRACT_INSN',` +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +instruct extr$3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI lshift, immI rshift, rFlagsReg cr) %{ match(Set dst ($3$1 (LShift$1 src1 lshift) (URShift$1 src2 rshift))); predicate(0 == (((n->in(1)->in(2)->get_int() & $2) + (n->in(2)->in(2)->get_int() & $2)) & $2)); @@ -297,9 +322,10 @@ EXTRACT_INSN(I, 31, Or, extrw) EXTRACT_INSN(L, 63, Add, extr) EXTRACT_INSN(I, 31, Add, extrw) -define(`ROL_EXPAND', ` -// $2 expander +define(`ROL_EXPAND', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +// $2 expander instruct $2$1_rReg(iReg$1NoSp dst, iReg$1 src, iRegI shift, rFlagsReg cr) %{ effect(DEF dst, USE src, USE shift); @@ -312,10 +338,12 @@ rscratch1); %} ins_pipe(ialu_reg_reg_vshift); -%}')dnl -define(`ROR_EXPAND', ` -// $2 expander +%} +') +define(`ROR_EXPAND', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE +// $2 expander instruct $2$1_rReg(iReg$1NoSp dst, iReg$1 src, iRegI shift, rFlagsReg cr) %{ effect(DEF dst, USE src, USE shift); @@ -327,8 +355,10 @@ as_Register($shift$$reg)); %} ins_pipe(ialu_reg_reg_vshift); -%}')dnl -define(ROL_INSN, ` +%} +')dnl +define(ROL_INSN, `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3$1_rReg_Var_C$2(iReg$1NoSp dst, iReg$1 src, iRegI shift, immI$2 c$2, rFlagsReg cr) %{ match(Set dst (Or$1 (LShift$1 src shift) (URShift$1 src (SubI c$2 shift)))); @@ -336,8 +366,10 @@ expand %{ $3$1_rReg(dst, src, shift, cr); %} -%}')dnl -define(ROR_INSN, ` +%} +')dnl +define(ROR_INSN, `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3$1_rReg_Var_C$2(iReg$1NoSp dst, iReg$1 src, iRegI shift, immI$2 c$2, rFlagsReg cr) %{ match(Set dst (Or$1 (URShift$1 src shift) (LShift$1 src (SubI c$2 shift)))); @@ -345,7 +377,8 @@ expand %{ $3$1_rReg(dst, src, shift, cr); %} -%}')dnl +%} +')dnl ROL_EXPAND(L, rol, rorv) ROL_EXPAND(I, rol, rorvw) ROL_INSN(L, _64, rol) @@ -362,6 +395,8 @@ // Add/subtract (extended) dnl ADD_SUB_EXTENDED(mode, size, add node, shift node, insn, shift type, wordsize define(`ADD_SUB_CONV', ` +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3Ext$1(iReg$2NoSp dst, iReg$2`'ORL2I($2) src1, iReg$1`'ORL2I($1) src2, rFlagsReg cr) %{ match(Set dst ($3$2 src1 (ConvI2L src2))); @@ -374,10 +409,12 @@ %} ins_pipe(ialu_reg_reg); %}')dnl -ADD_SUB_CONV(I,L,Add,add,sxtw); -ADD_SUB_CONV(I,L,Sub,sub,sxtw); +ADD_SUB_CONV(I,L,Add,add,sxtw) +ADD_SUB_CONV(I,L,Sub,sub,sxtw) dnl define(`ADD_SUB_EXTENDED', ` +// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3Ext$1_$6(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI_`'eval($7-$2) lshift, immI_`'eval($7-$2) rshift, rFlagsReg cr) %{ match(Set dst ($3$1 src1 EXTEND($1, $4, src2, lshift, rshift))); @@ -389,7 +426,7 @@ as_Register($src2$$reg), ext::$6); %} ins_pipe(ialu_reg_reg); -%}') +%}')dnl ADD_SUB_EXTENDED(I,16,Add,RShift,add,sxth,32) ADD_SUB_EXTENDED(I,8,Add,RShift,add,sxtb,32) ADD_SUB_EXTENDED(I,8,Add,URShift,add,uxtb,32) @@ -399,7 +436,8 @@ ADD_SUB_EXTENDED(L,8,Add,URShift,add,uxtb,64) dnl dnl ADD_SUB_ZERO_EXTEND(mode, size, add node, insn, shift type) -define(`ADD_SUB_ZERO_EXTEND', ` +define(`ADD_SUB_ZERO_EXTEND', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3Ext$1_$5_and(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_$2 mask, rFlagsReg cr) %{ match(Set dst ($3$1 src1 (And$1 src2 mask))); @@ -411,7 +449,8 @@ as_Register($src2$$reg), ext::$5); %} ins_pipe(ialu_reg_reg); -%}') +%} +') dnl ADD_SUB_ZERO_EXTEND(I,255,Add,addw,uxtb) ADD_SUB_ZERO_EXTEND(I,65535,Add,addw,uxth) @@ -426,7 +465,8 @@ ADD_SUB_ZERO_EXTEND(L,4294967295,Sub,sub,uxtw) dnl dnl ADD_SUB_ZERO_EXTEND_SHIFT(mode, size, add node, insn, ext type) -define(`ADD_SUB_EXTENDED_SHIFT', ` +define(`ADD_SUB_EXTENDED_SHIFT', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3Ext$1_$6_shift(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immIExt lshift2, immI_`'eval($7-$2) lshift1, immI_`'eval($7-$2) rshift1, rFlagsReg cr) %{ match(Set dst ($3$1 src1 (LShift$1 EXTEND($1, $4, src2, lshift1, rshift1) lshift2))); @@ -438,7 +478,8 @@ as_Register($src2$$reg), ext::$6, ($lshift2$$constant)); %} ins_pipe(ialu_reg_reg_shift); -%}') +%} +') dnl $1 $2 $3 $4 $5 $6 $7 ADD_SUB_EXTENDED_SHIFT(L,8,Add,RShift,add,sxtb,64) ADD_SUB_EXTENDED_SHIFT(L,16,Add,RShift,add,sxth,64) @@ -455,7 +496,8 @@ ADD_SUB_EXTENDED_SHIFT(I,16,Sub,RShift,subw,sxth,32) dnl dnl ADD_SUB_CONV_SHIFT(mode, add node, insn, ext type) -define(`ADD_SUB_CONV_SHIFT', ` +define(`ADD_SUB_CONV_SHIFT', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $2ExtI_shift(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iRegIorL2I src2, immIExt lshift, rFlagsReg cr) %{ match(Set dst ($2$1 src1 (LShiftL (ConvI2L src2) lshift))); @@ -467,13 +509,14 @@ as_Register($src2$$reg), ext::$4, ($lshift$$constant)); %} ins_pipe(ialu_reg_reg_shift); -%}') -dnl -ADD_SUB_CONV_SHIFT(L,Add,add,sxtw); -ADD_SUB_CONV_SHIFT(L,Sub,sub,sxtw); +%} +')dnl +ADD_SUB_CONV_SHIFT(L,Add,add,sxtw) +ADD_SUB_CONV_SHIFT(L,Sub,sub,sxtw) dnl dnl ADD_SUB_ZERO_EXTEND(mode, size, add node, insn, ext type) -define(`ADD_SUB_ZERO_EXTEND_SHIFT', ` +define(`ADD_SUB_ZERO_EXTEND_SHIFT', `// This pattern is automatically generated from aarch64_ad.m4 +// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE instruct $3Ext$1_$5_and_shift(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_$2 mask, immIExt lshift, rFlagsReg cr) %{ match(Set dst ($3$1 src1 (LShift$1 (And$1 src2 mask) lshift))); @@ -485,8 +528,8 @@ as_Register($src2$$reg), ext::$5, ($lshift$$constant)); %} ins_pipe(ialu_reg_reg_shift); -%}') -dnl +%} +')dnl dnl $1 $2 $3 $4 $5 ADD_SUB_ZERO_EXTEND_SHIFT(L,255,Add,add,uxtb) ADD_SUB_ZERO_EXTEND_SHIFT(L,65535,Add,add,uxth) @@ -502,4 +545,4 @@ ADD_SUB_ZERO_EXTEND_SHIFT(I,255,Sub,subw,uxtb) ADD_SUB_ZERO_EXTEND_SHIFT(I,65535,Sub,subw,uxth) dnl -// END This section of the file is automatically generated. Do not edit -------------- + diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/assembler_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/assembler_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/assembler_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/assembler_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -31,7 +31,7 @@ #include "interpreter/interpreter.hpp" #ifndef PRODUCT -const unsigned long Assembler::asm_bp = 0x00007fffee09ac88; +const uintptr_t Assembler::asm_bp = 0x00007fffee09ac88; #endif #include "compiler/disassembler.hpp" @@ -132,14 +132,14 @@ __ subs(r4, r1, 698u); // subs x4, x1, #698 // LogicalImmOp - __ andw(r28, r19, 4294709247ul); // and w28, w19, #0xfffc0fff - __ orrw(r27, r5, 536870910ul); // orr w27, w5, #0x1ffffffe - __ eorw(r30, r20, 4294840319ul); // eor w30, w20, #0xfffe0fff - __ andsw(r22, r26, 4294959615ul); // ands w22, w26, #0xffffe1ff - __ andr(r5, r7, 4194300ul); // and x5, x7, #0x3ffffc - __ orr(r13, r7, 18014398509481728ul); // orr x13, x7, #0x3fffffffffff00 - __ eor(r7, r9, 18442240474082197503ul); // eor x7, x9, #0xfff0000000003fff - __ ands(r3, r0, 18374686479671656447ul); // ands x3, x0, #0xff00000000007fff + __ andw(r28, r19, 4294709247ull); // and w28, w19, #0xfffc0fff + __ orrw(r27, r5, 536870910ull); // orr w27, w5, #0x1ffffffe + __ eorw(r30, r20, 4294840319ull); // eor w30, w20, #0xfffe0fff + __ andsw(r22, r26, 4294959615ull); // ands w22, w26, #0xffffe1ff + __ andr(r5, r7, 4194300ull); // and x5, x7, #0x3ffffc + __ orr(r13, r7, 18014398509481728ull); // orr x13, x7, #0x3fffffffffff00 + __ eor(r7, r9, 18442240474082197503ull); // eor x7, x9, #0xfff0000000003fff + __ ands(r3, r0, 18374686479671656447ull); // ands x3, x0, #0xff00000000007fff // AbsOp __ b(__ pc()); // b . @@ -1493,7 +1493,7 @@ Disassembler::decode((address)start, (address)start + len); } - JNIEXPORT void das1(unsigned long insn) { + JNIEXPORT void das1(uintptr_t insn) { das(insn, 1); } } @@ -1517,7 +1517,7 @@ break; } case base_plus_offset_reg: { - __ add(r, _base, _index, _ext.op(), MAX(_ext.shift(), 0)); + __ add(r, _base, _index, _ext.op(), MAX2(_ext.shift(), 0)); break; } case literal: { @@ -1532,7 +1532,7 @@ } } -void Assembler::adrp(Register reg1, const Address &dest, unsigned long &byte_offset) { +void Assembler::adrp(Register reg1, const Address &dest, uintptr_t &byte_offset) { ShouldNotReachHere(); } @@ -1541,7 +1541,7 @@ #define starti Instruction_aarch64 do_not_use(this); set_current(&do_not_use) void Assembler::adr(Register Rd, address adr) { - long offset = adr - pc(); + intptr_t offset = adr - pc(); int offset_lo = offset & 3; offset >>= 2; starti; @@ -1552,7 +1552,7 @@ void Assembler::_adrp(Register Rd, address adr) { uint64_t pc_page = (uint64_t)pc() >> 12; uint64_t adr_page = (uint64_t)adr >> 12; - long offset = adr_page - pc_page; + intptr_t offset = adr_page - pc_page; int offset_lo = offset & 3; offset >>= 2; starti; @@ -1701,9 +1701,8 @@ srf(Rn, 5); } -bool Assembler::operand_valid_for_add_sub_immediate(long imm) { - bool shift = false; - unsigned long uimm = uabs(imm); +bool Assembler::operand_valid_for_add_sub_immediate(int64_t imm) { + uint64_t uimm = (uint64_t)uabs(imm); if (uimm < (1 << 12)) return true; if (uimm < (1 << 24) diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/assembler_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/assembler_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/assembler_aarch64.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/assembler_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -199,7 +199,7 @@ return extend(uval, msb - lsb); } - static void patch(address a, int msb, int lsb, unsigned long val) { + static void patch(address a, int msb, int lsb, uint64_t val) { int nbits = msb - lsb + 1; guarantee(val < (1U << nbits), "Field too big for insn"); assert_cond(msb >= lsb); @@ -212,9 +212,9 @@ *(unsigned *)a = target; } - static void spatch(address a, int msb, int lsb, long val) { + static void spatch(address a, int msb, int lsb, int64_t val) { int nbits = msb - lsb + 1; - long chk = val >> (nbits - 1); + int64_t chk = val >> (nbits - 1); guarantee (chk == -1 || chk == 0, "Field too big for insn"); unsigned uval = val; unsigned mask = checked_cast(right_n_bits(nbits)); @@ -245,9 +245,9 @@ f(val, bit, bit); } - void sf(long val, int msb, int lsb) { + void sf(int64_t val, int msb, int lsb) { int nbits = msb - lsb + 1; - long chk = val >> (nbits - 1); + int64_t chk = val >> (nbits - 1); guarantee (chk == -1 || chk == 0, "Field too big for insn"); unsigned uval = val; unsigned mask = checked_cast(right_n_bits(nbits)); @@ -357,7 +357,7 @@ private: Register _base; Register _index; - long _offset; + int64_t _offset; enum mode _mode; extend _ext; @@ -380,9 +380,9 @@ : _base(r), _index(noreg), _offset(0), _mode(base_plus_offset), _target(0) { } Address(Register r, int o) : _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { } - Address(Register r, long o) + Address(Register r, int64_t o) : _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { } - Address(Register r, unsigned long o) + Address(Register r, uint64_t o) : _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { } #ifdef ASSERT Address(Register r, ByteSize disp) @@ -422,7 +422,7 @@ "wrong mode"); return _base; } - long offset() const { + int64_t offset() const { return _offset; } Register index() const { @@ -608,10 +608,10 @@ class Assembler : public AbstractAssembler { #ifndef PRODUCT - static const unsigned long asm_bp; + static const uintptr_t asm_bp; void emit_long(jint x) { - if ((unsigned long)pc() == asm_bp) + if ((uintptr_t)pc() == asm_bp) asm volatile ("nop"); AbstractAssembler::emit_int32(x); } @@ -654,7 +654,7 @@ void f(unsigned val, int msb) { current->f(val, msb, msb); } - void sf(long val, int msb, int lsb) { + void sf(int64_t val, int msb, int lsb) { current->sf(val, msb, lsb); } void rf(Register reg, int lsb) { @@ -704,7 +704,7 @@ wrap_label(Rd, L, &Assembler::_adrp); } - void adrp(Register Rd, const Address &dest, unsigned long &offset); + void adrp(Register Rd, const Address &dest, uint64_t &offset); #undef INSN @@ -830,7 +830,7 @@ // architecture. In debug mode we shrink it in order to test // trampolines, but not so small that branches in the interpreter // are out of range. - static const unsigned long branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); static bool reachable_from_branch_at(address branch, address target) { return uabs(target - branch) < branch_range; @@ -840,7 +840,7 @@ #define INSN(NAME, opcode) \ void NAME(address dest) { \ starti; \ - long offset = (dest - pc()) >> 2; \ + int64_t offset = (dest - pc()) >> 2; \ DEBUG_ONLY(assert(reachable_from_branch_at(pc(), dest), "debug only")); \ f(opcode, 31), f(0b00101, 30, 26), sf(offset, 25, 0); \ } \ @@ -857,7 +857,7 @@ // Compare & branch (immediate) #define INSN(NAME, opcode) \ void NAME(Register Rt, address dest) { \ - long offset = (dest - pc()) >> 2; \ + int64_t offset = (dest - pc()) >> 2; \ starti; \ f(opcode, 31, 24), sf(offset, 23, 5), rf(Rt, 0); \ } \ @@ -875,7 +875,7 @@ // Test & branch (immediate) #define INSN(NAME, opcode) \ void NAME(Register Rt, int bitpos, address dest) { \ - long offset = (dest - pc()) >> 2; \ + int64_t offset = (dest - pc()) >> 2; \ int b5 = bitpos >> 5; \ bitpos &= 0x1f; \ starti; \ @@ -896,7 +896,7 @@ {EQ, NE, HS, CS=HS, LO, CC=LO, MI, PL, VS, VC, HI, LS, GE, LT, GT, LE, AL, NV}; void br(Condition cond, address dest) { - long offset = (dest - pc()) >> 2; + int64_t offset = (dest - pc()) >> 2; starti; f(0b0101010, 31, 25), f(0, 24), sf(offset, 23, 5), f(0, 4), f(cond, 3, 0); } @@ -1275,7 +1275,7 @@ // Load register (literal) #define INSN(NAME, opc, V) \ void NAME(Register Rt, address dest) { \ - long offset = (dest - pc()) >> 2; \ + int64_t offset = (dest - pc()) >> 2; \ starti; \ f(opc, 31, 30), f(0b011, 29, 27), f(V, 26), f(0b00, 25, 24), \ sf(offset, 23, 5); \ @@ -1300,7 +1300,7 @@ #define INSN(NAME, opc, V) \ void NAME(FloatRegister Rt, address dest) { \ - long offset = (dest - pc()) >> 2; \ + int64_t offset = (dest - pc()) >> 2; \ starti; \ f(opc, 31, 30), f(0b011, 29, 27), f(V, 26), f(0b00, 25, 24), \ sf(offset, 23, 5); \ @@ -1315,7 +1315,7 @@ #define INSN(NAME, opc, V) \ void NAME(address dest, prfop op = PLDL1KEEP) { \ - long offset = (dest - pc()) >> 2; \ + int64_t offset = (dest - pc()) >> 2; \ starti; \ f(opc, 31, 30), f(0b011, 29, 27), f(V, 26), f(0b00, 25, 24), \ sf(offset, 23, 5); \ @@ -1391,7 +1391,7 @@ assert(size == 0b10 || size == 0b11, "bad operand size in ldr"); assert(op == 0b01, "literal form can only be used with loads"); f(size & 0b01, 31, 30), f(0b011, 29, 27), f(0b00, 25, 24); - long offset = (adr.target() - pc()) >> 2; + int64_t offset = (adr.target() - pc()) >> 2; sf(offset, 23, 5); code_section()->relocate(pc(), adr.rspec()); return; @@ -2693,7 +2693,7 @@ virtual void bang_stack_with_offset(int offset); static bool operand_valid_for_logical_immediate(bool is32, uint64_t imm); - static bool operand_valid_for_add_sub_immediate(long imm); + static bool operand_valid_for_add_sub_immediate(int64_t imm); static bool operand_valid_for_float_immediate(double imm); void emit_data64(jlong data, relocInfo::relocType rtype, int format = 0); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -1378,7 +1378,7 @@ __ load_klass(klass_RInfo, obj); if (k->is_loaded()) { // See if we get an immediate positive hit - __ ldr(rscratch1, Address(klass_RInfo, long(k->super_check_offset()))); + __ ldr(rscratch1, Address(klass_RInfo, int64_t(k->super_check_offset()))); __ cmp(k_RInfo, rscratch1); if ((juint)in_bytes(Klass::secondary_super_cache_offset()) != k->super_check_offset()) { __ br(Assembler::NE, *failure_target); @@ -2042,7 +2042,7 @@ } else if (code == lir_cmp_l2i) { Label done; __ cmp(left->as_register_lo(), right->as_register_lo()); - __ mov(dst->as_register(), (u_int64_t)-1L); + __ mov(dst->as_register(), (uint64_t)-1L); __ br(Assembler::LT, done); __ csinc(dst->as_register(), zr, zr, Assembler::EQ); __ bind(done); @@ -2314,7 +2314,6 @@ assert(default_type != NULL && default_type->is_array_klass() && default_type->is_loaded(), "must be true at this point"); int elem_size = type2aelembytes(basic_type); - int shift_amount; int scale = exact_log2(elem_size); Address src_length_addr = Address(src, arrayOopDesc::length_offset_in_bytes()); @@ -2704,7 +2703,7 @@ Register res = op->result_opr()->as_register(); assert_different_registers(val, crc, res); - unsigned long offset; + uint64_t offset; __ adrp(res, ExternalAddress(StubRoutines::crc_table_addr()), offset); if (offset) __ add(res, res, offset); @@ -2851,7 +2850,7 @@ } #endif // first time here. Set profile type. - __ ldr(tmp, mdo_addr); + __ str(tmp, mdo_addr); } else { assert(ciTypeEntries::valid_ciklass(current_klass) != NULL && ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent"); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -290,7 +290,7 @@ } -bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { +bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) { if (is_power_of_2(c - 1)) { __ shift_left(left, exact_log2(c - 1), tmp); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/frame_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -284,6 +284,9 @@ tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]", p2i(pc_addr), p2i(*pc_addr), p2i(pc)); } + + // Only generated code frames should be patched, therefore the return address will not be signed. + assert(pauth_ptr_is_raw(*pc_addr), "cannot be signed"); // Either the return address is the original one or we are going to // patch in the same address that's already there. assert(_pc == *pc_addr || pc == *pc_addr, "must be"); @@ -448,7 +451,9 @@ } #endif // COMPILER2_OR_JVMCI - return frame(sender_sp, unextended_sp, link(), sender_pc()); + // Use the raw version of pc - the interpreter should not have signed it. + + return frame(sender_sp, unextended_sp, link(), sender_pc_maybe_signed()); } @@ -511,6 +516,7 @@ // Must be native-compiled frame, i.e. the marshaling code for native // methods that exists in the core system. + return frame(sender_sp(), link(), sender_pc()); } @@ -672,15 +678,15 @@ #define DESCRIBE_FP_OFFSET(name) \ { \ - unsigned long *p = (unsigned long *)fp; \ - printf("0x%016lx 0x%016lx %s\n", (unsigned long)(p + frame::name##_offset), \ + uintptr_t *p = (uintptr_t *)fp; \ + printf("0x%016lx 0x%016lx %s\n", (uintptr_t)(p + frame::name##_offset), \ p[frame::name##_offset], #name); \ } -static __thread unsigned long nextfp; -static __thread unsigned long nextpc; -static __thread unsigned long nextsp; -static __thread RegisterMap *reg_map; +static THREAD_LOCAL_DECL uintptr_t nextfp; +static THREAD_LOCAL_DECL uintptr_t nextpc; +static THREAD_LOCAL_DECL uintptr_t nextsp; +static THREAD_LOCAL_DECL RegisterMap *reg_map; static void printbc(Method *m, intptr_t bcx) { const char *name; @@ -698,7 +704,7 @@ printf("%s : %s ==> %s\n", m->name_and_sig_as_C_string(), buf, name); } -void internal_pf(unsigned long sp, unsigned long fp, unsigned long pc, unsigned long bcx) { +void internal_pf(uintptr_t sp, uintptr_t fp, uintptr_t pc, uintptr_t bcx) { if (! fp) return; @@ -712,7 +718,7 @@ DESCRIBE_FP_OFFSET(interpreter_frame_locals); DESCRIBE_FP_OFFSET(interpreter_frame_bcp); DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp); - unsigned long *p = (unsigned long *)fp; + uintptr_t *p = (uintptr_t *)fp; // We want to see all frames, native and Java. For compiled and // interpreted frames we have special information that allows us to @@ -722,16 +728,16 @@ if (this_frame.is_compiled_frame() || this_frame.is_interpreted_frame()) { frame sender = this_frame.sender(reg_map); - nextfp = (unsigned long)sender.fp(); - nextpc = (unsigned long)sender.pc(); - nextsp = (unsigned long)sender.unextended_sp(); + nextfp = (uintptr_t)sender.fp(); + nextpc = (uintptr_t)sender.pc(); + nextsp = (uintptr_t)sender.unextended_sp(); } else { nextfp = p[frame::link_offset]; nextpc = p[frame::return_addr_offset]; - nextsp = (unsigned long)&p[frame::sender_sp_offset]; + nextsp = (uintptr_t)&p[frame::sender_sp_offset]; } - if (bcx == -1ul) + if (bcx == -1ULL) bcx = p[frame::interpreter_frame_bcp_offset]; if (Interpreter::contains((address)pc)) { @@ -765,8 +771,8 @@ internal_pf (nextsp, nextfp, nextpc, -1); } -extern "C" void pf(unsigned long sp, unsigned long fp, unsigned long pc, - unsigned long bcx, unsigned long thread) { +extern "C" void pf(uintptr_t sp, uintptr_t fp, uintptr_t pc, + uintptr_t bcx, uintptr_t thread) { if (!reg_map) { reg_map = NEW_C_HEAP_OBJ(RegisterMap, mtNone); ::new (reg_map) RegisterMap((JavaThread*)thread, false); @@ -785,9 +791,9 @@ // support for printing out where we are in a Java method // needs to be passed current fp and bcp register values // prints method name, bc index and bytecode name -extern "C" void pm(unsigned long fp, unsigned long bcx) { +extern "C" void pm(uintptr_t fp, uintptr_t bcx) { DESCRIBE_FP_OFFSET(interpreter_frame_method); - unsigned long *p = (unsigned long *)fp; + uintptr_t *p = (uintptr_t *)fp; Method* m = (Method*)p[frame::interpreter_frame_method_offset]; printbc(m, bcx); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/frame_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/frame_aarch64.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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. * @@ -149,6 +149,7 @@ intptr_t* fp() const { return _fp; } inline address* sender_pc_addr() const; + inline address sender_pc_maybe_signed() const; // expression stack tos if we are nested in a java call intptr_t* interpreter_frame_last_sp() const; diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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. * @@ -28,6 +28,7 @@ #include "code/codeCache.hpp" #include "code/vmreg.inline.hpp" +#include "pauth_aarch64.hpp" // Inline functions for AArch64 frames: @@ -45,6 +46,7 @@ static int spin; inline void frame::init(intptr_t* sp, intptr_t* fp, address pc) { + assert(pauth_ptr_is_raw(pc), "cannot be signed"); intptr_t a = intptr_t(sp); intptr_t b = intptr_t(fp); _sp = sp; @@ -69,6 +71,7 @@ } inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) { + assert(pauth_ptr_is_raw(pc), "cannot be signed"); intptr_t a = intptr_t(sp); intptr_t b = intptr_t(fp); _sp = sp; @@ -155,8 +158,9 @@ // Return address: -inline address* frame::sender_pc_addr() const { return (address*) addr_at( return_addr_offset); } -inline address frame::sender_pc() const { return *sender_pc_addr(); } +inline address* frame::sender_pc_addr() const { return (address*) addr_at( return_addr_offset); } +inline address frame::sender_pc_maybe_signed() const { return *sender_pc_addr(); } +inline address frame::sender_pc() const { return pauth_strip_pointer(sender_pc_maybe_signed()); } inline intptr_t* frame::sender_sp() const { return addr_at( sender_sp_offset); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -172,7 +172,7 @@ Label retry; __ bind(retry); { - unsigned long offset; + uint64_t offset; __ adrp(rscratch1, ExternalAddress((address) Universe::heap()->end_addr()), offset); __ ldr(heap_end, Address(rscratch1, offset)); } @@ -181,7 +181,7 @@ // Get the current top of the heap { - unsigned long offset; + uint64_t offset; __ adrp(rscratch1, heap_top, offset); // Use add() here after ARDP, rather than lea(). // lea() does not generate anything if its offset is zero. diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,6 @@ /* - * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as @@ -47,7 +48,16 @@ newval = tmp2; } - ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmpval, newval, /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ false, result); + ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmpval, newval, /*acquire*/ true, /*release*/ true, /*is_cae*/ false, result); + + if (UseBarriersForVolatile) { + // The membar here is necessary to prevent reordering between the + // release store in the CAS above and a subsequent volatile load. + // However for !UseBarriersForVolatile, C1 inserts a full barrier before + // volatile loads which means we don't need an additional barrier + // here (see LIRGenerator::volatile_field_load()). + __ membar(__ AnyAny); + } } #undef __ diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -263,16 +263,9 @@ void ShenandoahBarrierSetAssembler::iu_barrier(MacroAssembler* masm, Register dst, Register tmp) { if (ShenandoahIUBarrier) { - // Save possibly live regs. - RegSet live_regs = RegSet::range(r0, r4) - dst; - __ push(live_regs, sp); - __ strd(v0, __ pre(sp, 2 * -wordSize)); - + __ push_call_clobbered_registers(); satb_write_barrier_pre(masm, noreg, dst, rthread, tmp, true, false); - - // Restore possibly live regs. - __ ldrd(v0, __ post(sp, 2 * wordSize)); - __ pop(live_regs, sp); + __ pop_call_clobbered_registers(); } } @@ -406,9 +399,35 @@ __ bind(done); } - -void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val, - bool acquire, bool release, bool weak, bool is_cae, +// Special Shenandoah CAS implementation that handles false negatives due +// to concurrent evacuation. The service is more complex than a +// traditional CAS operation because the CAS operation is intended to +// succeed if the reference at addr exactly matches expected or if the +// reference at addr holds a pointer to a from-space object that has +// been relocated to the location named by expected. There are two +// races that must be addressed: +// a) A parallel thread may mutate the contents of addr so that it points +// to a different object. In this case, the CAS operation should fail. +// b) A parallel thread may heal the contents of addr, replacing a +// from-space pointer held in addr with the to-space pointer +// representing the new location of the object. +// Upon entry to cmpxchg_oop, it is assured that new_val equals NULL +// or it refers to an object that is not being evacuated out of +// from-space, or it refers to the to-space version of an object that +// is being evacuated out of from-space. +// +// By default the value held in the result register following execution +// of the generated code sequence is 0 to indicate failure of CAS, +// non-zero to indicate success. If is_cae, the result is the value most +// recently fetched from addr rather than a boolean success indicator. +// +// Clobbers rscratch1, rscratch2 +void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm, + Register addr, + Register expected, + Register new_val, + bool acquire, bool release, + bool is_cae, Register result) { Register tmp1 = rscratch1; Register tmp2 = rscratch2; @@ -418,48 +437,123 @@ assert_different_registers(addr, expected, tmp1, tmp2); assert_different_registers(addr, new_val, tmp1, tmp2); - Label retry, done, fail; + Label step4, done; - // CAS, using LL/SC pair. - __ bind(retry); - __ load_exclusive(tmp1, addr, size, acquire); - if (is_narrow) { - __ cmpw(tmp1, expected); - } else { - __ cmp(tmp1, expected); - } - __ br(Assembler::NE, fail); - __ store_exclusive(tmp2, new_val, addr, size, release); - if (weak) { - __ cmpw(tmp2, 0u); // If the store fails, return NE to our caller - } else { - __ cbnzw(tmp2, retry); - } - __ b(done); + // There are two ways to reach this label. Initial entry into the + // cmpxchg_oop code expansion starts at step1 (which is equivalent + // to label step4). Additionally, in the rare case that four steps + // are required to perform the requested operation, the fourth step + // is the same as the first. On a second pass through step 1, + // control may flow through step 2 on its way to failure. It will + // not flow from step 2 to step 3 since we are assured that the + // memory at addr no longer holds a from-space pointer. + // + // The comments that immediately follow the step4 label apply only + // to the case in which control reaches this label by branch from + // step 3. + + __ bind (step4); + + // Step 4. CAS has failed because the value most recently fetched + // from addr is no longer the from-space pointer held in tmp2. If a + // different thread replaced the in-memory value with its equivalent + // to-space pointer, then CAS may still be able to succeed. The + // value held in the expected register has not changed. + // + // It is extremely rare we reach this point. For this reason, the + // implementation opts for smaller rather than potentially faster + // code. Ultimately, smaller code for this rare case most likely + // delivers higher overall throughput by enabling improved icache + // performance. + + // Step 1. Fast-path. + // + // Try to CAS with given arguments. If successful, then we are done. + // + // No label required for step 1. + + __ cmpxchg(addr, expected, new_val, size, acquire, release, false, tmp2); + // EQ flag set iff success. tmp2 holds value fetched. + + // If expected equals null but tmp2 does not equal null, the + // following branches to done to report failure of CAS. If both + // expected and tmp2 equal null, the following branches to done to + // report success of CAS. There's no need for a special test of + // expected equal to null. + + __ br(Assembler::EQ, done); + // if CAS failed, fall through to step 2 + + // Step 2. CAS has failed because the value held at addr does not + // match expected. This may be a false negative because the value fetched + // from addr (now held in tmp2) may be a from-space pointer to the + // original copy of same object referenced by to-space pointer expected. + // + // To resolve this, it suffices to find the forward pointer associated + // with fetched value. If this matches expected, retry CAS with new + // parameters. If this mismatches, then we have a legitimate + // failure, and we're done. + // + // No need for step2 label. + + // overwrite tmp1 with from-space pointer fetched from memory + __ mov(tmp1, tmp2); - __ bind(fail); - // Check if rb(expected)==rb(tmp1) - // Shuffle registers so that we have memory value ready for next expected. - __ mov(tmp2, expected); - __ mov(expected, tmp1); if (is_narrow) { + // Decode tmp1 in order to resolve its forward pointer __ decode_heap_oop(tmp1, tmp1); - __ decode_heap_oop(tmp2, tmp2); } resolve_forward_pointer(masm, tmp1); - resolve_forward_pointer(masm, tmp2); - __ cmp(tmp1, tmp2); - // Retry with expected now being the value we just loaded from addr. - __ br(Assembler::EQ, retry); - if (is_cae && is_narrow) { - // For cmp-and-exchange and narrow oops, we need to restore - // the compressed old-value. We moved it to 'expected' a few lines up. - __ mov(tmp1, expected); + // Encode tmp1 to compare against expected. + __ encode_heap_oop(tmp1, tmp1); + + // Does forwarded value of fetched from-space pointer match original + // value of expected? If tmp1 holds null, this comparison will fail + // because we know from step1 that expected is not null. There is + // no need for a separate test for tmp1 (the value originally held + // in memory) equal to null. + __ cmp(tmp1, expected); + + // If not, then the failure was legitimate and we're done. + // Branching to done with NE condition denotes failure. + __ br(Assembler::NE, done); + + // Fall through to step 3. No need for step3 label. + + // Step 3. We've confirmed that the value originally held in memory + // (now held in tmp2) pointed to from-space version of original + // expected value. Try the CAS again with the from-space expected + // value. If it now succeeds, we're good. + // + // Note: tmp2 holds encoded from-space pointer that matches to-space + // object residing at expected. tmp2 is the new "expected". + + // Note that macro implementation of __cmpxchg cannot use same register + // tmp2 for result and expected since it overwrites result before it + // compares result with expected. + __ cmpxchg(addr, tmp2, new_val, size, acquire, release, false, noreg); + // EQ flag set iff success. tmp2 holds value fetched, tmp1 (rscratch1) clobbered. + + // If fetched value did not equal the new expected, this could + // still be a false negative because some other thread may have + // newly overwritten the memory value with its to-space equivalent. + __ br(Assembler::NE, step4); + + if (is_cae) { + // We're falling through to done to indicate success. Success + // with is_cae is denoted by returning the value of expected as + // result. + __ mov(tmp2, expected); } + __ bind(done); + // At entry to done, the Z (EQ) flag is on iff if the CAS + // operation was successful. Additionally, if is_cae, tmp2 holds + // the value most recently fetched from addr. In this case, success + // is denoted by tmp2 matching expected. if (is_cae) { - __ mov(result, tmp1); + __ mov(result, tmp2); } else { __ cset(result, Assembler::EQ); } @@ -562,9 +656,7 @@ // Is marking still active? Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset())); __ ldrb(tmp, gc_state); - __ mov(rscratch2, ShenandoahHeap::MARKING); - __ tst(tmp, rscratch2); - __ br(Assembler::EQ, done); + __ tbz(tmp, ShenandoahHeap::MARKING_BITPOS, done); // Can we store original value in the thread's buffer? __ ldr(tmp, queue_index); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -82,7 +82,7 @@ virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); virtual void cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val, - bool acquire, bool release, bool weak, bool is_cae, Register result); + bool acquire, bool release, bool is_cae, Register result); virtual void barrier_stubs_init(); }; diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad 2021-10-12 20:42:15.000000000 +0000 @@ -33,7 +33,7 @@ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register); + /*acquire*/ false, /*release*/ true, /*is_cae*/ false, $res$$Register); %} enc_class aarch64_enc_cmpxchg_acq_oop_shenandoah(memory mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, iRegINoSp res) %{ @@ -42,7 +42,7 @@ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - /*acquire*/ true, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register); + /*acquire*/ true, /*release*/ true, /*is_cae*/ false, $res$$Register); %} %} @@ -76,7 +76,7 @@ ins_encode %{ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register); + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ false, /*release*/ true, /*is_cae*/ false, $res$$Register); %} ins_pipe(pipe_slow); @@ -114,7 +114,7 @@ ins_encode %{ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ true, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register); + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ true, /*release*/ true, /*is_cae*/ false, $res$$Register); %} ins_pipe(pipe_slow); @@ -131,7 +131,7 @@ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ true, $res$$Register); + /*acquire*/ false, /*release*/ true, /*is_cae*/ true, $res$$Register); %} ins_pipe(pipe_slow); %} @@ -147,7 +147,7 @@ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ true, $res$$Register); + /*acquire*/ false, /*release*/ true, /*is_cae*/ true, $res$$Register); %} ins_pipe(pipe_slow); %} @@ -162,8 +162,9 @@ ins_encode %{ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. + // Weak is not currently supported by ShenandoahBarrierSet::cmpxchg_oop ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - /*acquire*/ false, /*release*/ true, /*weak*/ true, /*is_cae*/ false, $res$$Register); + /*acquire*/ false, /*release*/ true, /*is_cae*/ false, $res$$Register); %} ins_pipe(pipe_slow); %} @@ -178,8 +179,9 @@ ins_encode %{ Register tmp = $tmp$$Register; __ mov(tmp, $oldval$$Register); // Must not clobber oldval. + // Weak is not currently supported by ShenandoahBarrierSet::cmpxchg_oop ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - /*acquire*/ false, /*release*/ true, /*weak*/ true, /*is_cae*/ false, $res$$Register); + /*acquire*/ false, /*release*/ true, /*is_cae*/ false, $res$$Register); %} ins_pipe(pipe_slow); %} diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/immediate_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/immediate_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/immediate_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/immediate_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -23,6 +23,7 @@ */ #include +#include #include "immediate_aarch64.hpp" // there are at most 2^13 possible logical immediate encodings @@ -34,14 +35,14 @@ // for forward lookup we just use a direct array lookup // and assume that the cient has supplied a valid encoding // table[encoding] = immediate -static u_int64_t LITable[LI_TABLE_SIZE]; +static uint64_t LITable[LI_TABLE_SIZE]; // for reverse lookup we need a sparse map so we store a table of // immediate and encoding pairs sorted by immediate value struct li_pair { - u_int64_t immediate; - u_int32_t encoding; + uint64_t immediate; + uint32_t encoding; }; static struct li_pair InverseLITable[LI_TABLE_SIZE]; @@ -63,9 +64,9 @@ // helper functions used by expandLogicalImmediate // for i = 1, ... N result = 1 other bits are zero -static inline u_int64_t ones(int N) +static inline uint64_t ones(int N) { - return (N == 64 ? (u_int64_t)-1UL : ((1UL << N) - 1)); + return (N == 64 ? -1ULL : (1ULL << N) - 1); } /* @@ -73,49 +74,49 @@ */ // 32 bit mask with bits [hi,...,lo] set -static inline u_int32_t mask32(int hi = 31, int lo = 0) +static inline uint32_t mask32(int hi = 31, int lo = 0) { int nbits = (hi + 1) - lo; return ((1 << nbits) - 1) << lo; } -static inline u_int64_t mask64(int hi = 63, int lo = 0) +static inline uint64_t mask64(int hi = 63, int lo = 0) { int nbits = (hi + 1) - lo; return ((1L << nbits) - 1) << lo; } // pick bits [hi,...,lo] from val -static inline u_int32_t pick32(u_int32_t val, int hi = 31, int lo = 0) +static inline uint32_t pick32(uint32_t val, int hi = 31, int lo = 0) { return (val & mask32(hi, lo)); } // pick bits [hi,...,lo] from val -static inline u_int64_t pick64(u_int64_t val, int hi = 31, int lo = 0) +static inline uint64_t pick64(uint64_t val, int hi = 31, int lo = 0) { return (val & mask64(hi, lo)); } // mask [hi,lo] and shift down to start at bit 0 -static inline u_int32_t pickbits32(u_int32_t val, int hi = 31, int lo = 0) +static inline uint32_t pickbits32(uint32_t val, int hi = 31, int lo = 0) { return (pick32(val, hi, lo) >> lo); } // mask [hi,lo] and shift down to start at bit 0 -static inline u_int64_t pickbits64(u_int64_t val, int hi = 63, int lo = 0) +static inline uint64_t pickbits64(uint64_t val, int hi = 63, int lo = 0) { return (pick64(val, hi, lo) >> lo); } // result<0> to val -static inline u_int64_t pickbit(u_int64_t val, int N) +static inline uint64_t pickbit(uint64_t val, int N) { return pickbits64(val, N, N); } -static inline u_int32_t uimm(u_int32_t val, int hi, int lo) +static inline uint32_t uimm(uint32_t val, int hi, int lo) { return pickbits32(val, hi, lo); } @@ -123,11 +124,11 @@ // SPEC bits(M*N) Replicate(bits(M) x, integer N); // this is just an educated guess -u_int64_t replicate(u_int64_t bits, int nbits, int count) +uint64_t replicate(uint64_t bits, int nbits, int count) { - u_int64_t result = 0; + uint64_t result = 0; // nbits may be 64 in which case we want mask to be -1 - u_int64_t mask = ones(nbits); + uint64_t mask = ones(nbits); for (int i = 0; i < count ; i++) { result <<= nbits; result |= (bits & mask); @@ -140,24 +141,24 @@ // encoding must be treated as an UNALLOC instruction // construct a 32 bit immediate value for a logical immediate operation -int expandLogicalImmediate(u_int32_t immN, u_int32_t immr, - u_int32_t imms, u_int64_t &bimm) +int expandLogicalImmediate(uint32_t immN, uint32_t immr, + uint32_t imms, uint64_t &bimm) { - int len; // ought to be <= 6 - u_int32_t levels; // 6 bits - u_int32_t tmask_and; // 6 bits - u_int32_t wmask_and; // 6 bits - u_int32_t tmask_or; // 6 bits - u_int32_t wmask_or; // 6 bits - u_int64_t imm64; // 64 bits - u_int64_t tmask, wmask; // 64 bits - u_int32_t S, R, diff; // 6 bits? + int len; // ought to be <= 6 + uint32_t levels; // 6 bits + uint32_t tmask_and; // 6 bits + uint32_t wmask_and; // 6 bits + uint32_t tmask_or; // 6 bits + uint32_t wmask_or; // 6 bits + uint64_t imm64; // 64 bits + uint64_t tmask, wmask; // 64 bits + uint32_t S, R, diff; // 6 bits? if (immN == 1) { len = 6; // looks like 7 given the spec above but this cannot be! } else { len = 0; - u_int32_t val = (~imms & 0x3f); + uint32_t val = (~imms & 0x3f); for (int i = 5; i > 0; i--) { if (val & (1 << i)) { len = i; @@ -170,7 +171,7 @@ // for valid inputs leading 1s in immr must be less than leading // zeros in imms int len2 = 0; // ought to be < len - u_int32_t val2 = (~immr & 0x3f); + uint32_t val2 = (~immr & 0x3f); for (int i = 5; i > 0; i--) { if (!(val2 & (1 << i))) { len2 = i; @@ -199,12 +200,12 @@ for (int i = 0; i < 6; i++) { int nbits = 1 << i; - u_int64_t and_bit = pickbit(tmask_and, i); - u_int64_t or_bit = pickbit(tmask_or, i); - u_int64_t and_bits_sub = replicate(and_bit, 1, nbits); - u_int64_t or_bits_sub = replicate(or_bit, 1, nbits); - u_int64_t and_bits_top = (and_bits_sub << nbits) | ones(nbits); - u_int64_t or_bits_top = (0 << nbits) | or_bits_sub; + uint64_t and_bit = pickbit(tmask_and, i); + uint64_t or_bit = pickbit(tmask_or, i); + uint64_t and_bits_sub = replicate(and_bit, 1, nbits); + uint64_t or_bits_sub = replicate(or_bit, 1, nbits); + uint64_t and_bits_top = (and_bits_sub << nbits) | ones(nbits); + uint64_t or_bits_top = (0 << nbits) | or_bits_sub; tmask = ((tmask & (replicate(and_bits_top, 2 * nbits, 32 / nbits))) @@ -218,12 +219,12 @@ for (int i = 0; i < 6; i++) { int nbits = 1 << i; - u_int64_t and_bit = pickbit(wmask_and, i); - u_int64_t or_bit = pickbit(wmask_or, i); - u_int64_t and_bits_sub = replicate(and_bit, 1, nbits); - u_int64_t or_bits_sub = replicate(or_bit, 1, nbits); - u_int64_t and_bits_top = (ones(nbits) << nbits) | and_bits_sub; - u_int64_t or_bits_top = (or_bits_sub << nbits) | 0; + uint64_t and_bit = pickbit(wmask_and, i); + uint64_t or_bit = pickbit(wmask_or, i); + uint64_t and_bits_sub = replicate(and_bit, 1, nbits); + uint64_t or_bits_sub = replicate(or_bit, 1, nbits); + uint64_t and_bits_top = (ones(nbits) << nbits) | and_bits_sub; + uint64_t or_bits_top = (or_bits_sub << nbits) | 0; wmask = ((wmask & (replicate(and_bits_top, 2 * nbits, 32 / nbits))) @@ -248,9 +249,9 @@ { li_table_entry_count = 0; for (unsigned index = 0; index < LI_TABLE_SIZE; index++) { - u_int32_t N = uimm(index, 12, 12); - u_int32_t immr = uimm(index, 11, 6); - u_int32_t imms = uimm(index, 5, 0); + uint32_t N = uimm(index, 12, 12); + uint32_t immr = uimm(index, 11, 6); + uint32_t imms = uimm(index, 5, 0); if (expandLogicalImmediate(N, immr, imms, LITable[index])) { InverseLITable[li_table_entry_count].immediate = LITable[index]; InverseLITable[li_table_entry_count].encoding = index; @@ -264,12 +265,12 @@ // public APIs provided for logical immediate lookup and reverse lookup -u_int64_t logical_immediate_for_encoding(u_int32_t encoding) +uint64_t logical_immediate_for_encoding(uint32_t encoding) { return LITable[encoding]; } -u_int32_t encoding_for_logical_immediate(u_int64_t immediate) +uint32_t encoding_for_logical_immediate(uint64_t immediate) { struct li_pair pair; struct li_pair *result; @@ -293,15 +294,15 @@ // fpimm[3:0] = fraction (assuming leading 1) // i.e. F = s * 1.f * 2^(e - b) -u_int64_t fp_immediate_for_encoding(u_int32_t imm8, int is_dp) +uint64_t fp_immediate_for_encoding(uint32_t imm8, int is_dp) { union { float fpval; double dpval; - u_int64_t val; + uint64_t val; }; - u_int32_t s, e, f; + uint32_t s, e, f; s = (imm8 >> 7 ) & 0x1; e = (imm8 >> 4) & 0x7; f = imm8 & 0xf; @@ -329,7 +330,7 @@ return val; } -u_int32_t encoding_for_fp_immediate(float immediate) +uint32_t encoding_for_fp_immediate(float immediate) { // given a float which is of the form // @@ -341,10 +342,10 @@ union { float fpval; - u_int32_t val; + uint32_t val; }; fpval = immediate; - u_int32_t s, r, f, res; + uint32_t s, r, f, res; // sign bit is 31 s = (val >> 31) & 0x1; // exponent is bits 30-23 but we only want the bottom 3 bits diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/immediate_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/immediate_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/immediate_aarch64.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/immediate_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -46,9 +46,9 @@ * encoding then a map lookup will return 0xffffffff. */ -u_int64_t logical_immediate_for_encoding(u_int32_t encoding); -u_int32_t encoding_for_logical_immediate(u_int64_t immediate); -u_int64_t fp_immediate_for_encoding(u_int32_t imm8, int is_dp); -u_int32_t encoding_for_fp_immediate(float immediate); +uint64_t logical_immediate_for_encoding(uint32_t encoding); +uint32_t encoding_for_logical_immediate(uint64_t immediate); +uint64_t fp_immediate_for_encoding(uint32_t imm8, int is_dp); +uint32_t encoding_for_fp_immediate(float immediate); #endif // _IMMEDIATE_H diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -168,7 +168,7 @@ } void InterpreterMacroAssembler::get_dispatch() { - unsigned long offset; + uint64_t offset; adrp(rdispatch, ExternalAddress((address)Interpreter::dispatch_table()), offset); lea(rdispatch, Address(rdispatch, offset)); } @@ -759,7 +759,7 @@ // copy mov(rscratch1, sp); sub(swap_reg, swap_reg, rscratch1); - ands(swap_reg, swap_reg, (unsigned long)(7 - os::vm_page_size())); + ands(swap_reg, swap_reg, (uint64_t)(7 - os::vm_page_size())); // Save the test result, for recursive case, the result is zero str(swap_reg, Address(lock_reg, mark_offset)); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -347,7 +347,7 @@ if (_num_fp_args < Argument::n_float_register_parameters_c) { *_fp_args++ = from_obj; - *_fp_identifiers |= (1 << _num_fp_args); // mark as double + *_fp_identifiers |= (1ull << _num_fp_args); // mark as double _num_fp_args++; } else { *_to++ = from_obj; @@ -383,7 +383,7 @@ // handle arguments SlowSignatureHandler ssh(m, (address)from, to); - ssh.iterate(UCONST64(-1)); + ssh.iterate((uint64_t)CONST64(-1)); // return result handler return Interpreter::result_handler(m->result_type()); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -73,7 +73,7 @@ Label slow; - unsigned long offset; + uint64_t offset; __ adrp(rcounter_addr, SafepointSynchronize::safepoint_counter_addr(), offset); Address safepoint_counter_addr(rcounter_addr, offset); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -70,8 +70,8 @@ // Return the total length (in bytes) of the instructions. int MacroAssembler::pd_patch_instruction_size(address branch, address target) { int instructions = 1; - assert((uint64_t)target < (1ul << 48), "48-bit overflow in address constant"); - long offset = (target - branch) >> 2; + assert((uint64_t)target < (1ull << 48), "48-bit overflow in address constant"); + intptr_t offset = (target - branch) >> 2; unsigned insn = *(unsigned*)branch; if ((Instruction_aarch64::extract(insn, 29, 24) & 0b111011) == 0b011000) { // Load register (literal) @@ -93,7 +93,7 @@ offset = target-branch; int shift = Instruction_aarch64::extract(insn, 31, 31); if (shift) { - u_int64_t dest = (u_int64_t)target; + uint64_t dest = (uint64_t)target; uint64_t pc_page = (uint64_t)branch >> 12; uint64_t adr_page = (uint64_t)target >> 12; unsigned offset_lo = dest & 0xfff; @@ -134,9 +134,9 @@ Instruction_aarch64::extract(insn2, 4, 0)) { // movk #imm16<<32 Instruction_aarch64::patch(branch + 4, 20, 5, (uint64_t)target >> 32); - long dest = ((long)target & 0xffffffffL) | ((long)branch & 0xffff00000000L); - long pc_page = (long)branch >> 12; - long adr_page = (long)dest >> 12; + uintptr_t dest = ((uintptr_t)target & 0xffffffffULL) | ((uintptr_t)branch & 0xffff00000000ULL); + uintptr_t pc_page = (uintptr_t)branch >> 12; + uintptr_t adr_page = (uintptr_t)dest >> 12; offset = adr_page - pc_page; instructions = 2; } @@ -146,7 +146,7 @@ Instruction_aarch64::spatch(branch, 23, 5, offset); Instruction_aarch64::patch(branch, 30, 29, offset_lo); } else if (Instruction_aarch64::extract(insn, 31, 21) == 0b11010010100) { - u_int64_t dest = (u_int64_t)target; + uint64_t dest = (uint64_t)target; // Move wide constant assert(nativeInstruction_at(branch+4)->is_movk(), "wrong insns in patch"); assert(nativeInstruction_at(branch+8)->is_movk(), "wrong insns in patch"); @@ -205,7 +205,7 @@ } address MacroAssembler::target_addr_for_insn(address insn_addr, unsigned insn) { - long offset = 0; + intptr_t offset = 0; if ((Instruction_aarch64::extract(insn, 29, 24) & 0b011011) == 0b00011000) { // Load register (literal) offset = Instruction_aarch64::sextract(insn, 23, 5); @@ -272,13 +272,13 @@ ShouldNotReachHere(); } } else if (Instruction_aarch64::extract(insn, 31, 23) == 0b110100101) { - u_int32_t *insns = (u_int32_t *)insn_addr; + uint32_t *insns = (uint32_t *)insn_addr; // Move wide constant: movz, movk, movk. See movptr(). assert(nativeInstruction_at(insns+1)->is_movk(), "wrong insns in patch"); assert(nativeInstruction_at(insns+2)->is_movk(), "wrong insns in patch"); - return address(u_int64_t(Instruction_aarch64::extract(insns[0], 20, 5)) - + (u_int64_t(Instruction_aarch64::extract(insns[1], 20, 5)) << 16) - + (u_int64_t(Instruction_aarch64::extract(insns[2], 20, 5)) << 32)); + return address(uint64_t(Instruction_aarch64::extract(insns[0], 20, 5)) + + (uint64_t(Instruction_aarch64::extract(insns[1], 20, 5)) << 16) + + (uint64_t(Instruction_aarch64::extract(insns[2], 20, 5)) << 32)); } else if (Instruction_aarch64::extract(insn, 31, 22) == 0b1011100101 && Instruction_aarch64::extract(insn, 4, 0) == 0b11111) { return 0; @@ -405,7 +405,7 @@ assert(CodeCache::find_blob(entry.target()) != NULL, "destination of far call not found in code cache"); if (far_branches()) { - unsigned long offset; + uintptr_t offset; // We can use ADRP here because we know that the total size of // the code cache cannot exceed 2Gb. adrp(tmp, entry, offset); @@ -423,7 +423,7 @@ assert(CodeCache::find_blob(entry.target()) != NULL, "destination of far call not found in code cache"); if (far_branches()) { - unsigned long offset; + uintptr_t offset; // We can use ADRP here because we know that the total size of // the code cache cannot exceed 2Gb. adrp(tmp, entry, offset); @@ -847,7 +847,7 @@ address MacroAssembler::ic_call(address entry, jint method_index) { RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index); // address const_ptr = long_constant((jlong)Universe::non_oop_word()); - // unsigned long offset; + // uintptr_t offset; // ldr_constant(rscratch2, const_ptr); movptr(rscratch2, (uintptr_t)Universe::non_oop_word()); return trampoline_call(Address(entry, rh)); @@ -1480,7 +1480,7 @@ void MacroAssembler::mov(Register r, Address dest) { code_section()->relocate(pc(), dest.rspec()); - u_int64_t imm64 = (u_int64_t)dest.target(); + uint64_t imm64 = (uint64_t)dest.target(); movptr(r, imm64); } @@ -1496,7 +1496,7 @@ block_comment(buffer); } #endif - assert(imm64 < (1ul << 48), "48-bit overflow in address constant"); + assert(imm64 < (1ull << 48), "48-bit overflow in address constant"); movz(r, imm64 & 0xffff); imm64 >>= 16; movk(r, imm64 & 0xffff, 16); @@ -1513,20 +1513,20 @@ // imm32 == hex abcdefgh T2S: Vd = abcdefghabcdefgh // imm32 == hex abcdefgh T4S: Vd = abcdefghabcdefghabcdefghabcdefgh // T1D/T2D: invalid -void MacroAssembler::mov(FloatRegister Vd, SIMD_Arrangement T, u_int32_t imm32) { +void MacroAssembler::mov(FloatRegister Vd, SIMD_Arrangement T, uint32_t imm32) { assert(T != T1D && T != T2D, "invalid arrangement"); if (T == T8B || T == T16B) { assert((imm32 & ~0xff) == 0, "extraneous bits in unsigned imm32 (T8B/T16B)"); movi(Vd, T, imm32 & 0xff, 0); return; } - u_int32_t nimm32 = ~imm32; + uint32_t nimm32 = ~imm32; if (T == T4H || T == T8H) { assert((imm32 & ~0xffff) == 0, "extraneous bits in unsigned imm32 (T4H/T8H)"); imm32 &= 0xffff; nimm32 &= 0xffff; } - u_int32_t x = imm32; + uint32_t x = imm32; int movi_cnt = 0; int movn_cnt = 0; while (x) { if (x & 0xff) movi_cnt++; x >>= 8; } @@ -1550,7 +1550,7 @@ } } -void MacroAssembler::mov_immediate64(Register dst, u_int64_t imm64) +void MacroAssembler::mov_immediate64(Register dst, uint64_t imm64) { #ifndef PRODUCT { @@ -1564,7 +1564,7 @@ } else { // we can use a combination of MOVZ or MOVN with // MOVK to build up the constant - u_int64_t imm_h[4]; + uint64_t imm_h[4]; int zero_count = 0; int neg_count = 0; int i; @@ -1585,7 +1585,7 @@ } else if (zero_count == 3) { for (i = 0; i < 4; i++) { if (imm_h[i] != 0L) { - movz(dst, (u_int32_t)imm_h[i], (i << 4)); + movz(dst, (uint32_t)imm_h[i], (i << 4)); break; } } @@ -1593,7 +1593,7 @@ // one MOVN will do for (int i = 0; i < 4; i++) { if (imm_h[i] != 0xffffL) { - movn(dst, (u_int32_t)imm_h[i] ^ 0xffffL, (i << 4)); + movn(dst, (uint32_t)imm_h[i] ^ 0xffffL, (i << 4)); break; } } @@ -1601,69 +1601,69 @@ // one MOVZ and one MOVK will do for (i = 0; i < 3; i++) { if (imm_h[i] != 0L) { - movz(dst, (u_int32_t)imm_h[i], (i << 4)); + movz(dst, (uint32_t)imm_h[i], (i << 4)); i++; break; } } for (;i < 4; i++) { if (imm_h[i] != 0L) { - movk(dst, (u_int32_t)imm_h[i], (i << 4)); + movk(dst, (uint32_t)imm_h[i], (i << 4)); } } } else if (neg_count == 2) { // one MOVN and one MOVK will do for (i = 0; i < 4; i++) { if (imm_h[i] != 0xffffL) { - movn(dst, (u_int32_t)imm_h[i] ^ 0xffffL, (i << 4)); + movn(dst, (uint32_t)imm_h[i] ^ 0xffffL, (i << 4)); i++; break; } } for (;i < 4; i++) { if (imm_h[i] != 0xffffL) { - movk(dst, (u_int32_t)imm_h[i], (i << 4)); + movk(dst, (uint32_t)imm_h[i], (i << 4)); } } } else if (zero_count == 1) { // one MOVZ and two MOVKs will do for (i = 0; i < 4; i++) { if (imm_h[i] != 0L) { - movz(dst, (u_int32_t)imm_h[i], (i << 4)); + movz(dst, (uint32_t)imm_h[i], (i << 4)); i++; break; } } for (;i < 4; i++) { if (imm_h[i] != 0x0L) { - movk(dst, (u_int32_t)imm_h[i], (i << 4)); + movk(dst, (uint32_t)imm_h[i], (i << 4)); } } } else if (neg_count == 1) { // one MOVN and two MOVKs will do for (i = 0; i < 4; i++) { if (imm_h[i] != 0xffffL) { - movn(dst, (u_int32_t)imm_h[i] ^ 0xffffL, (i << 4)); + movn(dst, (uint32_t)imm_h[i] ^ 0xffffL, (i << 4)); i++; break; } } for (;i < 4; i++) { if (imm_h[i] != 0xffffL) { - movk(dst, (u_int32_t)imm_h[i], (i << 4)); + movk(dst, (uint32_t)imm_h[i], (i << 4)); } } } else { // use a MOVZ and 3 MOVKs (makes it easier to debug) - movz(dst, (u_int32_t)imm_h[0], 0); + movz(dst, (uint32_t)imm_h[0], 0); for (i = 1; i < 4; i++) { - movk(dst, (u_int32_t)imm_h[i], (i << 4)); + movk(dst, (uint32_t)imm_h[i], (i << 4)); } } } } -void MacroAssembler::mov_immediate32(Register dst, u_int32_t imm32) +void MacroAssembler::mov_immediate32(Register dst, uint32_t imm32) { #ifndef PRODUCT { @@ -1677,7 +1677,7 @@ } else { // we can use MOVZ, MOVN or two calls to MOVK to build up the // constant - u_int32_t imm_h[2]; + uint32_t imm_h[2]; imm_h[0] = imm32 & 0xffff; imm_h[1] = ((imm32 >> 16) & 0xffff); if (imm_h[0] == 0) { @@ -1700,7 +1700,7 @@ // not actually be used: you must use the Address that is returned. // It is up to you to ensure that the shift provided matches the size // of your data. -Address MacroAssembler::form_address(Register Rd, Register base, long byte_offset, int shift) { +Address MacroAssembler::form_address(Register Rd, Register base, int64_t byte_offset, int shift) { if (Address::offset_ok_for_immed(byte_offset, shift)) // It fits; no need for any heroics return Address(base, byte_offset); @@ -1715,9 +1715,9 @@ // See if we can do this with two 12-bit offsets { - unsigned long word_offset = byte_offset >> shift; - unsigned long masked_offset = word_offset & 0xfff000; - if (Address::offset_ok_for_immed(word_offset - masked_offset) + uint64_t word_offset = byte_offset >> shift; + uint64_t masked_offset = word_offset & 0xfff000; + if (Address::offset_ok_for_immed(word_offset - masked_offset, 0) && Assembler::operand_valid_for_add_sub_immediate(masked_offset << shift)) { add(Rd, base, masked_offset << shift); word_offset -= masked_offset; @@ -1957,7 +1957,7 @@ if (value < (1 << 12)) { sub(reg, reg, value); return; } /* else */ { assert(reg != rscratch2, "invalid dst for register decrement"); - mov(rscratch2, (unsigned long)value); + mov(rscratch2, (uint64_t)value); sub(reg, reg, rscratch2); } } @@ -2638,19 +2638,19 @@ // Returns true if it is, else false. bool MacroAssembler::merge_alignment_check(Register base, size_t size, - long cur_offset, - long prev_offset) const { + int64_t cur_offset, + int64_t prev_offset) const { if (AvoidUnalignedAccesses) { if (base == sp) { // Checks whether low offset if aligned to pair of registers. - long pair_mask = size * 2 - 1; - long offset = prev_offset > cur_offset ? cur_offset : prev_offset; + int64_t pair_mask = size * 2 - 1; + int64_t offset = prev_offset > cur_offset ? cur_offset : prev_offset; return (offset & pair_mask) == 0; } else { // If base is not sp, we can't guarantee the access is aligned. return false; } } else { - long mask = size - 1; + int64_t mask = size - 1; // Load/store pair instruction only supports element size aligned offset. return (cur_offset & mask) == 0 && (prev_offset & mask) == 0; } @@ -2683,8 +2683,8 @@ return false; } - long max_offset = 63 * prev_size_in_bytes; - long min_offset = -64 * prev_size_in_bytes; + int64_t max_offset = 63 * prev_size_in_bytes; + int64_t min_offset = -64 * prev_size_in_bytes; assert(prev_ldst->is_not_pre_post_index(), "pre-index or post-index is not supported to be merged."); @@ -2693,8 +2693,8 @@ return false; } - long cur_offset = adr.offset(); - long prev_offset = prev_ldst->offset(); + int64_t cur_offset = adr.offset(); + int64_t prev_offset = prev_ldst->offset(); size_t diff = abs(cur_offset - prev_offset); if (diff != prev_size_in_bytes) { return false; @@ -2711,7 +2711,7 @@ return false; } - long low_offset = prev_offset > cur_offset ? cur_offset : prev_offset; + int64_t low_offset = prev_offset > cur_offset ? cur_offset : prev_offset; // Offset range must be in ldp/stp instruction's range. if (low_offset > max_offset || low_offset < min_offset) { return false; @@ -2736,7 +2736,7 @@ address prev = pc() - NativeInstruction::instruction_size; NativeLdSt* prev_ldst = NativeLdSt_at(prev); - long offset; + int64_t offset; if (adr.offset() < prev_ldst->offset()) { offset = adr.offset(); @@ -3282,7 +3282,7 @@ Register table0, Register table1, Register table2, Register table3, Register tmp, Register tmp2, Register tmp3) { Label L_by16, L_by16_loop, L_by4, L_by4_loop, L_by1, L_by1_loop, L_exit; - unsigned long offset; + uint64_t offset; if (UseCRC32) { kernel_crc32_using_crc32(crc, buf, len, table0, table1, table2, table3); @@ -3584,7 +3584,7 @@ SkipIfEqual::SkipIfEqual( MacroAssembler* masm, const bool* flag_addr, bool value) { _masm = masm; - unsigned long offset; + uint64_t offset; _masm->adrp(rscratch1, ExternalAddress((address)flag_addr), offset); _masm->ldrb(rscratch1, Address(rscratch1, offset)); _masm->cbzw(rscratch1, _label); @@ -3613,7 +3613,7 @@ } void MacroAssembler::cmpptr(Register src1, Address src2) { - unsigned long offset; + uint64_t offset; adrp(rscratch1, src2, offset); ldr(rscratch1, Address(rscratch1, offset)); cmp(src1, rscratch1); @@ -4221,13 +4221,12 @@ return inst_mark(); } -void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byte_offset) { - relocInfo::relocType rtype = dest.rspec().reloc()->type(); - unsigned long low_page = (unsigned long)CodeCache::low_bound() >> 12; - unsigned long high_page = (unsigned long)(CodeCache::high_bound()-1) >> 12; - unsigned long dest_page = (unsigned long)dest.target() >> 12; - long offset_low = dest_page - low_page; - long offset_high = dest_page - high_page; +void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_offset) { + uint64_t low_page = (uint64_t)CodeCache::low_bound() >> 12; + uint64_t high_page = (uint64_t)(CodeCache::high_bound()-1) >> 12; + uint64_t dest_page = (uint64_t)dest.target() >> 12; + int64_t offset_low = dest_page - low_page; + int64_t offset_high = dest_page - high_page; assert(is_valid_AArch64_address(dest.target()), "bad address"); assert(dest.getMode() == Address::literal, "ADRP must be applied to a literal address"); @@ -4239,14 +4238,14 @@ if (offset_high >= -(1<<20) && offset_low < (1<<20)) { _adrp(reg1, dest.target()); } else { - unsigned long target = (unsigned long)dest.target(); - unsigned long adrp_target - = (target & 0xffffffffUL) | ((unsigned long)pc() & 0xffff00000000UL); + uint64_t target = (uint64_t)dest.target(); + uint64_t adrp_target + = (target & 0xffffffffULL) | ((uint64_t)pc() & 0xffff00000000ULL); _adrp(reg1, (address)adrp_target); movk(reg1, target >> 32, 32); } - byte_offset = (unsigned long)dest.target() & 0xfff; + byte_offset = (uint64_t)dest.target() & 0xfff; } void MacroAssembler::load_byte_map_base(Register reg) { @@ -5441,7 +5440,7 @@ // base: Address of a buffer to be zeroed, 8 bytes aligned. // cnt: Immediate count in HeapWords. #define SmallArraySize (18 * BytesPerLong) -void MacroAssembler::zero_words(Register base, u_int64_t cnt) +void MacroAssembler::zero_words(Register base, uint64_t cnt) { BLOCK_COMMENT("zero_words {"); int i = cnt & 1; // store any odd word to start @@ -5804,10 +5803,14 @@ // by the call to JavaThread::aarch64_get_thread_helper() or, indeed, // the call setup code. // -// aarch64_get_thread_helper() clobbers only r0, r1, and flags. +// On Linux, aarch64_get_thread_helper() clobbers only r0, r1, and flags. +// On other systems, the helper is a usual C function. // void MacroAssembler::get_thread(Register dst) { - RegSet saved_regs = RegSet::range(r0, r1) + lr - dst; + RegSet saved_regs = + LINUX_ONLY(RegSet::range(r0, r1) + lr - dst) + NOT_LINUX (RegSet::range(r0, r17) + lr - dst); + push(saved_regs, sp); mov(lr, CAST_FROM_FN_PTR(address, JavaThread::aarch64_get_thread_helper)); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -448,8 +448,8 @@ // first two private routines for loading 32 bit or 64 bit constants private: - void mov_immediate64(Register dst, u_int64_t imm64); - void mov_immediate32(Register dst, u_int32_t imm32); + void mov_immediate64(Register dst, uint64_t imm64); + void mov_immediate32(Register dst, uint32_t imm32); int push(unsigned int bitset, Register stack); int pop(unsigned int bitset, Register stack); @@ -472,27 +472,27 @@ inline void mov(Register dst, address addr) { - mov_immediate64(dst, (u_int64_t)addr); + mov_immediate64(dst, (uint64_t)addr); } - inline void mov(Register dst, u_int64_t imm64) + inline void mov(Register dst, uint64_t imm64) { mov_immediate64(dst, imm64); } - inline void movw(Register dst, u_int32_t imm32) + inline void movw(Register dst, uint32_t imm32) { mov_immediate32(dst, imm32); } - inline void mov(Register dst, long l) + inline void mov(Register dst, int64_t l) { - mov(dst, (u_int64_t)l); + mov(dst, (uint64_t)l); } inline void mov(Register dst, int i) { - mov(dst, (long)i); + mov(dst, (int64_t)i); } void mov(Register dst, RegisterOrConstant src) { @@ -504,7 +504,7 @@ void movptr(Register r, uintptr_t imm64); - void mov(FloatRegister Vd, SIMD_Arrangement T, u_int32_t imm32); + void mov(FloatRegister Vd, SIMD_Arrangement T, uint32_t imm32); void mov(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) { orr(Vd, T, Vn, Vn); @@ -1160,7 +1160,7 @@ void sub(Register Rd, Register Rn, RegisterOrConstant decrement); void subw(Register Rd, Register Rn, RegisterOrConstant decrement); - void adrp(Register reg1, const Address &dest, unsigned long &byte_offset); + void adrp(Register reg1, const Address &dest, uint64_t &byte_offset); void tableswitch(Register index, jint lowbound, jint highbound, Label &jumptable, Label &jumptable_end, int stride = 1) { @@ -1177,7 +1177,7 @@ // actually be used: you must use the Address that is returned. It // is up to you to ensure that the shift provided matches the size // of your data. - Address form_address(Register Rd, Register base, long byte_offset, int shift); + Address form_address(Register Rd, Register base, int64_t byte_offset, int shift); // Return true iff an address is within the 48-bit AArch64 address // space. @@ -1202,7 +1202,7 @@ if (NearCpool) { ldr(dest, const_addr); } else { - unsigned long offset; + uint64_t offset; adrp(dest, InternalAddress(const_addr.target()), offset); ldr(dest, Address(dest, offset)); } @@ -1232,7 +1232,7 @@ int elem_size); void fill_words(Register base, Register cnt, Register value); - void zero_words(Register base, u_int64_t cnt); + void zero_words(Register base, uint64_t cnt); address zero_words(Register ptr, Register cnt); void zero_dcache_blocks(Register base, Register cnt); @@ -1314,7 +1314,7 @@ // Uses rscratch2 if the address is not directly reachable Address spill_address(int size, int offset, Register tmp=rscratch2); - bool merge_alignment_check(Register base, size_t size, long cur_offset, long prev_offset) const; + bool merge_alignment_check(Register base, size_t size, int64_t cur_offset, int64_t prev_offset) const; // Check whether two loads/stores can be merged into ldp/stp. bool ldst_can_merge(Register rx, const Address &adr, size_t cur_size_in_bytes, bool is_store) const; diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -65,7 +65,7 @@ // Table with p(r) polynomial coefficients // and table representation of logarithm values (hi and low parts) -__attribute__ ((aligned(64))) juint _L_tbl[] = +ATTRIBUTE_ALIGNED(64) juint _L_tbl[] = { // coefficients of p(r) polynomial: // _coeff[] @@ -260,9 +260,9 @@ Register tmp4, Register tmp5) { Label DONE, CHECK_CORNER_CASES, SMALL_VALUE, MAIN, CHECKED_CORNER_CASES, RETURN_MINF_OR_NAN; - const long INF_OR_NAN_PREFIX = 0x7FF0; - const long MINF_OR_MNAN_PREFIX = 0xFFF0; - const long ONE_PREFIX = 0x3FF0; + const int64_t INF_OR_NAN_PREFIX = 0x7FF0; + const int64_t MINF_OR_MNAN_PREFIX = 0xFFF0; + const int64_t ONE_PREFIX = 0x3FF0; movz(tmp2, ONE_PREFIX, 48); movz(tmp4, 0x0010, 48); fmovd(rscratch1, v0); // rscratch1 = AS_LONG_BITS(X) diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -201,9 +201,9 @@ // NOTE: fpu registers are actively reused. See comments in code about their usage void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw, address two_over_pi, address pio2) { - const long PIO2_1t = 0x3DD0B4611A626331UL; - const long PIO2_2 = 0x3DD0B4611A600000UL; - const long PIO2_2t = 0x3BA3198A2E037073UL; + const int64_t PIO2_1t = 0x3DD0B4611A626331ULL; + const int64_t PIO2_2 = 0x3DD0B4611A600000ULL; + const int64_t PIO2_2t = 0x3BA3198A2E037073ULL; Label X_IS_NEGATIVE, X_IS_MEDIUM_OR_LARGE, X_IS_POSITIVE_LONG_PI, LARGE_ELSE, REDUCTION_DONE, X_IS_MEDIUM_BRANCH_DONE, X_IS_LARGE, NX_SET, X_IS_NEGATIVE_LONG_PI; @@ -360,7 +360,7 @@ lsr(rscratch1, ix, 20); // ix >> 20 movz(tmp5, 0x4170, 48); subw(rscratch1, rscratch1, 1046); // e0 - fmovd(v10, tmp5); // init two24A value + fmovd(v24, tmp5); // init two24A value subw(jv, ix, rscratch1, LSL, 20); // ix - (e0<<20) lsl(jv, jv, 32); subw(rscratch2, rscratch1, 3); @@ -374,7 +374,7 @@ sdivw(jv, rscratch2, i); // jv = (e0 - 3)/24 fsubd(v26, v26, v6); sub(sp, sp, 560); - fmuld(v26, v26, v10); + fmuld(v26, v26, v24); frintzd(v7, v26); // v7 = (double)((int)v26) movw(jx, 2); // calculate jx as nx - 1, which is initially 2. Not a part of unrolled loop fsubd(v26, v26, v7); @@ -383,7 +383,7 @@ block_comment("nx calculation with unrolled while(tx[nx-1]==zeroA) nx--;"); { fcmpd(v26, 0.0); // if NE then jx == 2. else it's 1 or 0 add(iqBase, sp, 480); // base of iq[] - fmuld(v3, v26, v10); + fmuld(v3, v26, v24); br(NE, NX_SET); fcmpd(v7, 0.0); // v7 == 0 => jx = 0. Else jx = 1 csetw(jx, NE); @@ -839,7 +839,7 @@ ldrd(v27, post(tmp2, -8)); fmuld(v29, v17, v18); // twon24*z frintzd(v29, v29); // (double)(int) - fmsubd(v28, v10, v29, v18); // v28 = z-two24A*fw + fmsubd(v28, v24, v29, v18); // v28 = z-two24A*fw fcvtzdw(tmp1, v28); // (int)(z-two24A*fw) strw(tmp1, Address(iqBase, i, Address::lsl(2))); faddd(v18, v27, v29); @@ -1000,11 +1000,11 @@ block_comment("else block of if(z==0.0) {"); { bind(RECOMP_CHECK_DONE_NOT_ZERO); fmuld(v18, v18, v22); - fcmpd(v18, v10); // v10 is stil two24A + fcmpd(v18, v24); // v24 is stil two24A br(LT, Z_IS_LESS_THAN_TWO24B); fmuld(v1, v18, v17); // twon24*z frintzd(v1, v1); // v1 = (double)(int)(v1) - fmaddd(v2, v10, v1, v18); + fmaddd(v2, v24, v1, v18); fcvtzdw(tmp3, v1); // (int)fw fcvtzdw(tmp2, v2); // double to int strw(tmp2, Address(iqBase, jz, Address::lsl(2))); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -301,7 +301,7 @@ unsigned insn = *(unsigned*)pc; if (maybe_cpool_ref(pc)) { address addr = MacroAssembler::target_addr_for_insn(pc); - *(long*)addr = x; + *(int64_t*)addr = x; } else { MacroAssembler::pd_patch_instruction(pc, (address)intptr_t(x)); ICache::invalidate_range(instruction_address(), instruction_size); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/pauth_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/pauth_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/pauth_aarch64.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/pauth_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, Arm Limited. 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. + * + */ + +#ifndef CPU_AARCH64_PAUTH_AARCH64_INLINE_HPP +#define CPU_AARCH64_PAUTH_AARCH64_INLINE_HPP + +#include OS_CPU_HEADER_INLINE(pauth) + +inline bool pauth_ptr_is_raw(address ptr) { + // Confirm none of the high bits are set in the pointer. + return ptr == pauth_strip_pointer(ptr); +} + +#endif // CPU_AARCH64_PAUTH_AARCH64_INLINE_HPP diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/register_aarch64.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/register_aarch64.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/register_aarch64.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/register_aarch64.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -65,7 +65,7 @@ // Return the bit which represents this register. This is intended // to be ORed into a bitmask: for usage see class RegSet below. - unsigned long bit(bool should_set = true) const { return should_set ? 1 << encoding() : 0; } + uint64_t bit(bool should_set = true) const { return should_set ? 1 << encoding() : 0; } }; // The integer registers of the aarch64 architecture diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -398,7 +398,7 @@ // 3 8 T_BOOL // - 0 return address // - // However to make thing extra confusing. Because we can fit a long/double in + // However to make thing extra confusing. Because we can fit a Java long/double in // a single slot on a 64 bt vm and it would be silly to break them up, the interpreter // leaves one slot empty and only stores to a single slot. In this case the // slot that is occupied is the T_VOID slot. See I said it was confusing. @@ -431,7 +431,7 @@ __ str(rscratch1, Address(sp, next_off)); #ifdef ASSERT // Overwrite the unused slot with known junk - __ mov(rscratch1, 0xdeadffffdeadaaaaul); + __ mov(rscratch1, (uint64_t)0xdeadffffdeadaaaaull); __ str(rscratch1, Address(sp, st_off)); #endif /* ASSERT */ } else { @@ -448,10 +448,9 @@ // Two VMREgs|OptoRegs can be T_OBJECT, T_ADDRESS, T_DOUBLE, T_LONG // T_DOUBLE and T_LONG use two slots in the interpreter if ( sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) { - // long/double in gpr + // jlong/double in gpr #ifdef ASSERT - // Overwrite the unused slot with known junk - __ mov(rscratch1, 0xdeadffffdeadaaabul); + __ mov(rscratch1, (uint64_t)0xdeadffffdeadaaabull); __ str(rscratch1, Address(sp, st_off)); #endif /* ASSERT */ __ str(r, Address(sp, next_off)); @@ -467,7 +466,7 @@ } else { #ifdef ASSERT // Overwrite the unused slot with known junk - __ mov(rscratch1, 0xdeadffffdeadaaacul); + __ mov(rscratch1, (uint64_t)0xdeadffffdeadaaacull); __ str(rscratch1, Address(sp, st_off)); #endif /* ASSERT */ __ strd(r_1->as_FloatRegister(), Address(sp, next_off)); @@ -1675,7 +1674,7 @@ Label dtrace_method_entry, dtrace_method_entry_done; { - unsigned long offset; + uint64_t offset; __ adrp(rscratch1, ExternalAddress((address)&DTraceMethodProbes), offset); __ ldrb(rscratch1, Address(rscratch1, offset)); __ cbnzw(rscratch1, dtrace_method_entry); @@ -1900,7 +1899,7 @@ Label dtrace_method_exit, dtrace_method_exit_done; { - unsigned long offset; + uint64_t offset; __ adrp(rscratch1, ExternalAddress((address)&DTraceMethodProbes), offset); __ ldrb(rscratch1, Address(rscratch1, offset)); __ cbnzw(rscratch1, dtrace_method_exit); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -683,7 +683,6 @@ int unit = wordSize * direction; int bias = (UseSIMDForMemoryOps ? 4:2) * wordSize; - int offset; const Register t0 = r3, t1 = r4, t2 = r5, t3 = r6, t4 = r7, t5 = r10, t6 = r11, t7 = r12; const Register stride = r13; @@ -3243,8 +3242,8 @@ // Max number of bytes we can process before having to take the mod // 0x15B0 is 5552 in decimal, the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 - unsigned long BASE = 0xfff1; - unsigned long NMAX = 0x15B0; + uint64_t BASE = 0xfff1; + uint64_t NMAX = 0x15B0; __ mov(base, BASE); __ mov(nmax, NMAX); @@ -4021,7 +4020,7 @@ FloatRegister vtmpZ = v0, vtmp = v1, vtmp3 = v2; RegSet spilled_regs = RegSet::of(tmp3, tmp4); - int prefetchLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance/2); + int prefetchLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance/2); __ eor(vtmpZ, __ T16B, vtmpZ, vtmpZ); // cnt2 == amount of characters left to compare @@ -4137,7 +4136,7 @@ DIFF_LAST_POSITION, DIFF_LAST_POSITION2; // exit from large loop when less than 64 bytes left to read or we're about // to prefetch memory behind array border - int largeLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2); + int largeLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2); // cnt1/cnt2 contains amount of characters to compare. cnt1 can be re-used // update cnt2 counter with already loaded 8 bytes __ sub(cnt2, cnt2, wordSize/(isLL ? 1 : 2)); @@ -4562,7 +4561,7 @@ address entry = __ pc(); Label LOOP, LOOP_START, LOOP_PRFM, LOOP_PRFM_START, DONE; Register src = r0, dst = r1, len = r2, octetCounter = r3; - const int large_loop_threshold = MAX(64, SoftwarePrefetchHintDistance)/8 + 4; + const int large_loop_threshold = MAX2(64, SoftwarePrefetchHintDistance)/8 + 4; // do one more 8-byte read to have address 16-byte aligned in most cases // also use single store instruction @@ -5607,12 +5606,12 @@ // In C, approximately: // void - // montgomery_multiply(unsigned long Pa_base[], unsigned long Pb_base[], - // unsigned long Pn_base[], unsigned long Pm_base[], - // unsigned long inv, int len) { - // unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator - // unsigned long *Pa, *Pb, *Pn, *Pm; - // unsigned long Ra, Rb, Rn, Rm; + // montgomery_multiply(julong Pa_base[], julong Pb_base[], + // julong Pn_base[], julong Pm_base[], + // julong inv, int len) { + // julong t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator + // julong *Pa, *Pb, *Pn, *Pm; + // julong Ra, Rb, Rn, Rm; // int i; @@ -5820,11 +5819,12 @@ // In C, approximately: // void - // montgomery_square(unsigned long Pa_base[], unsigned long Pn_base[], - // unsigned long Pm_base[], unsigned long inv, int len) { - // unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator - // unsigned long *Pa, *Pb, *Pn, *Pm; - // unsigned long Ra, Rb, Rn, Rm; + // montgomery_multiply(julong Pa_base[], julong Pb_base[], + // julong Pn_base[], julong Pm_base[], + // julong inv, int len) { + // julong t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator + // julong *Pa, *Pb, *Pn, *Pm; + // julong Ra, Rb, Rn, Rm; // int i; diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -61,7 +61,7 @@ /** * crc_table[] from jdk/src/share/native/java/util/zip/zlib-1.2.5/crc32.h */ -juint StubRoutines::aarch64::_crc_table[] ATTRIBUTE_ALIGNED(4096) = +ATTRIBUTE_ALIGNED(4096) juint StubRoutines::aarch64::_crc_table[] = { // Table 0 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, @@ -288,11 +288,11 @@ }; // Accumulation coefficients for adler32 upper 16 bits -jubyte StubRoutines::aarch64::_adler_table[] __attribute__ ((aligned(64))) = { +ATTRIBUTE_ALIGNED(64) jubyte StubRoutines::aarch64::_adler_table[] = { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; -juint StubRoutines::aarch64::_npio2_hw[] __attribute__ ((aligned(64))) = { +ATTRIBUTE_ALIGNED(64) juint StubRoutines::aarch64::_npio2_hw[] = { // first, various coefficient values: 0.5, invpio2, pio2_1, pio2_1t, pio2_2, // pio2_2t, pio2_3, pio2_3t // This is a small optimization wich keeping double[8] values in int[] table @@ -324,7 +324,7 @@ // Coefficients for sin(x) polynomial approximation: S1..S6. // See kernel_sin comments in macroAssembler_aarch64_trig.cpp for details -jdouble StubRoutines::aarch64::_dsin_coef[] __attribute__ ((aligned(64))) = { +ATTRIBUTE_ALIGNED(64) jdouble StubRoutines::aarch64::_dsin_coef[] = { -1.66666666666666324348e-01, // 0xBFC5555555555549 8.33333333332248946124e-03, // 0x3F8111111110F8A6 -1.98412698298579493134e-04, // 0xBF2A01A019C161D5 @@ -335,7 +335,7 @@ // Coefficients for cos(x) polynomial approximation: C1..C6. // See kernel_cos comments in macroAssembler_aarch64_trig.cpp for details -jdouble StubRoutines::aarch64::_dcos_coef[] __attribute__ ((aligned(64))) = { +ATTRIBUTE_ALIGNED(64) jdouble StubRoutines::aarch64::_dcos_coef[] = { 4.16666666666666019037e-02, // c0x3FA555555555554C -1.38888888888741095749e-03, // 0xBF56C16C16C15177 2.48015872894767294178e-05, // 0x3EFA01A019CB1590 @@ -350,7 +350,7 @@ // Converted to double to avoid unnecessary conversion in code // NOTE: table looks like original int table: {0xA2F983, 0x6E4E44,...} with // only (double) conversion added -jdouble StubRoutines::aarch64::_two_over_pi[] __attribute__ ((aligned(64))) = { +ATTRIBUTE_ALIGNED(64) jdouble StubRoutines::aarch64::_two_over_pi[] = { (double)0xA2F983, (double)0x6E4E44, (double)0x1529FC, (double)0x2757D1, (double)0xF534DD, (double)0xC0DB62, (double)0x95993C, (double)0x439041, (double)0xFE5163, (double)0xABDEBB, (double)0xC561B7, (double)0x246E3A, (double)0x424DD2, (double)0xE00649, (double)0x2EEA09, (double)0xD1921C, (double)0xFE1DEB, (double)0x1CB129, @@ -365,7 +365,7 @@ }; // Pi over 2 value -jdouble StubRoutines::aarch64::_pio2[] __attribute__ ((aligned(64))) = { +ATTRIBUTE_ALIGNED(64) jdouble StubRoutines::aarch64::_pio2[] = { 1.57079625129699707031e+00, // 0x3FF921FB40000000 7.54978941586159635335e-08, // 0x3E74442D00000000 5.39030252995776476554e-15, // 0x3CF8469880000000 diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -1003,7 +1003,7 @@ __ ldrw(val, Address(esp, 0)); // byte value __ ldrw(crc, Address(esp, wordSize)); // Initial CRC - unsigned long offset; + uint64_t offset; __ adrp(tbl, ExternalAddress(StubRoutines::crc_table_addr()), offset); __ add(tbl, tbl, offset); @@ -1593,27 +1593,30 @@ __ add(rlocals, esp, r2, ext::uxtx, 3); __ sub(rlocals, rlocals, wordSize); - // Make room for locals - __ sub(rscratch1, esp, r3, ext::uxtx, 3); - - // Padding between locals and fixed part of activation frame to ensure - // SP is always 16-byte aligned. - __ andr(sp, rscratch1, -16); + __ mov(rscratch1, esp); // r3 - # of additional locals // allocate space for locals // explicitly initialize locals + // Initializing memory allocated for locals in the same direction as + // the stack grows to ensure page initialization order according + // to windows-aarch64 stack page growth requirement (see + // https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-160#stack) { Label exit, loop; __ ands(zr, r3, r3); __ br(Assembler::LE, exit); // do nothing if r3 <= 0 __ bind(loop); - __ str(zr, Address(__ post(rscratch1, wordSize))); + __ str(zr, Address(__ pre(rscratch1, -wordSize))); __ sub(r3, r3, 1); // until everything initialized __ cbnz(r3, loop); __ bind(exit); } + // Padding between locals and fixed part of activation frame to ensure + // SP is always 16-byte aligned. + __ andr(sp, rscratch1, -16); + // And the base dispatch table __ get_dispatch(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1705,7 +1705,7 @@ Label done; __ pop_l(r1); __ cmp(r1, r0); - __ mov(r0, (u_int64_t)-1L); + __ mov(r0, (uint64_t)-1L); __ br(Assembler::LT, done); // __ mov(r0, 1UL); // __ csel(r0, r0, zr, Assembler::NE); @@ -1729,7 +1729,7 @@ if (unordered_result < 0) { // we want -1 for unordered or less than, 0 for equal and 1 for // greater than. - __ mov(r0, (u_int64_t)-1L); + __ mov(r0, (uint64_t)-1L); // for FP LT tests less than or unordered __ br(Assembler::LT, done); // install 0 for EQ otherwise 1 @@ -1910,7 +1910,7 @@ __ dispatch_only(vtos, /*generate_poll*/true); if (UseLoopCounter) { - if (ProfileInterpreter) { + if (ProfileInterpreter && !TieredCompilation) { // Out-of-line code to allocate method data oop. __ bind(profile_method); __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method)); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -163,7 +163,7 @@ ContendedPaddingWidth = dcache_line; } - unsigned long auxv = getauxval(AT_HWCAP); + uint64_t auxv = getauxval(AT_HWCAP); char buf[512]; diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/assembler_arm_32.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/assembler_arm_32.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/assembler_arm_32.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/assembler_arm_32.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1083,6 +1083,7 @@ break; default: ShouldNotReachHere(); + return; } emit_int32(0xf << 28 | 0x1 << 25 | 0x1 << 23 | 0x1 << 4 | (imm8 >> 7) << 24 | ((imm8 & 0x70) >> 4) << 16 | (imm8 & 0xf) | @@ -1113,6 +1114,7 @@ break; default: ShouldNotReachHere(); + return; } emit_int32(cond << 28 | 0x1D /* 0b11101 */ << 23 | 0xB /* 0b1011 */ << 8 | 0x1 << 4 | quad << 21 | b << 22 | e << 5 | Rs->encoding() << 12 | @@ -1143,6 +1145,7 @@ break; default: ShouldNotReachHere(); + return; } emit_int32(0xF /* 0b1111 */ << 28 | 0x3B /* 0b00111011 */ << 20 | 0x6 /* 0b110 */ << 9 | quad << 6 | imm4 << 16 | diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -52,13 +52,13 @@ RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array) - : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) { + : _index(index), _array(array), _throw_index_out_of_bounds_exception(false) { assert(info != NULL, "must have info"); _info = new CodeEmitInfo(info); } RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index) - : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) { + : _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) { assert(info != NULL, "must have info"); _info = new CodeEmitInfo(info); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -3097,7 +3097,7 @@ Label ok; if (op->condition() != lir_cond_always) { - AsmCondition acond; + AsmCondition acond = al; switch (op->condition()) { case lir_cond_equal: acond = eq; break; case lir_cond_notEqual: acond = ne; break; diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -436,7 +436,7 @@ } -bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { +bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) { assert(left != result, "should be different registers"); if (is_power_of_2(c + 1)) { #ifdef AARCH64 @@ -733,6 +733,7 @@ default: ShouldNotReachHere(); + return; } #else switch (x->op()) { @@ -757,6 +758,7 @@ break; default: ShouldNotReachHere(); + return; } LIR_Opr result = call_runtime(x->y(), x->x(), entry, x->type(), NULL); set_result(x, result); @@ -824,7 +826,7 @@ if (x->op() == Bytecodes::_irem) { out_reg = FrameMap::R0_opr; __ irem(left_arg->result(), right_arg->result(), out_reg, tmp, info); - } else if (x->op() == Bytecodes::_idiv) { + } else { // (x->op() == Bytecodes::_idiv) out_reg = FrameMap::R1_opr; __ idiv(left_arg->result(), right_arg->result(), out_reg, tmp, info); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -323,8 +323,9 @@ // -2- test (hdr - SP) if the low two bits are 0 sub(tmp2, hdr, SP, eq); movs(tmp2, AsmOperand(tmp2, lsr, exact_log2(os::vm_page_size())), eq); - // If 'eq' then OK for recursive fast locking: store 0 into a lock record. - str(tmp2, Address(disp_hdr, mark_offset), eq); + // If still 'eq' then recursive locking OK + // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8267042) + str(tmp2, Address(disp_hdr, mark_offset)); b(fast_lock_done, eq); // else need slow case b(slow_case); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/sharedRuntime_arm.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/sharedRuntime_arm.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/sharedRuntime_arm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/sharedRuntime_arm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1622,8 +1622,9 @@ // -2- test (hdr - SP) if the low two bits are 0 __ sub(Rtemp, mark, SP, eq); __ movs(Rtemp, AsmOperand(Rtemp, lsr, exact_log2(os::vm_page_size())), eq); - // If still 'eq' then recursive locking OK: set displaced header to 0 - __ str(Rtemp, Address(disp_hdr, BasicLock::displaced_header_offset_in_bytes()), eq); + // If still 'eq' then recursive locking OK + // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8267042) + __ str(Rtemp, Address(disp_hdr, BasicLock::displaced_header_offset_in_bytes())); __ b(lock_done, eq); __ b(slow_lock); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/arm/templateTable_arm.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/arm/templateTable_arm.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/arm/templateTable_arm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/arm/templateTable_arm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2374,7 +2374,7 @@ const Address mask(Rcounters, in_bytes(MethodCounters::backedge_mask_offset())); __ increment_mask_and_jump(Address(Rcounters, be_offset), increment, mask, Rcnt, R4_tmp, eq, &backedge_counter_overflow); - } else { + } else { // not TieredCompilation // Increment backedge counter in MethodCounters* __ get_method_counters(Rmethod, Rcounters, dispatch, true /*saveRegs*/, Rdisp, R3_bytecode, @@ -2447,7 +2447,7 @@ __ dispatch_only(vtos); if (UseLoopCounter) { - if (ProfileInterpreter) { + if (ProfileInterpreter && !TieredCompilation) { // Out-of-line code to allocate method data oop. __ bind(profile_method); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -289,7 +289,7 @@ } -bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { +bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) { assert(left != result, "should be different registers"); if (is_power_of_2(c + 1)) { __ shift_left(left, log2_int(c + 1), result); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -223,7 +223,7 @@ __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info); } -bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { +bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) { if (tmp->is_valid()) { if (is_power_of_2(c + 1)) { __ move(left, tmp); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/s390/templateTable_s390.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/s390/templateTable_s390.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/s390/templateTable_s390.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/s390/templateTable_s390.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2010,7 +2010,7 @@ // Out-of-line code runtime calls. if (UseLoopCounter) { - if (ProfileInterpreter) { + if (ProfileInterpreter && !TieredCompilation) { // Out-of-line code to allocate method data oop. __ bind(profile_method); @@ -3815,9 +3815,8 @@ // Get instance_size in InstanceKlass (scaled to a count of bytes). Register Rsize = offset; - const int mask = 1 << Klass::_lh_instance_slow_path_bit; __ z_llgf(Rsize, Address(iklass, Klass::layout_helper_offset())); - __ z_tmll(Rsize, mask); + __ z_tmll(Rsize, Klass::_lh_instance_slow_path_bit); __ z_btrue(slow_case); // Allocate the instance diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/sparc/vm_version_sparc.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/sparc/vm_version_sparc.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/sparc/vm_version_sparc.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/sparc/vm_version_sparc.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -160,7 +160,8 @@ // Use compare and branch instructions if available. if (has_cbcond()) { - if (FLAG_IS_DEFAULT(UseCBCond)) { + // cbcond suspected to cause issues on Athena CPUs + if (FLAG_IS_DEFAULT(UseCBCond) && !is_athena()) { FLAG_SET_DEFAULT(UseCBCond, true); } } else if (UseCBCond) { @@ -218,7 +219,7 @@ char buf[512]; jio_snprintf(buf, sizeof(buf), - "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" + "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s", (has_v9() ? "v9" : ""), @@ -228,6 +229,7 @@ (has_blk_init() ? ", blk_init" : ""), (has_fmaf() ? ", fmaf" : ""), (has_hpc() ? ", hpc" : ""), + (has_athena() ? ", athena" : ""), (has_ima() ? ", ima" : ""), (has_aes() ? ", aes" : ""), (has_des() ? ", des" : ""), diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/sparc/vm_version_sparc.hpp openjdk-11-11.0.13+8/src/hotspot/cpu/sparc/vm_version_sparc.hpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/sparc/vm_version_sparc.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/sparc/vm_version_sparc.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -42,6 +42,7 @@ ISA_FMAF, ISA_VIS3, ISA_HPC, + ISA_FJATHHPC, ISA_IMA, ISA_AES, ISA_DES, @@ -104,6 +105,7 @@ ISA_fmaf_msk = UINT64_C(1) << ISA_FMAF, ISA_vis3_msk = UINT64_C(1) << ISA_VIS3, ISA_hpc_msk = UINT64_C(1) << ISA_HPC, + ISA_fjathhpc_msk = UINT64_C(1) << ISA_FJATHHPC, ISA_ima_msk = UINT64_C(1) << ISA_IMA, ISA_aes_msk = UINT64_C(1) << ISA_AES, ISA_des_msk = UINT64_C(1) << ISA_DES, @@ -253,6 +255,7 @@ static bool has_fmaf() { return (_features & ISA_fmaf_msk) != 0; } static bool has_vis3() { return (_features & ISA_vis3_msk) != 0; } static bool has_hpc() { return (_features & ISA_hpc_msk) != 0; } + static bool has_athena() { return (_features & ISA_fjathhpc_msk) != 0; } static bool has_ima() { return (_features & ISA_ima_msk) != 0; } static bool has_aes() { return (_features & ISA_aes_msk) != 0; } static bool has_des() { return (_features & ISA_des_msk) != 0; } @@ -306,6 +309,10 @@ return (_features & niagara2_msk) == niagara2_msk; } + static bool is_athena() { + return has_athena() || has_athena_plus() || has_athena_plus2(); + } + // Default prefetch block size on SPARC. static uint prefetch_data_size() { return L2_data_cache_line_size(); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -46,6 +46,77 @@ address ShenandoahBarrierSetAssembler::_shenandoah_lrb = NULL; +static void save_machine_state(MacroAssembler* masm, bool handle_gpr, bool handle_fp) { + if (handle_gpr) { + __ push_IU_state(); + } + + if (handle_fp) { + // Some paths can be reached from the c2i adapter with live fp arguments in registers. + LP64_ONLY(assert(Argument::n_float_register_parameters_j == 8, "8 fp registers to save at java call")); + + if (UseSSE >= 2) { + const int xmm_size = wordSize * LP64_ONLY(2) NOT_LP64(4); + __ subptr(rsp, xmm_size * 8); + __ movdbl(Address(rsp, xmm_size * 0), xmm0); + __ movdbl(Address(rsp, xmm_size * 1), xmm1); + __ movdbl(Address(rsp, xmm_size * 2), xmm2); + __ movdbl(Address(rsp, xmm_size * 3), xmm3); + __ movdbl(Address(rsp, xmm_size * 4), xmm4); + __ movdbl(Address(rsp, xmm_size * 5), xmm5); + __ movdbl(Address(rsp, xmm_size * 6), xmm6); + __ movdbl(Address(rsp, xmm_size * 7), xmm7); + } else if (UseSSE >= 1) { + const int xmm_size = wordSize * LP64_ONLY(1) NOT_LP64(2); + __ subptr(rsp, xmm_size * 8); + __ movflt(Address(rsp, xmm_size * 0), xmm0); + __ movflt(Address(rsp, xmm_size * 1), xmm1); + __ movflt(Address(rsp, xmm_size * 2), xmm2); + __ movflt(Address(rsp, xmm_size * 3), xmm3); + __ movflt(Address(rsp, xmm_size * 4), xmm4); + __ movflt(Address(rsp, xmm_size * 5), xmm5); + __ movflt(Address(rsp, xmm_size * 6), xmm6); + __ movflt(Address(rsp, xmm_size * 7), xmm7); + } else { + __ push_FPU_state(); + } + } +} + +static void restore_machine_state(MacroAssembler* masm, bool handle_gpr, bool handle_fp) { + if (handle_fp) { + if (UseSSE >= 2) { + const int xmm_size = wordSize * LP64_ONLY(2) NOT_LP64(4); + __ movdbl(xmm0, Address(rsp, xmm_size * 0)); + __ movdbl(xmm1, Address(rsp, xmm_size * 1)); + __ movdbl(xmm2, Address(rsp, xmm_size * 2)); + __ movdbl(xmm3, Address(rsp, xmm_size * 3)); + __ movdbl(xmm4, Address(rsp, xmm_size * 4)); + __ movdbl(xmm5, Address(rsp, xmm_size * 5)); + __ movdbl(xmm6, Address(rsp, xmm_size * 6)); + __ movdbl(xmm7, Address(rsp, xmm_size * 7)); + __ addptr(rsp, xmm_size * 8); + } else if (UseSSE >= 1) { + const int xmm_size = wordSize * LP64_ONLY(1) NOT_LP64(2); + __ movflt(xmm0, Address(rsp, xmm_size * 0)); + __ movflt(xmm1, Address(rsp, xmm_size * 1)); + __ movflt(xmm2, Address(rsp, xmm_size * 2)); + __ movflt(xmm3, Address(rsp, xmm_size * 3)); + __ movflt(xmm4, Address(rsp, xmm_size * 4)); + __ movflt(xmm5, Address(rsp, xmm_size * 5)); + __ movflt(xmm6, Address(rsp, xmm_size * 6)); + __ movflt(xmm7, Address(rsp, xmm_size * 7)); + __ addptr(rsp, xmm_size * 8); + } else { + __ pop_FPU_state(); + } + } + + if (handle_gpr) { + __ pop_IU_state(); + } +} + void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) { @@ -88,7 +159,7 @@ __ testb(gc_state, flags); __ jcc(Assembler::zero, done); - __ pusha(); // push registers + save_machine_state(masm, /* handle_gpr = */ true, /* handle_fp = */ false); #ifdef _LP64 assert(src == rdi, "expected"); @@ -104,7 +175,8 @@ src, dst, count); } - __ popa(); + restore_machine_state(masm, /* handle_gpr = */ true, /* handle_fp = */ false); + __ bind(done); NOT_LP64(__ pop(thread);) } @@ -265,7 +337,9 @@ Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset())); __ testb(gc_state, ShenandoahHeap::HAS_FORWARDED); - __ jccb(Assembler::zero, done); + __ jcc(Assembler::zero, done); + + save_machine_state(masm, /* handle_gpr = */ false, /* handle_fp = */ true); // Use rsi for src address const Register src_addr = rsi; @@ -303,6 +377,8 @@ __ pop(rax); } + restore_machine_state(masm, /* handle_gpr = */ false, /* handle_fp = */ true); + __ bind(done); #ifndef _LP64 @@ -322,12 +398,7 @@ if (dst == noreg) return; if (ShenandoahIUBarrier) { - // The set of registers to be saved+restored is the same as in the write-barrier above. - // Those are the commonly used registers in the interpreter. - __ pusha(); - // __ push_callee_saved_registers(); - __ subptr(rsp, 2 * Interpreter::stackElementSize); - __ movdbl(Address(rsp, 0), xmm0); + save_machine_state(masm, /* handle_gpr = */ true, /* handle_fp = */ true); #ifdef _LP64 Register thread = r15_thread; @@ -344,10 +415,8 @@ assert_different_registers(dst, tmp, thread); satb_write_barrier_pre(masm, noreg, dst, thread, tmp, true, false); - __ movdbl(xmm0, Address(rsp, 0)); - __ addptr(rsp, 2 * Interpreter::stackElementSize); - //__ pop_callee_saved_registers(); - __ popa(); + + restore_machine_state(masm, /* handle_gpr = */ true, /* handle_fp = */ true); } } @@ -422,19 +491,7 @@ // 3: apply keep-alive barrier if needed if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) { - __ push_IU_state(); - // That path can be reached from the c2i adapter with live fp - // arguments in registers. - LP64_ONLY(assert(Argument::n_float_register_parameters_j == 8, "8 fp registers to save at java call")); - __ subptr(rsp, 64); - __ movdbl(Address(rsp, 0), xmm0); - __ movdbl(Address(rsp, 8), xmm1); - __ movdbl(Address(rsp, 16), xmm2); - __ movdbl(Address(rsp, 24), xmm3); - __ movdbl(Address(rsp, 32), xmm4); - __ movdbl(Address(rsp, 40), xmm5); - __ movdbl(Address(rsp, 48), xmm6); - __ movdbl(Address(rsp, 56), xmm7); + save_machine_state(masm, /* handle_gpr = */ true, /* handle_fp = */ true); Register thread = NOT_LP64(tmp_thread) LP64_ONLY(r15_thread); assert_different_registers(dst, tmp1, tmp_thread); @@ -451,16 +508,8 @@ tmp1 /* tmp */, true /* tosca_live */, true /* expand_call */); - __ movdbl(xmm0, Address(rsp, 0)); - __ movdbl(xmm1, Address(rsp, 8)); - __ movdbl(xmm2, Address(rsp, 16)); - __ movdbl(xmm3, Address(rsp, 24)); - __ movdbl(xmm4, Address(rsp, 32)); - __ movdbl(xmm5, Address(rsp, 40)); - __ movdbl(xmm6, Address(rsp, 48)); - __ movdbl(xmm7, Address(rsp, 56)); - __ addptr(rsp, 64); - __ pop_IU_state(); + + restore_machine_state(masm, /* handle_gpr = */ true, /* handle_fp = */ true); } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -315,18 +315,19 @@ } if (restore_vectors) { + off = additional_frame_bytes - ymm_bytes; + // Restore upper half of YMM registers. + for (int n = 0; n < num_xmm_regs; n++) { + __ vinsertf128_high(as_XMMRegister(n), Address(rsp, n*16+off)); + } + if (UseAVX > 2) { // Restore upper half of ZMM registers. for (int n = 0; n < num_xmm_regs; n++) { __ vinsertf64x4_high(as_XMMRegister(n), Address(rsp, n*32)); } - __ addptr(rsp, zmm_bytes); - } - // Restore upper half of YMM registers. - for (int n = 0; n < num_xmm_regs; n++) { - __ vinsertf128_high(as_XMMRegister(n), Address(rsp, n*16)); } - __ addptr(rsp, ymm_bytes); + __ addptr(rsp, additional_frame_bytes); } __ pop_FPU_state(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/cpu/x86/templateTable_x86.cpp openjdk-11-11.0.13+8/src/hotspot/cpu/x86/templateTable_x86.cpp --- openjdk-11-11.0.12+7/src/hotspot/cpu/x86/templateTable_x86.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/cpu/x86/templateTable_x86.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2297,7 +2297,7 @@ __ dispatch_only(vtos, true); if (UseLoopCounter) { - if (ProfileInterpreter) { + if (ProfileInterpreter && !TieredCompilation) { // Out-of-line code to allocate method data oop. __ bind(profile_method); __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method)); diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/aix/attachListener_aix.cpp openjdk-11-11.0.13+8/src/hotspot/os/aix/attachListener_aix.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/aix/attachListener_aix.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/aix/attachListener_aix.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -66,22 +66,12 @@ static char _path[UNIX_PATH_MAX]; static bool _has_path; // Shutdown marker to prevent accept blocking during clean-up. - static bool _shutdown; + static volatile bool _shutdown; // the file descriptor for the listening socket - static int _listener; + static volatile int _listener; - static void set_path(char* path) { - if (path == NULL) { - _has_path = false; - } else { - strncpy(_path, path, UNIX_PATH_MAX); - _path[UNIX_PATH_MAX-1] = '\0'; - _has_path = true; - } - } - - static void set_listener(int s) { _listener = s; } + static bool _atexit_registered; // reads a request from the given connected socket static AixAttachOperation* read_request(int s); @@ -94,6 +84,19 @@ ATTACH_ERROR_BADVERSION = 101 // error codes }; + static void set_path(char* path) { + if (path == NULL) { + _path[0] = '\0'; + _has_path = false; + } else { + strncpy(_path, path, UNIX_PATH_MAX); + _path[UNIX_PATH_MAX-1] = '\0'; + _has_path = true; + } + } + + static void set_listener(int s) { _listener = s; } + // initialize the listener, returns 0 if okay static int init(); @@ -129,9 +132,10 @@ // statics char AixAttachListener::_path[UNIX_PATH_MAX]; bool AixAttachListener::_has_path; -int AixAttachListener::_listener = -1; +volatile int AixAttachListener::_listener = -1; +bool AixAttachListener::_atexit_registered = false; // Shutdown marker to prevent accept blocking during clean-up -bool AixAttachListener::_shutdown = false; +volatile bool AixAttachListener::_shutdown = false; // Supporting class to help split a buffer into individual components class ArgumentIterator : public StackObj { @@ -177,17 +181,14 @@ // should be sufficient for cleanup. extern "C" { static void listener_cleanup() { - static int cleanup_done; - if (!cleanup_done) { - cleanup_done = 1; - AixAttachListener::set_shutdown(true); - int s = AixAttachListener::listener(); - if (s != -1) { - ::shutdown(s, 2); - } - if (AixAttachListener::has_path()) { - ::unlink(AixAttachListener::path()); - } + AixAttachListener::set_shutdown(true); + int s = AixAttachListener::listener(); + if (s != -1) { + ::shutdown(s, 2); + } + if (AixAttachListener::has_path()) { + ::unlink(AixAttachListener::path()); + AixAttachListener::set_path(NULL); } } } @@ -200,7 +201,10 @@ int listener; // listener socket (file descriptor) // register function to cleanup - ::atexit(listener_cleanup); + if (!_atexit_registered) { + _atexit_registered = true; + ::atexit(listener_cleanup); + } int n = snprintf(path, UNIX_PATH_MAX, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id()); @@ -371,10 +375,14 @@ // We must prevent accept blocking on the socket if it has been shut down. // Therefore we allow interrupts and check whether we have been shut down already. if (AixAttachListener::is_shutdown()) { + ::close(listener()); + set_listener(-1); return NULL; } - s=::accept(listener(), &addr, &len); + s = ::accept(listener(), &addr, &len); if (s == -1) { + ::close(listener()); + set_listener(-1); return NULL; // log a warning? } @@ -515,6 +523,30 @@ return ret_code; } +bool AttachListener::check_socket_file() { + int ret; + struct stat64 st; + ret = stat64(AixAttachListener::path(), &st); + if (ret == -1) { // need to restart attach listener. + log_debug(attach)("Socket file %s does not exist - Restart Attach Listener", + AixAttachListener::path()); + + listener_cleanup(); + + // wait to terminate current attach listener instance... + { + // avoid deadlock if AttachListener thread is blocked at safepoint + ThreadBlockInVM tbivm(JavaThread::current()); + while (AttachListener::transit_state(AL_INITIALIZING, + AL_NOT_INITIALIZED) != AL_NOT_INITIALIZED) { + os::naked_yield(); + } + } + return is_init_trigger(); + } + return false; +} + // Attach Listener is started lazily except in the case when // +ReduseSignalUsage is used bool AttachListener::init_at_startup() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/aix/os_aix.cpp openjdk-11-11.0.13+8/src/hotspot/os/aix/os_aix.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/aix/os_aix.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/aix/os_aix.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -3789,9 +3789,7 @@ // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; - if (!rewrite_existing) { - oflags |= O_EXCL; - } + oflags |= rewrite_existing ? O_TRUNC : O_EXCL; return ::open64(path, oflags, S_IREAD | S_IWRITE); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/bsd/attachListener_bsd.cpp openjdk-11-11.0.13+8/src/hotspot/os/bsd/attachListener_bsd.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/bsd/attachListener_bsd.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/bsd/attachListener_bsd.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -66,19 +66,9 @@ static bool _has_path; // the file descriptor for the listening socket - static int _listener; + static volatile int _listener; - static void set_path(char* path) { - if (path == NULL) { - _has_path = false; - } else { - strncpy(_path, path, UNIX_PATH_MAX); - _path[UNIX_PATH_MAX-1] = '\0'; - _has_path = true; - } - } - - static void set_listener(int s) { _listener = s; } + static bool _atexit_registered; // reads a request from the given connected socket static BsdAttachOperation* read_request(int s); @@ -91,6 +81,19 @@ ATTACH_ERROR_BADVERSION = 101 // error codes }; + static void set_path(char* path) { + if (path == NULL) { + _path[0] = '\0'; + _has_path = false; + } else { + strncpy(_path, path, UNIX_PATH_MAX); + _path[UNIX_PATH_MAX-1] = '\0'; + _has_path = true; + } + } + + static void set_listener(int s) { _listener = s; } + // initialize the listener, returns 0 if okay static int init(); @@ -123,7 +126,8 @@ // statics char BsdAttachListener::_path[UNIX_PATH_MAX]; bool BsdAttachListener::_has_path; -int BsdAttachListener::_listener = -1; +volatile int BsdAttachListener::_listener = -1; +bool BsdAttachListener::_atexit_registered = false; // Supporting class to help split a buffer into individual components class ArgumentIterator : public StackObj { @@ -158,16 +162,15 @@ // bound too. extern "C" { static void listener_cleanup() { - static int cleanup_done; - if (!cleanup_done) { - cleanup_done = 1; - int s = BsdAttachListener::listener(); - if (s != -1) { - ::close(s); - } - if (BsdAttachListener::has_path()) { - ::unlink(BsdAttachListener::path()); - } + int s = BsdAttachListener::listener(); + if (s != -1) { + BsdAttachListener::set_listener(-1); + ::shutdown(s, SHUT_RDWR); + ::close(s); + } + if (BsdAttachListener::has_path()) { + ::unlink(BsdAttachListener::path()); + BsdAttachListener::set_path(NULL); } } } @@ -180,7 +183,10 @@ int listener; // listener socket (file descriptor) // register function to cleanup - ::atexit(listener_cleanup); + if (!_atexit_registered) { + _atexit_registered = true; + ::atexit(listener_cleanup); + } int n = snprintf(path, UNIX_PATH_MAX, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id()); @@ -485,6 +491,30 @@ return ret_code; } +bool AttachListener::check_socket_file() { + int ret; + struct stat st; + ret = stat(BsdAttachListener::path(), &st); + if (ret == -1) { // need to restart attach listener. + log_debug(attach)("Socket file %s does not exist - Restart Attach Listener", + BsdAttachListener::path()); + + listener_cleanup(); + + // wait to terminate current attach listener instance... + { + // avoid deadlock if AttachListener thread is blocked at safepoint + ThreadBlockInVM tbivm(JavaThread::current()); + while (AttachListener::transit_state(AL_INITIALIZING, + AL_NOT_INITIALIZED) != AL_NOT_INITIALIZED) { + os::naked_yield(); + } + } + return is_init_trigger(); + } + return false; +} + // Attach Listener is started lazily except in the case when // +ReduseSignalUsage is used bool AttachListener::init_at_startup() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/bsd/os_bsd.cpp openjdk-11-11.0.13+8/src/hotspot/os/bsd/os_bsd.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/bsd/os_bsd.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/bsd/os_bsd.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -3297,16 +3297,6 @@ Bsd::clock_init(); initial_time_count = javaTimeNanos(); -#ifdef __APPLE__ - // XXXDARWIN - // Work around the unaligned VM callbacks in hotspot's - // sharedRuntime. The callbacks don't use SSE2 instructions, and work on - // Linux, Solaris, and FreeBSD. On Mac OS X, dyld (rightly so) enforces - // alignment when doing symbol lookup. To work around this, we force early - // binding of all symbols now, thus binding when alignment is known-good. - _dyld_bind_fully_image_containing_address((const void *) &os::init); -#endif - os::Posix::init(); } @@ -3638,9 +3628,7 @@ // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; - if (!rewrite_existing) { - oflags |= O_EXCL; - } + oflags |= rewrite_existing ? O_TRUNC : O_EXCL; return ::open(path, oflags, S_IREAD | S_IWRITE); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/linux/attachListener_linux.cpp openjdk-11-11.0.13+8/src/hotspot/os/linux/attachListener_linux.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/linux/attachListener_linux.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/linux/attachListener_linux.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -67,19 +67,9 @@ static bool _has_path; // the file descriptor for the listening socket - static int _listener; + static volatile int _listener; - static void set_path(char* path) { - if (path == NULL) { - _has_path = false; - } else { - strncpy(_path, path, UNIX_PATH_MAX); - _path[UNIX_PATH_MAX-1] = '\0'; - _has_path = true; - } - } - - static void set_listener(int s) { _listener = s; } + static bool _atexit_registered; // reads a request from the given connected socket static LinuxAttachOperation* read_request(int s); @@ -92,6 +82,19 @@ ATTACH_ERROR_BADVERSION = 101 // error codes }; + static void set_path(char* path) { + if (path == NULL) { + _path[0] = '\0'; + _has_path = false; + } else { + strncpy(_path, path, UNIX_PATH_MAX); + _path[UNIX_PATH_MAX-1] = '\0'; + _has_path = true; + } + } + + static void set_listener(int s) { _listener = s; } + // initialize the listener, returns 0 if okay static int init(); @@ -124,7 +127,8 @@ // statics char LinuxAttachListener::_path[UNIX_PATH_MAX]; bool LinuxAttachListener::_has_path; -int LinuxAttachListener::_listener = -1; +volatile int LinuxAttachListener::_listener = -1; +bool LinuxAttachListener::_atexit_registered = false; // Supporting class to help split a buffer into individual components class ArgumentIterator : public StackObj { @@ -159,16 +163,15 @@ // bound too. extern "C" { static void listener_cleanup() { - static int cleanup_done; - if (!cleanup_done) { - cleanup_done = 1; - int s = LinuxAttachListener::listener(); - if (s != -1) { - ::close(s); - } - if (LinuxAttachListener::has_path()) { - ::unlink(LinuxAttachListener::path()); - } + int s = LinuxAttachListener::listener(); + if (s != -1) { + LinuxAttachListener::set_listener(-1); + ::shutdown(s, SHUT_RDWR); + ::close(s); + } + if (LinuxAttachListener::has_path()) { + ::unlink(LinuxAttachListener::path()); + LinuxAttachListener::set_path(NULL); } } } @@ -181,7 +184,10 @@ int listener; // listener socket (file descriptor) // register function to cleanup - ::atexit(listener_cleanup); + if (!_atexit_registered) { + _atexit_registered = true; + ::atexit(listener_cleanup); + } int n = snprintf(path, UNIX_PATH_MAX, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id()); @@ -485,6 +491,30 @@ return ret_code; } +bool AttachListener::check_socket_file() { + int ret; + struct stat64 st; + ret = stat64(LinuxAttachListener::path(), &st); + if (ret == -1) { // need to restart attach listener. + log_debug(attach)("Socket file %s does not exist - Restart Attach Listener", + LinuxAttachListener::path()); + + listener_cleanup(); + + // wait to terminate current attach listener instance... + { + // avoid deadlock if AttachListener thread is blocked at safepoint + ThreadBlockInVM tbivm(JavaThread::current()); + while (AttachListener::transit_state(AL_INITIALIZING, + AL_NOT_INITIALIZED) != AL_NOT_INITIALIZED) { + os::naked_yield(); + } + } + return is_init_trigger(); + } + return false; +} + // Attach Listener is started lazily except in the case when // +ReduseSignalUsage is used bool AttachListener::init_at_startup() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/linux/os_linux.cpp openjdk-11-11.0.13+8/src/hotspot/os/linux/os_linux.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/linux/os_linux.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/linux/os_linux.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -414,7 +414,14 @@ #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390) #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" #else +#if defined(AARCH64) + // Use 32-bit locations first for AARCH64 (a 64-bit architecture), since some systems + // might not adhere to the FHS and it would be a change in behaviour if we used + // DEFAULT_LIBPATH of other 64-bit architectures which prefer the 64-bit paths. + #define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/lib64:/lib64" +#else #define DEFAULT_LIBPATH "/lib:/usr/lib" +#endif // AARCH64 #endif // Base path of extensions installed on the system. @@ -5743,9 +5750,7 @@ // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; - if (!rewrite_existing) { - oflags |= O_EXCL; - } + oflags |= rewrite_existing ? O_TRUNC : O_EXCL; return ::open64(path, oflags, S_IREAD | S_IWRITE); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/solaris/attachListener_solaris.cpp openjdk-11-11.0.13+8/src/hotspot/os/solaris/attachListener_solaris.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/solaris/attachListener_solaris.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/solaris/attachListener_solaris.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -75,17 +75,7 @@ // door descriptor returned by door_create static int _door_descriptor; - static void set_door_path(char* path) { - if (path == NULL) { - _has_door_path = false; - } else { - strncpy(_door_path, path, PATH_MAX); - _door_path[PATH_MAX] = '\0'; // ensure it's nul terminated - _has_door_path = true; - } - } - - static void set_door_descriptor(int dd) { _door_descriptor = dd; } + static bool _atexit_registered; // mutex to protect operation list static mutex_t _mutex; @@ -121,6 +111,19 @@ ATTACH_ERROR_DENIED = 104 }; + static void set_door_path(char* path) { + if (path == NULL) { + _door_path[0] = '\0'; + _has_door_path = false; + } else { + strncpy(_door_path, path, PATH_MAX); + _door_path[PATH_MAX] = '\0'; // ensure it's nul terminated + _has_door_path = true; + } + } + + static void set_door_descriptor(int dd) { _door_descriptor = dd; } + // initialize the listener static int init(); @@ -169,6 +172,7 @@ char SolarisAttachListener::_door_path[PATH_MAX+1]; volatile bool SolarisAttachListener::_has_door_path; int SolarisAttachListener::_door_descriptor = -1; +bool SolarisAttachListener::_atexit_registered = false; mutex_t SolarisAttachListener::_mutex; sema_t SolarisAttachListener::_wakeup; SolarisAttachOperation* SolarisAttachListener::_head = NULL; @@ -359,18 +363,16 @@ // atexit hook to detach the door and remove the file extern "C" { static void listener_cleanup() { - static int cleanup_done; - if (!cleanup_done) { - cleanup_done = 1; - int dd = SolarisAttachListener::door_descriptor(); - if (dd >= 0) { - ::close(dd); - } - if (SolarisAttachListener::has_door_path()) { - char* path = SolarisAttachListener::door_path(); - ::fdetach(path); - ::unlink(path); - } + int dd = SolarisAttachListener::door_descriptor(); + if (dd >= 0) { + SolarisAttachListener::set_door_descriptor(-1); + ::close(dd); + } + if (SolarisAttachListener::has_door_path()) { + char* path = SolarisAttachListener::door_path(); + ::fdetach(path); + ::unlink(path); + SolarisAttachListener::set_door_path(NULL); } } } @@ -382,7 +384,10 @@ int fd, res; // register exit function - ::atexit(listener_cleanup); + if (!_atexit_registered) { + _atexit_registered = true; + ::atexit(listener_cleanup); + } // create the door descriptor int dd = ::door_create(enqueue_proc, NULL, 0); @@ -638,6 +643,26 @@ } } +bool AttachListener::check_socket_file() { + int ret; + struct stat64 st; + ret = stat64(SolarisAttachListener::door_path(), &st); + if (ret == -1) { // need to restart attach listener. + log_debug(attach)("Door file %s does not exist - Restart Attach Listener", + SolarisAttachListener::door_path()); + + listener_cleanup(); + + // wait to terminate current attach listener instance... + while (AttachListener::transit_state(AL_INITIALIZING, + AL_NOT_INITIALIZED) != AL_NOT_INITIALIZED) { + os::naked_yield(); + } + return is_init_trigger(); + } + return false; +} + // 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() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/windows/attachListener_windows.cpp openjdk-11-11.0.13+8/src/hotspot/os/windows/attachListener_windows.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/windows/attachListener_windows.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/windows/attachListener_windows.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -387,6 +387,12 @@ return Win32AttachListener::init(); } +// This function is used for Un*x OSes only. +// We need not to implement it for Windows. +bool AttachListener::check_socket_file() { + return false; +} + bool AttachListener::init_at_startup() { return true; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/windows/os_windows.cpp openjdk-11-11.0.13+8/src/hotspot/os/windows/os_windows.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/windows/os_windows.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/windows/os_windows.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -4600,9 +4600,7 @@ // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = _O_CREAT | _O_WRONLY | _O_BINARY; - if (!rewrite_existing) { - oflags |= _O_EXCL; - } + oflags |= rewrite_existing ? _O_TRUNC : _O_EXCL; return ::open(path, oflags, _S_IREAD | _S_IWRITE); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/os/windows/threadCritical_windows.cpp openjdk-11-11.0.13+8/src/hotspot/os/windows/threadCritical_windows.cpp --- openjdk-11-11.0.12+7/src/hotspot/os/windows/threadCritical_windows.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os/windows/threadCritical_windows.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -35,10 +35,10 @@ // See threadCritical.hpp for details of this class. // -static bool initialized = false; -static volatile int lock_count = -1; +static INIT_ONCE initialized = INIT_ONCE_STATIC_INIT; +static int lock_count = 0; static HANDLE lock_event; -static DWORD lock_owner = -1; +static DWORD lock_owner = 0; // // Note that Microsoft's critical region code contains a race @@ -51,48 +51,36 @@ // and found them ~30 times slower than the critical region code. // +static BOOL WINAPI initialize(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) { + lock_event = CreateEvent(NULL, false, true, NULL); + assert(lock_event != NULL, "unexpected return value from CreateEvent"); + return true; +} + ThreadCritical::ThreadCritical() { - DWORD current_thread = GetCurrentThreadId(); + InitOnceExecuteOnce(&initialized, &initialize, NULL, NULL); + DWORD current_thread = GetCurrentThreadId(); if (lock_owner != current_thread) { // Grab the lock before doing anything. - while (Atomic::cmpxchg(0, &lock_count, -1) != -1) { - if (initialized) { - DWORD ret = WaitForSingleObject(lock_event, INFINITE); - assert(ret == WAIT_OBJECT_0, "unexpected return value from WaitForSingleObject"); - } - } - - // Make sure the event object is allocated. - if (!initialized) { - // Locking will not work correctly unless this is autoreset. - lock_event = CreateEvent(NULL, false, false, NULL); - initialized = true; - } - - assert(lock_owner == -1, "Lock acquired illegally."); + DWORD ret = WaitForSingleObject(lock_event, INFINITE); + assert(ret == WAIT_OBJECT_0, "unexpected return value from WaitForSingleObject"); lock_owner = current_thread; - } else { - // Atomicity isn't required. Bump the recursion count. - lock_count++; } - - assert(lock_owner == GetCurrentThreadId(), "Lock acquired illegally."); + // Atomicity isn't required. Bump the recursion count. + lock_count++; } ThreadCritical::~ThreadCritical() { assert(lock_owner == GetCurrentThreadId(), "unlock attempt by wrong thread"); assert(lock_count >= 0, "Attempt to unlock when already unlocked"); + lock_count--; if (lock_count == 0) { // We're going to unlock - lock_owner = -1; - lock_count = -1; + lock_owner = 0; // No lost wakeups, lock_event stays signaled until reset. DWORD ret = SetEvent(lock_event); assert(ret != 0, "unexpected return value from SetEvent"); - } else { - // Just unwinding a recursive lock; - lock_count--; } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp openjdk-11-11.0.13+8/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp --- openjdk-11-11.0.12+7/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -64,7 +64,6 @@ # include # include # include -# include # include # include # include @@ -501,16 +500,6 @@ return 1; } } - -/* - NOTE: does not seem to work on bsd. - if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) { - // can't decode this kind of signal - info = NULL; - } else { - assert(sig == info->si_signo, "bad siginfo"); - } -*/ // decide if this trap can be handled by a stub address stub = NULL; diff -Nru openjdk-11-11.0.12+7/src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp openjdk-11-11.0.13+8/src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021, Arm Limited. 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. + * + */ + +#ifndef OS_CPU_LINUX_AARCH64_PAUTH_LINUX_AARCH64_INLINE_HPP +#define OS_CPU_LINUX_AARCH64_PAUTH_LINUX_AARCH64_INLINE_HPP + +// Only the PAC instructions in the NOP space can be used. This ensures the +// binaries work on systems without PAC. Write these instructions using their +// alternate "hint" instructions to ensure older compilers can still be used. + +#define XPACLRI "hint #0x7;" + +inline address pauth_strip_pointer(address ptr) { + register address result __asm__("x30") = ptr; + asm (XPACLRI : "+r"(result)); + return result; +} + +#undef XPACLRI + +#endif // OS_CPU_LINUX_AARCH64_PAUTH_LINUX_AARCH64_INLINE_HPP diff -Nru openjdk-11-11.0.12+7/src/hotspot/os_cpu/solaris_sparc/vm_version_solaris_sparc.cpp openjdk-11-11.0.13+8/src/hotspot/os_cpu/solaris_sparc/vm_version_solaris_sparc.cpp --- openjdk-11-11.0.12+7/src/hotspot/os_cpu/solaris_sparc/vm_version_solaris_sparc.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/os_cpu/solaris_sparc/vm_version_solaris_sparc.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -357,10 +357,15 @@ #define AV_SPARC_FMAF 0x00000100 // Fused Multiply-Add #endif +#ifndef AV_SPARC_FJATHHPC +#define AV_SPARC_FJATHHPC 0x00001000 // Fujitsu HPC (Athena) instrs +#endif + if (av & AV_SPARC_ASI_BLK_INIT) features |= ISA_blk_init_msk; if (av & AV_SPARC_FMAF) features |= ISA_fmaf_msk; if (av & AV_SPARC_VIS3) features |= ISA_vis3_msk; if (av & AV_SPARC_HPC) features |= ISA_hpc_msk; + if (av & AV_SPARC_FJATHHPC) features |= ISA_fjathhpc_msk; if (av & AV_SPARC_IMA) features |= ISA_ima_msk; if (av & AV_SPARC_AES) features |= ISA_aes_msk; if (av & AV_SPARC_DES) features |= ISA_des_msk; @@ -460,14 +465,13 @@ Sysinfo machine(SI_MACHINE); - bool is_sun4v = machine.match("sun4v"); // All Oracle SPARC + Fujitsu Athena+/++ + bool is_sun4v = machine.match("sun4v"); // All Oracle SPARC + Fujitsu Athena(+/++) bool is_sun4u = machine.match("sun4u"); // All other Fujitsu - // Handle Athena+/++ conservatively (simply because we are lacking info.). + // Handle Athena(+/++) conservatively (simply because we are lacking info.). - bool an_athena = has_athena_plus() || has_athena_plus2(); - bool do_sun4v = is_sun4v && !an_athena; - bool do_sun4u = is_sun4u || an_athena; + bool do_sun4v = is_sun4v && !is_athena(); + bool do_sun4u = is_sun4u || is_athena(); uint64_t synthetic = 0; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/c1/c1_GraphBuilder.cpp openjdk-11-11.0.13+8/src/hotspot/share/c1/c1_GraphBuilder.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/c1/c1_GraphBuilder.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/c1/c1_GraphBuilder.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -3065,9 +3065,11 @@ // necesary if std_entry is also a backward branch target because // then phi functions may be necessary in the header block. It's // also necessary when profiling so that there's a single block that - // can increment the interpreter_invocation_count. + // can increment the the counters. + // In addition, with range check elimination, we may need a valid block + // that dominates all the rest to insert range predicates. BlockBegin* new_header_block; - if (std_entry->number_of_preds() > 0 || count_invocations() || count_backedges()) { + if (std_entry->number_of_preds() > 0 || count_invocations() || count_backedges() || RangeCheckElimination) { new_header_block = header_block(std_entry, BlockBegin::std_entry_flag, state); } else { new_header_block = std_entry; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/c1/c1_LinearScan.cpp openjdk-11-11.0.13+8/src/hotspot/share/c1/c1_LinearScan.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/c1/c1_LinearScan.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/c1/c1_LinearScan.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -645,7 +645,8 @@ CodeEmitInfo* info = visitor.info_at(k); ValueStack* stack = info->stack(); for_each_state_value(stack, value, - set_live_gen_kill(value, op, live_gen, live_kill) + set_live_gen_kill(value, op, live_gen, live_kill); + local_has_fpu_registers = local_has_fpu_registers || value->type()->is_float_kind(); ); } @@ -1658,22 +1659,33 @@ Interval* precolored_cpu_intervals, *not_precolored_cpu_intervals; Interval* precolored_fpu_intervals, *not_precolored_fpu_intervals; - // allocate cpu registers + // collect cpu intervals create_unhandled_lists(&precolored_cpu_intervals, ¬_precolored_cpu_intervals, is_precolored_cpu_interval, is_virtual_cpu_interval); - // allocate fpu registers + // collect fpu intervals create_unhandled_lists(&precolored_fpu_intervals, ¬_precolored_fpu_intervals, is_precolored_fpu_interval, is_virtual_fpu_interval); - - // the fpu interval allocation cannot be moved down below with the fpu section as + // this fpu interval collection cannot be moved down below with the allocation section as // the cpu_lsw.walk() changes interval positions. + if (!has_fpu_registers()) { +#ifdef ASSERT + assert(not_precolored_fpu_intervals == Interval::end(), "missed an uncolored fpu interval"); +#else + if (not_precolored_fpu_intervals != Interval::end()) { + BAILOUT("missed an uncolored fpu interval"); + } +#endif + } + + // allocate cpu registers LinearScanWalker cpu_lsw(this, precolored_cpu_intervals, not_precolored_cpu_intervals); cpu_lsw.walk(); cpu_lsw.finish_allocation(); if (has_fpu_registers()) { + // allocate fpu registers LinearScanWalker fpu_lsw(this, precolored_fpu_intervals, not_precolored_fpu_intervals); fpu_lsw.walk(); fpu_lsw.finish_allocation(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/ci/ciEnv.cpp openjdk-11-11.0.13+8/src/hotspot/share/ci/ciEnv.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/ci/ciEnv.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/ci/ciEnv.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -545,7 +545,7 @@ // Calculate accessibility the hard way. if (!k->is_loaded()) { is_accessible = false; - } else if (!oopDesc::equals(k->loader(), accessor->loader()) && + } else if (k->loader() != accessor->loader() && get_klass_by_name_impl(accessor, cpool, k->name(), true) == NULL) { // Loaded only remotely. Not linked yet. is_accessible = false; @@ -596,7 +596,7 @@ index = cpool->object_to_cp_index(cache_index); oop obj = cpool->resolved_references()->obj_at(cache_index); if (obj != NULL) { - if (oopDesc::equals(obj, Universe::the_null_sentinel())) { + if (obj == Universe::the_null_sentinel()) { return ciConstant(T_OBJECT, get_object(NULL)); } BasicType bt = T_OBJECT; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/ci/ciObjectFactory.cpp openjdk-11-11.0.13+8/src/hotspot/share/ci/ciObjectFactory.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/ci/ciObjectFactory.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/ci/ciObjectFactory.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -249,7 +249,7 @@ // into the cache. Handle keyHandle(Thread::current(), key); ciObject* new_object = create_new_object(keyHandle()); - assert(oopDesc::equals(keyHandle(), new_object->get_oop()), "must be properly recorded"); + assert(keyHandle() == new_object->get_oop(), "must be properly recorded"); init_ident_of(new_object); assert(Universe::heap()->is_in_reserved(new_object->get_oop()), "must be"); @@ -450,8 +450,8 @@ for (int i=0; i<_unloaded_klasses->length(); i++) { ciKlass* entry = _unloaded_klasses->at(i); if (entry->name()->equals(name) && - oopDesc::equals(entry->loader(), loader) && - oopDesc::equals(entry->protection_domain(), domain)) { + entry->loader() == loader && + entry->protection_domain() == domain) { // We've found a match. return entry; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/classFileParser.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/classFileParser.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/classFileParser.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/classFileParser.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -3240,6 +3240,13 @@ valid_klass_reference_at(outer_class_info_index), "outer_class_info_index %u has bad constant type in class file %s", outer_class_info_index, CHECK_0); + + if (outer_class_info_index != 0) { + const Symbol* const outer_class_name = cp->klass_name_at(outer_class_info_index); + char* bytes = (char*)outer_class_name->bytes(); + guarantee_property(bytes[0] != JVM_SIGNATURE_ARRAY, + "Outer class is an array class in class file %s", CHECK_0); + } // Inner class name const u2 inner_name_index = cfs->get_u2_fast(); check_property( diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderData.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderData.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -242,7 +242,7 @@ VerifyContainsOopClosure(oop target) : _target(target), _found(false) {} void do_oop(oop* p) { - if (p != NULL && oopDesc::equals(RawAccess<>::oop_load(p), _target)) { + if (p != NULL && RawAccess<>::oop_load(p) == _target) { _found = true; } } @@ -425,7 +425,7 @@ // Just return if this dependency is to a class with the same or a parent // class_loader. - if (oopDesc::equals(from, to) || java_lang_ClassLoader::isAncestor(from, to)) { + if (from == to || java_lang_ClassLoader::isAncestor(from, to)) { return; // this class loader is in the parent list, no need to add it. } } @@ -854,6 +854,7 @@ if (dest.resolve() != NULL) { return; } else { + record_modified_oops(); dest = _handles.add(h()); } } @@ -1041,22 +1042,24 @@ // Add a new class loader data node to the list. Assign the newly created // ClassLoaderData into the java/lang/ClassLoader object as a hidden field ClassLoaderData* ClassLoaderDataGraph::add_to_graph(Handle loader, bool is_anonymous) { - NoSafepointVerifier no_safepoints; // we mustn't GC until we've installed the - // ClassLoaderData in the graph since the CLD - // contains oops in _handles that must be walked. - - ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous); + ClassLoaderData* cld; if (!is_anonymous) { - // First, Atomically set it - ClassLoaderData* old = java_lang_ClassLoader::cmpxchg_loader_data(cld, loader(), NULL); - if (old != NULL) { - delete cld; - // Returns the data. - return old; + MutexLocker ml(ClassLoaderDataGraph_lock); + cld = java_lang_ClassLoader::loader_data_raw(loader()); + if (cld != NULL) { + return cld; } + cld = new ClassLoaderData(loader, is_anonymous); + java_lang_ClassLoader::release_set_loader_data(loader(), cld); + } else { + cld = new ClassLoaderData(loader, is_anonymous); } + NoSafepointVerifier no_safepoints; // we mustn't GC until we've installed the + // ClassLoaderData in the graph since the CLD + // contains oops in _handles that must be walked. + // We won the race, and therefore the task of adding the data to the list of // class loader data ClassLoaderData** list_head = &_head; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderData.hpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderData.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -419,6 +419,10 @@ const char* loader_name_and_id() const; Symbol* name_and_id() const { return _name_and_id; } + unsigned identity_hash() const { + return (unsigned)((uintptr_t)this >> 3); + } + JFR_ONLY(DEFINE_TRACE_ID_METHODS;) }; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderData.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderData.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderData.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -45,7 +45,7 @@ if (loader == NULL) { return ClassLoaderData::the_null_class_loader_data(); } - return java_lang_ClassLoader::loader_data(loader); + return java_lang_ClassLoader::loader_data_acquire(loader); } inline ClassLoaderData* ClassLoaderData::class_loader_data(oop loader) { @@ -59,7 +59,7 @@ guarantee(loader() != NULL && oopDesc::is_oop(loader()), "Loader must be oop"); // Gets the class loader data out of the java/lang/ClassLoader object, if non-null // it's already in the loader_data, so no need to add - ClassLoaderData* loader_data= java_lang_ClassLoader::loader_data(loader()); + ClassLoaderData* loader_data= java_lang_ClassLoader::loader_data_acquire(loader()); if (loader_data) { return loader_data; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderStats.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderStats.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/classLoaderStats.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/classLoaderStats.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -139,7 +139,7 @@ void ClassLoaderStatsClosure::addEmptyParents(oop cl) { - while (cl != NULL && java_lang_ClassLoader::loader_data(cl) == NULL) { + while (cl != NULL && java_lang_ClassLoader::loader_data_acquire(cl) == NULL) { // This classloader has not loaded any classes ClassLoaderStats** cls_ptr = _stats->get(cl); if (cls_ptr == NULL) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/dictionary.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/dictionary.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/dictionary.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/dictionary.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -160,13 +160,13 @@ bool DictionaryEntry::contains_protection_domain(oop protection_domain) const { #ifdef ASSERT - if (oopDesc::equals(protection_domain, instance_klass()->protection_domain())) { + if (protection_domain == instance_klass()->protection_domain()) { // Ensure this doesn't show up in the pd_set (invariant) bool in_pd_set = false; for (ProtectionDomainEntry* current = pd_set_acquire(); current != NULL; current = current->next()) { - if (oopDesc::equals(current->object_no_keepalive(), protection_domain)) { + if (current->object_no_keepalive() == protection_domain) { in_pd_set = true; break; } @@ -178,7 +178,7 @@ } #endif /* ASSERT */ - if (oopDesc::equals(protection_domain, instance_klass()->protection_domain())) { + if (protection_domain == instance_klass()->protection_domain()) { // Succeeds trivially return true; } @@ -186,7 +186,7 @@ for (ProtectionDomainEntry* current = pd_set_acquire(); current != NULL; current = current->next()) { - if (oopDesc::equals(current->object_no_keepalive(), protection_domain)) return true; + if (current->object_no_keepalive() == protection_domain) return true; } return false; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/javaClasses.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/javaClasses.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/javaClasses.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/javaClasses.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -212,7 +212,7 @@ #if INCLUDE_CDS void java_lang_String::serialize_offsets(SerializeClosure* f) { STRING_FIELDS_DO(FIELD_SERIALIZE_OFFSET); - f->do_u4((u4*)&initialized); + f->do_bool(&initialized); } #endif @@ -870,7 +870,7 @@ } else { assert(Universe::is_module_initialized() || (ModuleEntryTable::javabase_defined() && - (oopDesc::equals(module(), ModuleEntryTable::javabase_moduleEntry()->module()))), + (module() == ModuleEntryTable::javabase_moduleEntry()->module())), "Incorrect java.lang.Module specification while creating mirror"); set_module(mirror(), module()); } @@ -947,7 +947,7 @@ } // set the classLoader field in the java_lang_Class instance - assert(oopDesc::equals(class_loader(), k->class_loader()), "should be same"); + assert(class_loader() == k->class_loader(), "should be same"); set_class_loader(mirror(), class_loader()); // Setup indirection from klass->mirror @@ -1501,9 +1501,9 @@ // Note: create_basic_type_mirror above initializes ak to a non-null value. type = ArrayKlass::cast(ak)->element_type(); } else { - assert(oopDesc::equals(java_class, Universe::void_mirror()), "only valid non-array primitive"); + assert(java_class == Universe::void_mirror(), "only valid non-array primitive"); } - assert(oopDesc::equals(Universe::java_mirror(type), java_class), "must be consistent"); + assert(Universe::java_mirror(type) == java_class, "must be consistent"); return type; } @@ -1558,7 +1558,7 @@ #if INCLUDE_CDS void java_lang_Class::serialize_offsets(SerializeClosure* f) { - f->do_u4((u4*)&offsets_computed); + f->do_bool(&offsets_computed); f->do_u4((u4*)&_init_lock_offset); CLASS_FIELDS_DO(FIELD_SERIALIZE_OFFSET); @@ -3865,14 +3865,14 @@ } bool java_lang_invoke_MethodType::equals(oop mt1, oop mt2) { - if (oopDesc::equals(mt1, mt2)) + if (mt1 == mt2) return true; - if (!oopDesc::equals(rtype(mt1), rtype(mt2))) + if (rtype(mt1) != rtype(mt2)) return false; if (ptype_count(mt1) != ptype_count(mt2)) return false; for (int i = ptype_count(mt1) - 1; i >= 0; i--) { - if (!oopDesc::equals(ptype(mt1, i), ptype(mt2, i))) + if (ptype(mt1, i) != ptype(mt2, i)) return false; } return true; @@ -4020,14 +4020,20 @@ int java_lang_ClassLoader::nameAndId_offset = -1; int java_lang_ClassLoader::unnamedModule_offset = -1; -ClassLoaderData* java_lang_ClassLoader::loader_data(oop loader) { +ClassLoaderData* java_lang_ClassLoader::loader_data_acquire(oop loader) { assert(loader != NULL && oopDesc::is_oop(loader), "loader must be oop"); - return HeapAccess<>::load_at(loader, _loader_data_offset); + return HeapAccess::load_at(loader, _loader_data_offset); } -ClassLoaderData* java_lang_ClassLoader::cmpxchg_loader_data(ClassLoaderData* new_data, oop loader, ClassLoaderData* expected_data) { +ClassLoaderData* java_lang_ClassLoader::loader_data_raw(oop loader) { assert(loader != NULL && oopDesc::is_oop(loader), "loader must be oop"); - return HeapAccess<>::atomic_cmpxchg_at(new_data, loader, _loader_data_offset, expected_data); + return RawAccess<>::load_at(loader, _loader_data_offset); +} + +void java_lang_ClassLoader::release_set_loader_data(oop loader, ClassLoaderData* new_data) { + assert(loader != NULL, "loader must not be NULL"); + assert(oopDesc::is_oop(loader), "loader must be oop"); + HeapAccess::store_at(loader, _loader_data_offset, new_data); } #define CLASSLOADER_FIELDS_DO(macro) \ @@ -4085,7 +4091,7 @@ // This loop taken verbatim from ClassLoader.java: do { acl = parent(acl); - if (oopDesc::equals(cl, acl)) { + if (cl == acl) { return true; } assert(++loop_count > 0, "loop_count overflow"); @@ -4115,7 +4121,7 @@ oop cl = SystemDictionary::java_system_loader(); while(cl != NULL) { - if (oopDesc::equals(cl, loader)) return true; + if (cl == loader) return true; cl = parent(cl); } return false; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/javaClasses.hpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/javaClasses.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/javaClasses.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/javaClasses.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -1320,8 +1320,9 @@ static void compute_offsets(); static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; - static ClassLoaderData* loader_data(oop loader); - static ClassLoaderData* cmpxchg_loader_data(ClassLoaderData* new_data, oop loader, ClassLoaderData* expected_data); + static ClassLoaderData* loader_data_acquire(oop loader); + static ClassLoaderData* loader_data_raw(oop loader); + static void release_set_loader_data(oop loader, ClassLoaderData* new_data); static oop parent(oop loader); static oop name(oop loader); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/protectionDomainCache.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/protectionDomainCache.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/protectionDomainCache.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/protectionDomainCache.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -125,7 +125,7 @@ ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, Handle protection_domain) { for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) { - if (oopDesc::equals(e->object_no_keepalive(), protection_domain())) { + if (e->object_no_keepalive() == protection_domain()) { return e; } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/stringTable.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/stringTable.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/stringTable.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/stringTable.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -324,7 +324,7 @@ return found_string; } return StringTable::the_table()->do_intern(string_or_null_h, name, len, - hash, CHECK_NULL); + hash, THREAD); } class StringTableCreateEntry : public StackObj { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/systemDictionary.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/systemDictionary.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/systemDictionary.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/systemDictionary.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -179,7 +179,7 @@ return false; } return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() || - oopDesc::equals(class_loader, _java_system_loader)); + class_loader == _java_system_loader); } // Returns true if the passed class loader is the platform class loader. @@ -384,7 +384,7 @@ ((quicksuperk = childk->super()) != NULL) && ((quicksuperk->name() == class_name) && - (oopDesc::equals(quicksuperk->class_loader(), class_loader())))) { + (quicksuperk->class_loader() == class_loader()))) { return quicksuperk; } else { PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data); @@ -518,7 +518,7 @@ bool calledholdinglock = ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject); assert(calledholdinglock,"must hold lock for notify"); - assert((!oopDesc::equals(lockObject(), _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait"); + assert((lockObject() != _system_loader_lock_obj && !is_parallelCapable(lockObject)), "unexpected double_lock_wait"); ObjectSynchronizer::notifyall(lockObject, THREAD); intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD); SystemDictionary_lock->wait(); @@ -824,7 +824,7 @@ // If everything was OK (no exceptions, no null return value), and // class_loader is NOT the defining loader, do a little more bookkeeping. if (!HAS_PENDING_EXCEPTION && k != NULL && - !oopDesc::equals(k->class_loader(), class_loader())) { + k->class_loader() != class_loader()) { check_constraints(d_hash, k, class_loader, false, THREAD); @@ -977,7 +977,7 @@ if (host_klass != NULL) { // Create a new CLD for anonymous class, that uses the same class loader // as the host_klass - guarantee(oopDesc::equals(host_klass->class_loader(), class_loader()), "should be the same"); + guarantee(host_klass->class_loader() == class_loader(), "should be the same"); loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader); } else { loader_data = ClassLoaderData::class_loader_data(class_loader()); @@ -1750,7 +1750,7 @@ == ObjectSynchronizer::owner_other) { // contention will likely happen, so increment the corresponding // contention counter. - if (oopDesc::equals(loader_lock(), _system_loader_lock_obj)) { + if (loader_lock() == _system_loader_lock_obj) { ClassLoader::sync_systemLoaderLockContentionRate()->inc(); } else { ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc(); @@ -2186,7 +2186,7 @@ // cleared if revocation occurs too often for this type // NOTE that we must only do this when the class is initally // defined, not each time it is referenced from a new class loader - if (oopDesc::equals(k->class_loader(), class_loader())) { + if (k->class_loader() == class_loader()) { k->set_prototype_header(markOopDesc::biased_locking_prototype()); } } @@ -2379,7 +2379,7 @@ Handle loader1, Handle loader2, bool is_method, TRAPS) { // Nothing to do if loaders are the same. - if (oopDesc::equals(loader1(), loader2())) { + if (loader1() == loader2()) { return NULL; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/classfile/verifier.cpp openjdk-11-11.0.13+8/src/hotspot/share/classfile/verifier.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/classfile/verifier.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/classfile/verifier.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2244,6 +2244,7 @@ // Get field name and signature Symbol* field_name = cp->name_ref_at(index); Symbol* field_sig = cp->signature_ref_at(index); + bool is_getfield = false; if (!SignatureVerifier::is_valid_type_signature(field_sig)) { class_format_error( @@ -2294,11 +2295,9 @@ break; } case Bytecodes::_getfield: { + is_getfield = true; stack_object_type = current_frame->pop_stack( target_class_type, CHECK_VERIFY(this)); - for (int i = 0; i < n; i++) { - current_frame->push_stack(field_type[i], CHECK_VERIFY(this)); - } goto check_protected; } case Bytecodes::_putfield: { @@ -2328,7 +2327,15 @@ check_protected: { if (_this_type == stack_object_type) break; // stack_object_type must be assignable to _current_class_type - if (was_recursively_verified()) return; + if (was_recursively_verified()) { + if (is_getfield) { + // Push field type for getfield. + for (int i = 0; i < n; i++) { + current_frame->push_stack(field_type[i], CHECK_VERIFY(this)); + } + } + return; + } Symbol* ref_class_name = cp->klass_name_at(cp->klass_ref_index_at(index)); if (!name_in_supers(ref_class_name, current_class())) @@ -2357,6 +2364,12 @@ } default: ShouldNotReachHere(); } + if (is_getfield) { + // Push field type for getfield after doing protection check. + for (int i = 0; i < n; i++) { + current_frame->push_stack(field_type[i], CHECK_VERIFY(this)); + } + } } // Look at the method's handlers. If the bci is in the handler's try block diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/code/dependencies.cpp openjdk-11-11.0.13+8/src/hotspot/share/code/dependencies.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/code/dependencies.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/code/dependencies.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1559,7 +1559,7 @@ return false; } } - assert(false, "root method not found"); + // Miranda. return true; } return false; @@ -1881,6 +1881,26 @@ return NULL; } +// This function is used by find_unique_concrete_method(non vtable based) +// to check whether subtype method overrides the base method. +static bool overrides(Method* sub_m, Method* base_m) { + assert(base_m != NULL, "base method should be non null"); + if (sub_m == NULL) { + return false; + } + /** + * If base_m is public or protected then sub_m always overrides. + * If base_m is !public, !protected and !private (i.e. base_m is package private) + * then sub_m should be in the same package as that of base_m. + * For package private base_m this is conservative approach as it allows only subset of all allowed cases in + * the jvm specification. + **/ + if (base_m->is_public() || base_m->is_protected() || + base_m->method_holder()->is_same_class_package(sub_m->method_holder())) { + return true; + } + return false; +} // Find the set of all non-abstract methods under ctxk that match m. // (The method m must be defined or inherited in ctxk.) @@ -1909,6 +1929,9 @@ } else if (Dependencies::find_witness_AME(ctxk, fm) != NULL) { // Found a concrete subtype which does not override abstract root method. return NULL; + } else if (!overrides(fm, m)) { + // Found method doesn't override abstract root method. + return NULL; } assert(Dependencies::is_concrete_root_method(fm, ctxk) == Dependencies::is_concrete_method(m, ctxk), "mismatch"); #ifndef PRODUCT @@ -1945,12 +1968,12 @@ if (changes == NULL) { // Validate all CallSites - if (!oopDesc::equals(java_lang_invoke_CallSite::target(call_site), method_handle)) + if (java_lang_invoke_CallSite::target(call_site) != method_handle) return call_site->klass(); // assertion failed } else { // Validate the given CallSite - if (oopDesc::equals(call_site, changes->call_site()) && !oopDesc::equals(java_lang_invoke_CallSite::target(call_site), changes->method_handle())) { - assert(!oopDesc::equals(method_handle, changes->method_handle()), "must be"); + if (call_site == changes->call_site() && java_lang_invoke_CallSite::target(call_site) != changes->method_handle()) { + assert(method_handle != changes->method_handle(), "must be"); return call_site->klass(); // assertion failed } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/code/dependencyContext.cpp openjdk-11-11.0.13+8/src/hotspot/share/code/dependencyContext.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/code/dependencyContext.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/code/dependencyContext.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, 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 @@ -246,6 +246,7 @@ } } } +#endif //PRODUCT bool DependencyContext::is_dependent_nmethod(nmethod* nm) { for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) { @@ -267,8 +268,6 @@ return false; } -#endif //PRODUCT - int nmethodBucket::decrement() { return Atomic::sub(1, &_count); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/code/dependencyContext.hpp openjdk-11-11.0.13+8/src/hotspot/share/code/dependencyContext.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/code/dependencyContext.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/code/dependencyContext.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -147,8 +147,8 @@ #ifndef PRODUCT void print_dependent_nmethods(bool verbose); +#endif //PRODUCT bool is_dependent_nmethod(nmethod* nm); bool find_stale_entries(); -#endif //PRODUCT }; #endif // SHARE_VM_CODE_DEPENDENCYCONTEXT_HPP diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/compiler/compileBroker.cpp openjdk-11-11.0.13+8/src/hotspot/share/compiler/compileBroker.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/compiler/compileBroker.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/compiler/compileBroker.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -333,7 +333,7 @@ // We only allow the last compiler thread of each type to get removed. jobject last_compiler = c1 ? compiler1_object(compiler_count - 1) : compiler2_object(compiler_count - 1); - if (oopDesc::equals(ct->threadObj(), JNIHandles::resolve_non_null(last_compiler))) { + if (ct->threadObj() == JNIHandles::resolve_non_null(last_compiler)) { if (do_it) { assert_locked_or_safepoint(CompileThread_lock); // Update must be consistent. compiler->set_num_compiler_threads(compiler_count - 1); @@ -1765,7 +1765,7 @@ int compiler_number = 0; bool found = false; for (; compiler_number < count; compiler_number++) { - if (oopDesc::equals(JNIHandles::resolve_non_null(compiler_objects[compiler_number]), compiler_obj)) { + if (JNIHandles::resolve_non_null(compiler_objects[compiler_number]) == compiler_obj) { found = true; break; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/compiler/compileBroker.hpp openjdk-11-11.0.13+8/src/hotspot/share/compiler/compileBroker.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/compiler/compileBroker.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/compiler/compileBroker.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -272,10 +272,6 @@ static void shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread); public: - - static DirectivesStack* dirstack(); - static void set_dirstack(DirectivesStack* stack); - enum { // The entry bci used for non-OSR compilations. standard_entry_bci = InvocationEntryBci @@ -290,7 +286,6 @@ static bool compilation_is_complete(const methodHandle& method, int osr_bci, int comp_level); static bool compilation_is_in_queue(const methodHandle& method); static void print_compile_queues(outputStream* st); - static void print_directives(outputStream* st); static int queue_size(int comp_level) { CompileQueue *q = compile_queue(comp_level); return q != NULL ? q->size() : 0; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/epsilon/epsilon_globals.hpp openjdk-11-11.0.13+8/src/hotspot/share/gc/epsilon/epsilon_globals.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/epsilon/epsilon_globals.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/epsilon/epsilon_globals.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -69,7 +69,7 @@ "smaller TLABs until policy catches up.") \ \ experimental(bool, EpsilonElasticTLABDecay, true, \ - "Use timed decays to shrik TLAB sizes. This conserves memory " \ + "Use timed decays to shrink TLAB sizes. This conserves memory " \ "for the threads that allocate in bursts of different sizes, " \ "for example the small/rare allocations coming after the initial "\ "large burst.") \ diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/parallel/psCompactionManager.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/parallel/psCompactionManager.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/parallel/psCompactionManager.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/parallel/psCompactionManager.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -183,7 +183,7 @@ void InstanceClassLoaderKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { InstanceKlass::oop_pc_follow_contents(obj, cm); - ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); + ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data_acquire(obj); if (loader_data != NULL) { cm->follow_class_loader(loader_data); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shared/barrierSet.hpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/barrierSet.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shared/barrierSet.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/barrierSet.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -296,10 +296,6 @@ static oop resolve(oop obj) { return Raw::resolve(obj); } - - static bool equals(oop o1, oop o2) { - return Raw::equals(o1, o2); - } }; }; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shared/memAllocator.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/memAllocator.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shared/memAllocator.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/memAllocator.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -377,6 +377,10 @@ HeapWord* mem = mem_allocate(allocation); if (mem != NULL) { obj = initialize(mem); + } else { + // The unhandled oop detector will poison local variable obj, + // so reset it to NULL if mem is NULL. + obj = NULL; } } return obj; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -270,7 +270,7 @@ } bool StringDedupTable::equals(typeArrayOop value1, typeArrayOop value2) { - return (oopDesc::equals(value1, value2) || + return (value1 == value2 || (value1->length() == value2->length() && (!memcmp(value1->base(T_BYTE), value2->base(T_BYTE), diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -690,7 +690,7 @@ } else if (mem->is_MergeMem()) { res = mem->as_MergeMem()->memory_at(alias); } else if (mem->is_Store() || mem->is_LoadStore() || mem->is_ClearArray()) { - assert(alias = Compile::AliasIdxRaw, "following raw memory can't lead to a barrier"); + assert(alias == Compile::AliasIdxRaw, "following raw memory can't lead to a barrier"); res = mem->in(MemNode::Memory); } else { #ifdef ASSERT diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -50,11 +50,13 @@ FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false); #endif - - if (UseLargePages && (MaxHeapSize / os::large_page_size()) < ShenandoahHeapRegion::MIN_NUM_REGIONS) { - warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit", - os::large_page_size() / K); - FLAG_SET_DEFAULT(ShenandoahUncommit, false); + if (UseLargePages) { + size_t large_page_size = os::large_page_size(); + if ((align_up(MaxHeapSize, large_page_size) / large_page_size) < ShenandoahHeapRegion::MIN_NUM_REGIONS) { + warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit", + os::large_page_size() / K); + FLAG_SET_DEFAULT(ShenandoahUncommit, false); + } } // Enable NUMA by default. While Shenandoah is not NUMA-aware, enabling NUMA makes diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -85,7 +85,7 @@ ShenandoahAllRootScanner* _rp; public: ShenandoahInitMarkRootsTask(ShenandoahAllRootScanner* rp) : - AbstractGangTask("Shenandoah init mark roots task"), + AbstractGangTask("Shenandoah Init Mark Roots"), _rp(rp) { } @@ -127,7 +127,7 @@ ShenandoahRootUpdater* _root_updater; public: ShenandoahUpdateRootsTask(ShenandoahRootUpdater* root_updater) : - AbstractGangTask("Shenandoah update roots task"), + AbstractGangTask("Shenandoah Update Roots"), _root_updater(root_updater) { } @@ -149,7 +149,7 @@ public: ShenandoahConcurrentMarkingTask(ShenandoahConcurrentMark* cm, ShenandoahTaskTerminator* terminator) : - AbstractGangTask("Root Region Scan"), _cm(cm), _terminator(terminator) { + AbstractGangTask("Shenandoah Concurrent Mark"), _cm(cm), _terminator(terminator) { } void work(uint worker_id) { @@ -219,7 +219,7 @@ public: ShenandoahFinalMarkingTask(ShenandoahConcurrentMark* cm, ShenandoahTaskTerminator* terminator, bool dedup_string) : - AbstractGangTask("Shenandoah Final Marking"), _cm(cm), _terminator(terminator), _dedup_string(dedup_string) { + AbstractGangTask("Shenandoah Final Mark"), _cm(cm), _terminator(terminator), _dedup_string(dedup_string) { } void work(uint worker_id) { @@ -602,7 +602,7 @@ public: ShenandoahRefProcTaskProxy(AbstractRefProcTaskExecutor::ProcessTask& proc_task, ShenandoahTaskTerminator* t) : - AbstractGangTask("Process reference objects in parallel"), + AbstractGangTask("Shenandoah Process Weak References"), _proc_task(proc_task), _terminator(t) { } @@ -761,7 +761,7 @@ public: ShenandoahPrecleanTask(ReferenceProcessor* rp) : - AbstractGangTask("Precleaning task"), + AbstractGangTask("Shenandoah Precleaning"), _rp(rp) {} void work(uint worker_id) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -93,7 +93,7 @@ bool implicit_gc_requested = _gc_requested.is_set() && !is_explicit_gc(_requested_gc_cause); // This control loop iteration have seen this much allocations. - size_t allocs_seen = Atomic::xchg(0, &_allocs_seen); + size_t allocs_seen = Atomic::xchg(0, &_allocs_seen, memory_order_relaxed); // Check if we have seen a new target for soft max heap size. bool soft_max_changed = check_soft_max_changed(); @@ -627,7 +627,7 @@ void ShenandoahControlThread::pacing_notify_alloc(size_t words) { assert(ShenandoahPacing, "should only call when pacing is enabled"); - Atomic::add(words, &_allocs_seen); + Atomic::add(words, &_allocs_seen, memory_order_relaxed); } void ShenandoahControlThread::set_forced_counters_update(bool value) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -518,7 +518,7 @@ public: ShenandoahResetBitmapTask() : - AbstractGangTask("Parallel Reset Bitmap Task") {} + AbstractGangTask("Shenandoah Reset Bitmap") {} void work(uint worker_id) { ShenandoahHeapRegion* region = _regions.next(); @@ -960,7 +960,7 @@ ShenandoahEvacuationTask(ShenandoahHeap* sh, ShenandoahCollectionSet* cs, bool concurrent) : - AbstractGangTask("Parallel Evacuation Task"), + AbstractGangTask("Shenandoah Evacuation"), _sh(sh), _cs(cs), _concurrent(concurrent) @@ -1078,7 +1078,7 @@ public: ShenandoahEvacuateUpdateRootsTask(ShenandoahRootEvacuator* rp) : - AbstractGangTask("Shenandoah evacuate and update roots"), + AbstractGangTask("Shenandoah Evacuate/Update Roots"), _rp(rp) {} void work(uint worker_id) { @@ -1355,7 +1355,7 @@ public: ShenandoahParallelHeapRegionTask(ShenandoahHeapRegionClosure* blk) : - AbstractGangTask("Parallel Region Task"), + AbstractGangTask("Shenandoah Parallel Region Operation"), _heap(ShenandoahHeap::heap()), _blk(blk), _index(0) {} void work(uint worker_id) { @@ -2159,7 +2159,7 @@ bool _concurrent; public: ShenandoahUpdateHeapRefsTask(ShenandoahRegionIterator* regions, bool concurrent) : - AbstractGangTask("Concurrent Update References Task"), + AbstractGangTask("Shenandoah Update References"), cl(T()), _heap(ShenandoahHeap::heap()), _regions(regions), diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -462,7 +462,7 @@ } } -void ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) { +size_t ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) { // Absolute minimums we should not ever break. static const size_t MIN_REGION_SIZE = 256*K; @@ -537,14 +537,28 @@ region_size = ShenandoahRegionSize; } - // Make sure region size is at least one large page, if enabled. - // The heap sizes would be rounded by heap initialization code by - // page size, so we need to round up the region size too, to cover - // the heap exactly. + // Make sure region size and heap size are page aligned. + // If large pages are used, we ensure that region size is aligned to large page size if + // heap size is large enough to accommodate minimal number of regions. Otherwise, we align + // region size to regular page size. + + // Figure out page size to use, and aligns up heap to page size + int page_size = os::vm_page_size(); if (UseLargePages) { - region_size = MAX2(region_size, os::large_page_size()); + size_t large_page_size = os::large_page_size(); + max_heap_size = align_up(max_heap_size, large_page_size); + if ((max_heap_size / align_up(region_size, large_page_size)) >= MIN_NUM_REGIONS) { + page_size = (int)large_page_size; + } else { + // Should have been checked during argument initialization + assert(!ShenandoahUncommit, "Uncommit requires region size aligns to large page size"); + } + } else { + max_heap_size = align_up(max_heap_size, page_size); } + // Align region size to page size + region_size = align_up(region_size, page_size); int region_size_log = log2_long((jlong) region_size); // Recalculate the region size to make sure it's a power of // 2. This means that region_size is the largest power of 2 that's @@ -614,6 +628,8 @@ byte_size_in_proper_unit(HumongousThresholdBytes), proper_unit_for_byte_size(HumongousThresholdBytes)); log_info(gc, init)("Max TLAB size: " SIZE_FORMAT "%s", byte_size_in_proper_unit(MaxTLABSizeBytes), proper_unit_for_byte_size(MaxTLABSizeBytes)); + + return max_heap_size; } void ShenandoahHeapRegion::do_commit() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -250,7 +250,8 @@ static const size_t MIN_NUM_REGIONS = 10; - static void setup_sizes(size_t max_heap_size); + // Return adjusted max heap size + static size_t setup_sizes(size_t max_heap_size); double empty_time() { return _empty_time; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -327,7 +327,7 @@ public: ShenandoahPrepareForCompactionTask(PreservedMarksSet *preserved_marks, ShenandoahHeapRegionSet **worker_slices) : - AbstractGangTask("Shenandoah Prepare For Compaction Task"), + AbstractGangTask("Shenandoah Prepare For Compaction"), _preserved_marks(preserved_marks), _heap(ShenandoahHeap::heap()), _worker_slices(worker_slices) { } @@ -719,7 +719,7 @@ public: ShenandoahAdjustPointersTask() : - AbstractGangTask("Shenandoah Adjust Pointers Task"), + AbstractGangTask("Shenandoah Adjust Pointers"), _heap(ShenandoahHeap::heap()) { } @@ -741,7 +741,7 @@ PreservedMarksSet* _preserved_marks; public: ShenandoahAdjustRootPointersTask(ShenandoahRootAdjuster* rp, PreservedMarksSet* preserved_marks) : - AbstractGangTask("Shenandoah Adjust Root Pointers Task"), + AbstractGangTask("Shenandoah Adjust Root Pointers"), _rp(rp), _preserved_marks(preserved_marks) {} @@ -805,7 +805,7 @@ public: ShenandoahCompactObjectsTask(ShenandoahHeapRegionSet** worker_slices) : - AbstractGangTask("Shenandoah Compact Objects Task"), + AbstractGangTask("Shenandoah Compact Objects"), _heap(ShenandoahHeap::heap()), _worker_slices(worker_slices) { } @@ -953,7 +953,7 @@ public: ShenandoahMCResetCompleteBitmapTask() : - AbstractGangTask("Parallel Reset Bitmap Task") { + AbstractGangTask("Shenandoah Reset Bitmap") { } void work(uint worker_id) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -187,7 +187,7 @@ void ShenandoahPacer::restart_with(size_t non_taxable_bytes, double tax_rate) { size_t initial = (size_t)(non_taxable_bytes * tax_rate) >> LogHeapWordSize; STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t)); - Atomic::xchg((intptr_t)initial, &_budget); + Atomic::xchg((intptr_t)initial, &_budget, memory_order_relaxed); Atomic::store(tax_rate, &_tax_rate); Atomic::inc(&_epoch); @@ -209,14 +209,14 @@ return false; } new_val = cur - tax; - } while (Atomic::cmpxchg(new_val, &_budget, cur) != cur); + } while (Atomic::cmpxchg(new_val, &_budget, cur, memory_order_relaxed) != cur); return true; } void ShenandoahPacer::unpace_for_alloc(intptr_t epoch, size_t words) { assert(ShenandoahPacing, "Only be here when pacing is enabled"); - if (_epoch != epoch) { + if (Atomic::load(&_epoch) != epoch) { // Stale ticket, no need to unpace. return; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -53,13 +53,13 @@ inline void ShenandoahPacer::report_progress_internal(size_t words) { assert(ShenandoahPacing, "Only be here when pacing is enabled"); STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t)); - Atomic::add((intptr_t)words, &_progress); + Atomic::add((intptr_t)words, &_progress, memory_order_relaxed); } inline void ShenandoahPacer::add_budget(size_t words) { STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t)); intptr_t inc = (intptr_t) words; - intptr_t new_budget = Atomic::add(inc, &_budget); + intptr_t new_budget = Atomic::add(inc, &_budget, memory_order_relaxed); // Was the budget replenished beyond zero? Then all pacing claims // are satisfied, notify the waiters. Avoid taking any locks here, diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -35,7 +35,7 @@ IsAlive* is_alive, KeepAlive* keep_alive, uint num_workers) : - AbstractGangTask("Parallel Weak Root Cleaning Task"), + AbstractGangTask("Shenandoah Weak Root Cleaning"), _phase(phase), _weak_roots(phase, num_workers), _is_alive(is_alive), _keep_alive(keep_alive) { assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -129,7 +129,7 @@ ShenandoahStringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) : - AbstractGangTask("StringDedupUnlinkOrOopsDoTask"), + AbstractGangTask("Shenandoah String Dedup Unlink/Process"), _cl(is_alive, keep_alive) { StringDedup::gc_prologue(allow_resize_and_rehash); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -411,7 +411,7 @@ ShenandoahRootVerifier* verifier, const char* label, ShenandoahVerifier::VerifyOptions options) : - AbstractGangTask("Shenandoah Parallel Verifier Reachable Task"), + AbstractGangTask("Shenandoah Verifier Reachable Objects"), _label(label), _verifier(verifier), _options(options), @@ -476,7 +476,7 @@ ShenandoahLivenessData* ld, const char* label, ShenandoahVerifier::VerifyOptions options) : - AbstractGangTask("Shenandoah Parallel Verifier Marked Region"), + AbstractGangTask("Shenandoah Verifier Marked Objects"), _label(label), _options(options), _heap(ShenandoahHeap::heap()), diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/interpreter/bytecodeInterpreter.cpp openjdk-11-11.0.13+8/src/hotspot/share/interpreter/bytecodeInterpreter.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/interpreter/bytecodeInterpreter.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/interpreter/bytecodeInterpreter.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2429,7 +2429,7 @@ handle_exception); result = THREAD->vm_result(); } - if (oopDesc::equals(result, Universe::the_null_sentinel())) + if (result == Universe::the_null_sentinel()) result = NULL; VERIFY_OOP(result); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/interpreter/interpreterRuntime.cpp openjdk-11-11.0.13+8/src/hotspot/share/interpreter/interpreterRuntime.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/interpreter/interpreterRuntime.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/interpreter/interpreterRuntime.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -194,7 +194,7 @@ if (rindex >= 0) { oop coop = m->constants()->resolved_references()->obj_at(rindex); oop roop = (result == NULL ? Universe::the_null_sentinel() : result); - assert(oopDesc::equals(roop, coop), "expected result for assembly code"); + assert(roop == coop, "expected result for assembly code"); } } #endif @@ -1282,7 +1282,10 @@ IRT_END -IRT_ENTRY(void, InterpreterRuntime::post_method_exit(JavaThread *thread)) +// This is a JRT_BLOCK_ENTRY because we have to stash away the return oop +// before transitioning to VM, and restore it after transitioning back +// to Java. The return oop at the top-of-stack, is not walked by the GC. +JRT_BLOCK_ENTRY(void, InterpreterRuntime::post_method_exit(JavaThread *thread)) LastFrameAccessor last_frame(thread); JvmtiExport::post_method_exit(thread, last_frame.method(), last_frame.get_frame()); IRT_END diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -468,9 +468,9 @@ bool do_entry(oop const& key, ClassLoaderStats* const& cls) { const ClassLoaderData* this_cld = cls->_class_loader != NULL ? - java_lang_ClassLoader::loader_data(cls->_class_loader) : (ClassLoaderData*)NULL; + java_lang_ClassLoader::loader_data_acquire(cls->_class_loader) : (ClassLoaderData*)NULL; const ClassLoaderData* parent_cld = cls->_parent != NULL ? - java_lang_ClassLoader::loader_data(cls->_parent) : (ClassLoaderData*)NULL; + java_lang_ClassLoader::loader_data_acquire(cls->_parent) : (ClassLoaderData*)NULL; EventClassLoaderStatistics event; event.set_classLoader(this_cld); event.set_parentClassLoader(parent_cld); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -321,7 +321,6 @@ int _cur_index; const u4 _max_frames; volatile bool _disenrolled; - static Monitor* _transition_block_lock; JavaThread* next_thread(ThreadsList* t_list, JavaThread* first_sampled, JavaThread* current); void task_stacktrace(JfrSampleType type, JavaThread** last_thread); @@ -339,12 +338,10 @@ public: void run(); - static Monitor* transition_block() { return _transition_block_lock; } + static Monitor* transition_block() { return JfrThreadSampler_lock; } static void on_javathread_suspend(JavaThread* thread); }; -Monitor* JfrThreadSampler::_transition_block_lock = new Monitor(Mutex::leaf, "Trace block", true, Monitor::_safepoint_check_never); - static void clear_transition_block(JavaThread* jt) { jt->clear_trace_flag(); JfrThreadLocal* const tl = jt->jfr_thread_local(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -39,6 +39,7 @@ #include "jfr/writers/jfrTypeWriterHost.hpp" #include "memory/iterator.hpp" #include "memory/resourceArea.hpp" +#include "memory/universe.hpp" #include "oops/instanceKlass.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" @@ -60,6 +61,7 @@ static JfrArtifactClosure* _subsystem_callback = NULL; static bool _class_unload = false; static bool _flushpoint = false; +static bool _clear_artifacts = false; // incremented on each rotation static u8 checkpoint_id = 1; @@ -80,6 +82,10 @@ return !current_epoch(); } +static bool is_initial_typeset_for_chunk() { + return _clear_artifacts && !_class_unload; +} + static bool is_complete() { return !_artifacts->has_klass_entries() && current_epoch(); } @@ -96,6 +102,35 @@ return create_symbol_id(_artifacts->bootstrap_name(leakp)); } +static const char* primitive_name(KlassPtr type_array_klass) { + switch (type_array_klass->name()->base()[1]) { + case JVM_SIGNATURE_BOOLEAN: return "boolean"; + case JVM_SIGNATURE_BYTE: return "byte"; + case JVM_SIGNATURE_CHAR: return "char"; + case JVM_SIGNATURE_SHORT: return "short"; + case JVM_SIGNATURE_INT: return "int"; + case JVM_SIGNATURE_LONG: return "long"; + case JVM_SIGNATURE_FLOAT: return "float"; + case JVM_SIGNATURE_DOUBLE: return "double"; + } + assert(false, "invalid type array klass"); + return NULL; +} + +static Symbol* primitive_symbol(KlassPtr type_array_klass) { + if (type_array_klass == NULL) { + // void.class + static Symbol* const void_class_name = SymbolTable::probe("void", 4); + assert(void_class_name != NULL, "invariant"); + return void_class_name; + } + const char* const primitive_type_str = primitive_name(type_array_klass); + assert(primitive_type_str != NULL, "invariant"); + Symbol* const primitive_type_sym = SymbolTable::probe(primitive_type_str, (int)strlen(primitive_type_str)); + assert(primitive_type_sym != NULL, "invariant"); + return primitive_type_sym; +} + template static traceid artifact_id(const T* ptr) { assert(ptr != NULL, "invariant"); @@ -152,6 +187,11 @@ return ptr->access_flags().get_flags(); } +// Same as JVM_GetClassModifiers +static u4 get_primitive_flags() { + return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC; +} + static bool is_unsafe_anonymous(const Klass* klass) { assert(klass != NULL, "invariant"); return klass->is_instance_klass() && ((const InstanceKlass*)klass)->is_anonymous(); @@ -260,12 +300,54 @@ do_implied(klass); } +static traceid primitive_id(KlassPtr array_klass) { + if (array_klass == NULL) { + // The first klass id is reserved for the void.class. + return MaxJfrEventId + 101; + } + // Derive the traceid for a primitive mirror from its associated array klass (+1). + return JfrTraceId::get(array_klass) + 1; +} + +static void write_primitive(JfrCheckpointWriter* writer, KlassPtr type_array_klass) { + assert(writer != NULL, "invariant"); + assert(_artifacts != NULL, "invariant"); + writer->write(primitive_id(type_array_klass)); + writer->write(cld_id(get_cld(Universe::boolArrayKlassObj()), false)); + writer->write(mark_symbol(primitive_symbol(type_array_klass), false)); + writer->write(package_id(Universe::boolArrayKlassObj(), false)); + writer->write(get_primitive_flags()); +} + +static int primitives_count = 9; + +// A mirror representing a primitive class (e.g. int.class) has no reified Klass*, +// instead it has an associated TypeArrayKlass* (e.g. int[].class). +// We can use the TypeArrayKlass* as a proxy for deriving the id of the primitive class. +// The exception is the void.class, which has neither a Klass* nor a TypeArrayKlass*. +// It will use a reserved constant. +static void do_primitives() { + // Only write the primitive classes once per chunk. + if (is_initial_typeset_for_chunk()) { + write_primitive(_writer, Universe::boolArrayKlassObj()); + write_primitive(_writer, Universe::byteArrayKlassObj()); + write_primitive(_writer, Universe::charArrayKlassObj()); + write_primitive(_writer, Universe::shortArrayKlassObj()); + write_primitive(_writer, Universe::intArrayKlassObj()); + write_primitive(_writer, Universe::longArrayKlassObj()); + write_primitive(_writer, Universe::singleArrayKlassObj()); + write_primitive(_writer, Universe::doubleArrayKlassObj()); + write_primitive(_writer, NULL); // void.class + } +} + static void do_klasses() { if (_class_unload) { ClassLoaderDataGraph::classes_unloading_do(&do_unloaded_klass); return; } ClassLoaderDataGraph::classes_do(&do_klass); + do_primitives(); } typedef SerializePredicate KlassPredicate; @@ -310,6 +392,11 @@ _subsystem_callback = &callback; do_klasses(); } + if (is_initial_typeset_for_chunk()) { + // Because the set of primitives is written outside the callback, + // their count is not automatically incremented. + kw.add(primitives_count); + } if (is_complete()) { return false; } @@ -887,10 +974,8 @@ _artifacts->tally(sw); } -static bool clear_artifacts = false; - void JfrTypeSet::clear() { - clear_artifacts = true; + _clear_artifacts = true; } typedef Wrapper ClearKlassBits; @@ -904,8 +989,10 @@ assert(_writer != NULL, "invariant"); ClearKlassAndMethods clear(_writer); _artifacts->iterate_klasses(clear); - JfrTypeSet::clear(); + _clear_artifacts = true; ++checkpoint_id; + } else { + _clear_artifacts = false; } return total_count; } @@ -917,9 +1004,8 @@ if (_artifacts == NULL) { _artifacts = new JfrArtifactSet(class_unload); } else { - _artifacts->initialize(class_unload, clear_artifacts); + _artifacts->initialize(class_unload, _clear_artifacts); } - clear_artifacts = false; assert(_artifacts != NULL, "invariant"); assert(!_artifacts->has_klass_entries(), "invariant"); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -52,7 +52,7 @@ } static traceid next_class_id() { - static volatile traceid class_id_counter = MaxJfrEventId + 100; + static volatile traceid class_id_counter = MaxJfrEventId + 101; // + 101 is for the void.class primitive return atomic_inc(&class_id_counter) << TRACE_ID_SHIFT; } @@ -148,6 +148,10 @@ cld->set_trace_id(next_class_loader_data_id()); } +traceid JfrTraceId::assign_primitive_klass_id() { + return next_class_id(); +} + traceid JfrTraceId::assign_thread_id() { return next_thread_id(); } @@ -171,6 +175,10 @@ const traceid event_flags = k->trace_id(); // get a fresh traceid and restore the original event flags k->set_trace_id(next_class_id() | event_flags); + if (k->is_typeArray_klass()) { + // the next id is reserved for the corresponding primitive class + next_class_id(); + } } traceid JfrTraceId::get(jclass jc) { @@ -181,12 +189,31 @@ return get(java_lang_Class::as_Klass(my_oop)); } -traceid JfrTraceId::use(jclass jc) { +// A mirror representing a primitive class (e.g. int.class) has no reified Klass*, +// instead it has an associated TypeArrayKlass* (e.g. int[].class). +// We can use the TypeArrayKlass* as a proxy for deriving the id of the primitive class. +// The exception is the void.class, which has neither a Klass* nor a TypeArrayKlass*. +// It will use a reserved constant. +static traceid load_primitive(const oop mirror) { + assert(java_lang_Class::is_primitive(mirror), "invariant"); + const Klass* const tak = java_lang_Class::array_klass_acquire(mirror); + traceid id; + if (tak == NULL) { + // The first klass id is reserved for the void.class + id = MaxJfrEventId + 101; + } else { + id = JfrTraceId::get(tak) + 1; + } + return id; +} + +traceid JfrTraceId::use(jclass jc, bool raw /* false */) { assert(jc != NULL, "invariant"); assert(((JavaThread*)Thread::current())->thread_state() == _thread_in_vm, "invariant"); - const oop my_oop = JNIHandles::resolve(jc); - assert(my_oop != NULL, "invariant"); - return use(java_lang_Class::as_Klass(my_oop)); + const oop mirror = JNIHandles::resolve(jc); + assert(mirror != NULL, "invariant"); + const Klass* const k = java_lang_Class::as_Klass(mirror); + return k != NULL ? (raw ? get(k) : use(k)) : load_primitive(mirror); } bool JfrTraceId::in_visible_set(const jclass jc) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -83,6 +83,7 @@ static void assign(const ModuleEntry* module); static void assign(const PackageEntry* package); static void assign(const ClassLoaderData* cld); + static traceid assign_primitive_klass_id(); static traceid assign_thread_id(); static traceid get(const Klass* klass); @@ -91,7 +92,7 @@ // tag construct as used, returns pre-tagged traceid static traceid use(const Klass* klass); - static traceid use(jclass jc); + static traceid use(jclass jc, bool raw = false); static traceid use(const Method* method); static traceid use(const Klass* klass, const Method* method); static traceid use(const ModuleEntry* module); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -30,6 +30,7 @@ const julong MAX_ADJUSTED_GLOBAL_BUFFER_SIZE = 1 * M; const julong MIN_ADJUSTED_GLOBAL_BUFFER_SIZE_CUTOFF = 512 * K; const julong MIN_GLOBAL_BUFFER_SIZE = 64 * K; +const julong MAX_GLOBAL_BUFFER_SIZE = 2 * G; // implies at least 2 * MIN_GLOBAL_BUFFER SIZE const julong MIN_BUFFER_COUNT = 2; // MAX global buffer count open ended @@ -37,6 +38,7 @@ // MAX thread local buffer size == size of a single global buffer (runtime determined) // DEFAULT thread local buffer size = 2 * os page size (runtime determined) const julong MIN_THREAD_BUFFER_SIZE = 4 * K; +const julong MAX_THREAD_BUFFER_SIZE = 2 * G; const julong MIN_MEMORY_SIZE = 1 * M; const julong DEFAULT_MEMORY_SIZE = 10 * M; @@ -305,6 +307,11 @@ options->global_buffer_size = div_total_by_units(options->memory_size, options->buffer_count); if (options->thread_buffer_size > options->global_buffer_size) { options->global_buffer_size = options->thread_buffer_size; + if (options->memory_size_configured) { + options->buffer_count = div_total_by_per_unit(options->memory_size, options->global_buffer_size); + } else { + options->memory_size = multiply(options->global_buffer_size, options->buffer_count); + } options->buffer_count = div_total_by_per_unit(options->memory_size, options->global_buffer_size); } assert(options->global_buffer_size >= options->thread_buffer_size, "invariant"); @@ -324,7 +331,8 @@ assert(options->memory_size % os::vm_page_size() == 0, "invariant"); assert(options->global_buffer_size % os::vm_page_size() == 0, "invariant"); assert(options->thread_buffer_size % os::vm_page_size() == 0, "invariant"); - assert(options->buffer_count > 0, "invariant"); + assert(options->buffer_count >= MIN_BUFFER_COUNT, "invariant"); + assert(options->global_buffer_size >= options->thread_buffer_size, "invariant"); } #endif @@ -429,6 +437,10 @@ default: default_size(options); } + if (options->buffer_count < MIN_BUFFER_COUNT || + options->global_buffer_size < options->thread_buffer_size) { + return false; + } DEBUG_ONLY(assert_post_condition(options);) return true; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -32,6 +32,8 @@ extern const julong MIN_GLOBAL_BUFFER_SIZE; extern const julong MIN_MEMORY_SIZE; extern const julong MIN_THREAD_BUFFER_SIZE; +extern const julong MAX_GLOBAL_BUFFER_SIZE; +extern const julong MAX_THREAD_BUFFER_SIZE; struct JfrMemoryOptions { julong memory_size; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -391,34 +391,41 @@ return value; } -template -static void log_lower_than_min_value(Argument& memory_argument, julong min_value) { +static const char higher_than_msg[] = "This value is higher than the maximum size limited "; +static const char lower_than_msg[] = "This value is lower than the minimum size required "; +template +static void log_out_of_range_value(Argument& memory_argument, julong min_value) { + const char* msg = lower ? lower_than_msg : higher_than_msg; if (memory_argument.value()._size != memory_argument.value()._val) { // has multiplier log_error(arguments) ( - "This value is lower than the minimum size required " JULONG_FORMAT "%c", + "%s" JULONG_FORMAT "%c", msg, divide_with_user_unit(memory_argument, min_value), memory_argument.value()._multiplier); return; } log_error(arguments) ( - "This value is lower than the minimum size required " JULONG_FORMAT, + "%s" JULONG_FORMAT, msg, divide_with_user_unit(memory_argument, min_value)); } +static const char default_val_msg[] = "Value default for option "; +static const char specified_val_msg[] = "Value specified for option "; template static void log_set_value(Argument& memory_argument) { if (memory_argument.value()._size != memory_argument.value()._val) { // has multiplier log_error(arguments) ( - "Value specified for option \"%s\" is " JULONG_FORMAT "%c", + "%s\"%s\" is " JULONG_FORMAT "%c", + memory_argument.is_set() ? specified_val_msg: default_val_msg, memory_argument.name(), memory_argument.value()._val, memory_argument.value()._multiplier); return; } log_error(arguments) ( - "Value specified for option \"%s\" is " JULONG_FORMAT, + "%s\"%s\" is " JULONG_FORMAT, + memory_argument.is_set() ? specified_val_msg: default_val_msg, memory_argument.name(), memory_argument.value()._val); } @@ -539,6 +546,10 @@ return false; } } + } else if (options.thread_buffer_size_configured && options.memory_size_configured) { + if (!ensure_first_gteq_second(_dcmd_memorysize, _dcmd_threadbuffersize)) { + return false; + } } return true; } @@ -607,7 +618,7 @@ static bool ensure_gteq(Argument& memory_argument, const jlong value) { if ((jlong)memory_argument.value()._size < value) { log_set_value(memory_argument); - log_lower_than_min_value(memory_argument, value); + log_out_of_range_value(memory_argument, value); return false; } return true; @@ -638,6 +649,30 @@ return true; } +template +static bool ensure_lteq(Argument& memory_argument, const jlong value) { + if ((jlong)memory_argument.value()._size > value) { + log_set_value(memory_argument); + log_out_of_range_value(memory_argument, value); + return false; + } + return true; +} + +static bool ensure_valid_maximum_sizes() { + if (_dcmd_globalbuffersize.is_set()) { + if (!ensure_lteq(_dcmd_globalbuffersize, MAX_GLOBAL_BUFFER_SIZE)) { + return false; + } + } + if (_dcmd_threadbuffersize.is_set()) { + if (!ensure_lteq(_dcmd_threadbuffersize, MAX_THREAD_BUFFER_SIZE)) { + return false; + } + } + return true; +} + /** * Starting with the initial set of memory values from the user, * sanitize, enforce min/max rules and adjust to a set of consistent options. @@ -645,7 +680,7 @@ * Adjusted memory sizes will be page aligned. */ bool JfrOptionSet::adjust_memory_options() { - if (!ensure_valid_minimum_sizes()) { + if (!ensure_valid_minimum_sizes() || !ensure_valid_maximum_sizes()) { return false; } JfrMemoryOptions options; @@ -654,6 +689,24 @@ return false; } if (!JfrMemorySizer::adjust_options(&options)) { + if (options.buffer_count < MIN_BUFFER_COUNT || options.global_buffer_size < options.thread_buffer_size) { + log_set_value(_dcmd_memorysize); + log_set_value(_dcmd_globalbuffersize); + log_error(arguments) ("%s \"%s\" is " JLONG_FORMAT, + _dcmd_numglobalbuffers.is_set() ? specified_val_msg: default_val_msg, + _dcmd_numglobalbuffers.name(), _dcmd_numglobalbuffers.value()); + log_set_value(_dcmd_threadbuffersize); + if (options.buffer_count < MIN_BUFFER_COUNT) { + log_error(arguments) ("numglobalbuffers " JULONG_FORMAT " is less than minimal value " JULONG_FORMAT, + options.buffer_count, MIN_BUFFER_COUNT); + log_error(arguments) ("Decrease globalbuffersize/threadbuffersize or increase memorysize"); + } else { + log_error(arguments) ("globalbuffersize " JULONG_FORMAT " is less than threadbuffersize" JULONG_FORMAT, + options.global_buffer_size, options.thread_buffer_size); + log_error(arguments) ("Decrease globalbuffersize or increase memorysize or adjust global/threadbuffersize"); + } + return false; + } if (!check_for_ambiguity(_dcmd_memorysize, _dcmd_globalbuffersize, _dcmd_numglobalbuffers)) { return false; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp openjdk-11-11.0.13+8/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -39,6 +39,7 @@ static size_t trace_id_size() { return sizeof(traceid); } #define INIT_ID(data) JfrTraceId::assign(data) +#define ASSIGN_PRIMITIVE_CLASS_ID(data) JfrTraceId::assign_primitive_klass_id() #define REMOVE_ID(k) JfrTraceId::remove(k); #define RESTORE_ID(k) JfrTraceId::restore(k); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -367,6 +367,10 @@ THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Interface %s should be handled in Java code", holder->external_name())); } + if (method->can_be_statically_bound()) { + THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Effectively static method %s.%s should be handled in Java code", method->method_holder()->external_name(), method->external_name())); + } + methodHandle ucm; { MutexLocker locker(Compile_lock); @@ -1036,7 +1040,7 @@ jobjectArray methods = initial_methods; int frame_number = 0; - vframe* vf = vframe::new_vframe(fst.current(), fst.register_map(), thread); + vframe* vf = vframe::new_vframe(fst, thread); while (true) { // look for the given method @@ -1145,7 +1149,7 @@ if (fst.current()->sp() != stack_pointer) { THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "stack frame not found after deopt") } - vf = vframe::new_vframe(fst.current(), fst.register_map(), thread); + vf = vframe::new_vframe(fst, thread); if (!vf->is_compiled_frame()) { THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "compiled stack frame expected") } @@ -1172,7 +1176,7 @@ break; } fst.next(); - vf = vframe::new_vframe(fst.current(), fst.register_map(), thread); + vf = vframe::new_vframe(fst, thread); frame_number = 0; } // end of frame loop diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jvmci/jvmciRuntime.cpp openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciRuntime.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jvmci/jvmciRuntime.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciRuntime.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -409,6 +409,114 @@ SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message); JRT_END +class ArgumentPusher : public SignatureIterator { + protected: + JavaCallArguments* _jca; + jlong _argument; + bool _pushed; + + jlong next_arg() { + guarantee(!_pushed, "one argument"); + _pushed = true; + return _argument; + } + + float next_float() { + guarantee(!_pushed, "one argument"); + _pushed = true; + jvalue v; + v.i = (jint) _argument; + return v.f; + } + + double next_double() { + guarantee(!_pushed, "one argument"); + _pushed = true; + jvalue v; + v.j = _argument; + return v.d; + } + + Handle next_object() { + guarantee(!_pushed, "one argument"); + _pushed = true; + return Handle(Thread::current(), (oop) (address) _argument); + } + + public: + ArgumentPusher(Symbol* signature, JavaCallArguments* jca, jlong argument) : SignatureIterator(signature) { + this->_return_type = T_ILLEGAL; + _jca = jca; + _argument = argument; + _pushed = false; + iterate(); + } + + inline void do_object() { _jca->push_oop(next_object()); } + + inline void do_bool() { if (!is_return_type()) _jca->push_int((jboolean) next_arg()); } + inline void do_char() { if (!is_return_type()) _jca->push_int((jchar) next_arg()); } + inline void do_short() { if (!is_return_type()) _jca->push_int((jint) next_arg()); } + inline void do_byte() { if (!is_return_type()) _jca->push_int((jbyte) next_arg()); } + inline void do_int() { if (!is_return_type()) _jca->push_int((jint) next_arg()); } + + inline void do_long() { if (!is_return_type()) _jca->push_long((jlong) next_arg()); } + inline void do_float() { if (!is_return_type()) _jca->push_float(next_float()); } + inline void do_double() { if (!is_return_type()) _jca->push_double(next_double()); } + + inline void do_object(int begin, int end) { if (!is_return_type()) do_object(); } + inline void do_array(int begin, int end) { if (!is_return_type()) do_object(); } + + inline void do_void() { } +}; + + +JRT_ENTRY(jlong, JVMCIRuntime::invoke_static_method_one_arg(JavaThread* thread, Method* method, jlong argument)) + ResourceMark rm; + HandleMark hm; + + methodHandle mh(thread, method); + if (mh->size_of_parameters() > 1 && !mh->is_static()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Invoked method must be static and take at most one argument"); + } + + Symbol* signature = mh->signature(); + JavaCallArguments jca(mh->size_of_parameters()); + ArgumentPusher jap(signature, &jca, argument); + BasicType return_type = jap.get_ret_type(); + JavaValue result(return_type); + JavaCalls::call(&result, mh, &jca, CHECK_0); + + if (return_type == T_VOID) { + return 0; + } else if (return_type == T_OBJECT || return_type == T_ARRAY) { + thread->set_vm_result((oop) result.get_jobject()); + return 0; + } else { + jvalue *value = (jvalue *) result.get_value_addr(); + // Narrow the value down if required (Important on big endian machines) + switch (return_type) { + case T_BOOLEAN: + return (jboolean) value->i; + case T_BYTE: + return (jbyte) value->i; + case T_CHAR: + return (jchar) value->i; + case T_SHORT: + return (jshort) value->i; + case T_INT: + case T_FLOAT: + return value->i; + case T_LONG: + case T_DOUBLE: + return value->j; + default: + fatal("Unexpected type %s", type2name(return_type)); + return 0; + } + } +JRT_END + JRT_LEAF(void, JVMCIRuntime::log_object(JavaThread* thread, oopDesc* obj, bool as_string, bool newline)) ttyLocker ttyl; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jvmci/jvmciRuntime.hpp openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciRuntime.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/jvmci/jvmciRuntime.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jvmci/jvmciRuntime.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -160,6 +160,11 @@ // Forces initialization of the JVMCI runtime. static void force_initialization(TRAPS); + // A helper to allow invocation of an arbitrary Java method. For simplicity the method is + // restricted to a static method that takes at most one argument. For calling convention + // simplicty all types are passed by being converted into a jlong + static jlong invoke_static_method_one_arg(JavaThread* thread, Method* method, jlong argument); + // Test only function static int test_deoptimize_call_int(JavaThread* thread, int value); }; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/jvmci/vmStructs_jvmci.cpp openjdk-11-11.0.13+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/jvmci/vmStructs_jvmci.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/jvmci/vmStructs_jvmci.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -179,6 +179,9 @@ nonstatic_field(JavaThread, _pending_failed_speculation, long) \ nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \ nonstatic_field(JavaThread, _jvmci_counters, jlong*) \ + nonstatic_field(JavaThread, _jvmci_reserved0, intptr_t*) \ + nonstatic_field(JavaThread, _jvmci_reserved1, intptr_t*) \ + nonstatic_field(JavaThread, _jvmci_reserved_oop0, oop) \ nonstatic_field(JavaThread, _reserved_stack_activation, address) \ \ static_field(java_lang_Class, _klass_offset, int) \ @@ -632,6 +635,8 @@ declare_function(JVMCIRuntime::dynamic_new_array) \ declare_function(JVMCIRuntime::dynamic_new_instance) \ \ + declare_function(JVMCIRuntime::invoke_static_method_one_arg) \ + \ declare_function(JVMCIRuntime::thread_is_interrupted) \ declare_function(JVMCIRuntime::vm_message) \ declare_function(JVMCIRuntime::identity_hash_code) \ diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/memory/iterator.hpp openjdk-11-11.0.13+8/src/hotspot/share/memory/iterator.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/memory/iterator.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/memory/iterator.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -317,6 +317,9 @@ // Read/write the 32-bit unsigned integer pointed to by p. virtual void do_u4(u4* p) = 0; + // Read/write the bool pointed to by p. + virtual void do_bool(bool* p) = 0; + // Read/write the region specified. virtual void do_region(u_char* start, size_t size) = 0; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/memory/metaspaceShared.cpp openjdk-11-11.0.13+8/src/hotspot/share/memory/metaspaceShared.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/memory/metaspaceShared.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/memory/metaspaceShared.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -563,6 +563,7 @@ } } +#if INCLUDE_JVMTI static void relocate_cached_class_file() { for (int i = 0; i < _global_klass_objects->length(); i++) { Klass* k = _global_klass_objects->at(i); @@ -579,6 +580,7 @@ } } } +#endif // INCLUDE_JVMTI NOT_PRODUCT( static void assert_not_anonymous_class(InstanceKlass* k) { @@ -842,6 +844,11 @@ do_ptr(&ptr); } + void do_bool(bool *p) { + void* ptr = (void*)(uintx(*p)); + do_ptr(&ptr); + } + void do_tag(int tag) { _dump_region->append_intptr_t((intptr_t)tag); } @@ -1435,7 +1442,7 @@ _md_region.pack(&_od_region); // Relocate the archived class file data into the od region - relocate_cached_class_file(); + JVMTI_ONLY(relocate_cached_class_file();) _od_region.pack(); // The 5 core spaces are allocated consecutively mc->rw->ro->md->od, so there total size @@ -2004,6 +2011,11 @@ *p = (u4)(uintx(obj)); } + void do_bool(bool* p) { + intptr_t obj = nextPtr(); + *p = (bool)(uintx(obj)); + } + void do_tag(int tag) { int old_tag; old_tag = (int)(intptr_t)nextPtr(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/memory/universe.cpp openjdk-11-11.0.13+8/src/hotspot/share/memory/universe.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/memory/universe.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/memory/universe.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -604,12 +604,12 @@ // preallocated errors with backtrace have been consumed. Also need to avoid // a potential loop which could happen if an out of memory occurs when attempting // to allocate the backtrace. - return ((!oopDesc::equals(throwable(), Universe::_out_of_memory_error_java_heap)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_metaspace)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_class_metaspace)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_array_size)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_gc_overhead_limit)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_realloc_objects))); + return ((throwable() != Universe::_out_of_memory_error_java_heap) && + (throwable() != Universe::_out_of_memory_error_metaspace) && + (throwable() != Universe::_out_of_memory_error_class_metaspace) && + (throwable() != Universe::_out_of_memory_error_array_size) && + (throwable() != Universe::_out_of_memory_error_gc_overhead_limit) && + (throwable() != Universe::_out_of_memory_error_realloc_objects)); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/access.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/access.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/access.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/access.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 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 - * 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. - * - */ - -#include "precompiled.hpp" -#include "oops/access.inline.hpp" -#include "oops/accessDecorators.hpp" - -// This macro allows instantiating selected accesses to be usable from the -// access.hpp file, to break dependencies to the access.inline.hpp file. -#define INSTANTIATE_HPP_ACCESS(decorators, T, barrier_type) \ - template struct RuntimeDispatch::value, T, barrier_type> - -namespace AccessInternal { - INSTANTIATE_HPP_ACCESS(INTERNAL_EMPTY, oop, BARRIER_EQUALS); -} diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/access.hpp openjdk-11-11.0.13+8/src/hotspot/share/oops/access.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/access.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/access.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -58,7 +58,6 @@ // * arraycopy: Copy data from one heap array to another heap array. The ArrayAccess class has convenience functions for this. // * clone: Clone the contents of an object to a newly allocated object. // * resolve: Resolve a stable to-space invariant oop that is guaranteed not to relocate its payload until a subsequent thread transition. -// * equals: Object equality, e.g. when different copies of the same objects are in use (from-space vs. to-space) // // == IMPLEMENTATION == // Each access goes through the following steps in a template pipeline. @@ -275,11 +274,6 @@ verify_decorators(); return AccessInternal::resolve(obj); } - - static bool equals(oop o1, oop o2) { - verify_decorators(); - return AccessInternal::equals(o1, o2); - } }; // Helper for performing raw accesses (knows only of memory ordering diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/access.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/oops/access.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/access.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/access.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -206,13 +206,6 @@ } }; - template - struct PostRuntimeDispatch: public AllStatic { - static bool access_barrier(oop o1, oop o2) { - return GCBarrierType::equals(o1, o2); - } - }; - // Resolving accessors with barriers from the barrier set happens in two steps. // 1. Expand paths with runtime-decorators, e.g. is UseCompressedOops on or off. // 2. Expand paths for each BarrierSet available in the system. @@ -367,13 +360,6 @@ _resolve_func = function; return function(obj); } - - template - bool RuntimeDispatch::equals_init(oop o1, oop o2) { - func_t function = BarrierResolver::resolve_barrier(); - _equals_func = function; - return function(o1, o2); - } } #endif // SHARE_OOPS_ACCESS_INLINE_HPP diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/accessBackend.hpp openjdk-11-11.0.13+8/src/hotspot/share/oops/accessBackend.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/accessBackend.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/accessBackend.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -63,8 +63,7 @@ BARRIER_ATOMIC_XCHG_AT, BARRIER_ARRAYCOPY, BARRIER_CLONE, - BARRIER_RESOLVE, - BARRIER_EQUALS + BARRIER_RESOLVE }; template @@ -115,7 +114,6 @@ size_t length); typedef void (*clone_func_t)(oop src, oop dst, size_t size); typedef oop (*resolve_func_t)(oop obj); - typedef bool (*equals_func_t)(oop o1, oop o2); }; template @@ -143,7 +141,6 @@ ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_ARRAYCOPY, arraycopy_func_t); ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_CLONE, clone_func_t); ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_RESOLVE, resolve_func_t); - ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_EQUALS, equals_func_t); #undef ACCESS_GENERATE_ACCESS_FUNCTION template @@ -409,8 +406,6 @@ static void clone(oop src, oop dst, size_t size); static oop resolve(oop obj) { return obj; } - - static bool equals(oop o1, oop o2) { return o1 == o2; } }; // Below is the implementation of the first 4 steps of the template pipeline: @@ -604,18 +599,6 @@ } }; - template - struct RuntimeDispatch: AllStatic { - typedef typename AccessFunction::type func_t; - static func_t _equals_func; - - static bool equals_init(oop o1, oop o2); - - static inline bool equals(oop o1, oop o2) { - return _equals_func(o1, o2); - } - }; - // Initialize the function pointers to point to the resolving function. template typename AccessFunction::type @@ -661,10 +644,6 @@ typename AccessFunction::type RuntimeDispatch::_resolve_func = &resolve_init; - template - typename AccessFunction::type - RuntimeDispatch::_equals_func = &equals_init; - // Step 3: Pre-runtime dispatching. // The PreRuntimeDispatch class is responsible for filtering the barrier strength // decorators. That is, for AS_RAW, it hardwires the accesses without a runtime @@ -995,21 +974,6 @@ resolve(oop obj) { return RuntimeDispatch::resolve(obj); } - - template - inline static typename EnableIf< - HasDecorator::value, bool>::type - equals(oop o1, oop o2) { - typedef RawAccessBarrier Raw; - return Raw::equals(o1, o2); - } - - template - inline static typename EnableIf< - !HasDecorator::value, bool>::type - equals(oop o1, oop o2) { - return RuntimeDispatch::equals(o1, o2); - } }; // Step 2: Reduce types. @@ -1308,12 +1272,6 @@ return PreRuntimeDispatch::resolve(obj); } - template - inline bool equals(oop o1, oop o2) { - const DecoratorSet expanded_decorators = DecoratorFixup::value; - return PreRuntimeDispatch::equals(o1, o2); - } - // Infer the type that should be returned from an Access::oop_load. template class OopLoadProxy: public StackObj { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/constantPool.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/constantPool.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/constantPool.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/constantPool.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -857,7 +857,7 @@ if (cache_index >= 0) { result_oop = this_cp->resolved_references()->obj_at(cache_index); if (result_oop != NULL) { - if (oopDesc::equals(result_oop, Universe::the_null_sentinel())) { + if (result_oop == Universe::the_null_sentinel()) { DEBUG_ONLY(int temp_index = (index >= 0 ? index : this_cp->object_to_cp_index(cache_index))); assert(this_cp->tag_at(temp_index).is_dynamic_constant(), "only condy uses the null sentinel"); result_oop = NULL; @@ -1093,12 +1093,12 @@ } else { // Return the winning thread's result. This can be different than // the result here for MethodHandles. - if (oopDesc::equals(old_result, Universe::the_null_sentinel())) + if (old_result == Universe::the_null_sentinel()) old_result = NULL; return old_result; } } else { - assert(!oopDesc::equals(result_oop, Universe::the_null_sentinel()), ""); + assert(result_oop != Universe::the_null_sentinel(), ""); return result_oop; } } @@ -1264,7 +1264,7 @@ oop ConstantPool::string_at_impl(const constantPoolHandle& this_cp, int which, int obj_index, TRAPS) { // If the string has already been interned, this entry will be non-null oop str = this_cp->resolved_references()->obj_at(obj_index); - assert(!oopDesc::equals(str, Universe::the_null_sentinel()), ""); + assert(str != Universe::the_null_sentinel(), ""); if (str != NULL) return str; Symbol* sym = this_cp->unresolved_string_at(which); str = StringTable::intern(sym, CHECK_(NULL)); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -39,7 +39,7 @@ InstanceKlass::oop_oop_iterate(obj, closure); if (Devirtualizer::do_metadata(closure)) { - ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); + ClassLoaderData* cld = java_lang_ClassLoader::loader_data_acquire(obj); // cld can be null if we have a non-registered class loader. if (cld != NULL) { Devirtualizer::do_cld(closure, cld); @@ -61,7 +61,7 @@ if (Devirtualizer::do_metadata(closure)) { if (mr.contains(obj)) { - ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); + ClassLoaderData* cld = java_lang_ClassLoader::loader_data_acquire(obj); // cld can be null if we have a non-registered class loader. if (cld != NULL) { Devirtualizer::do_cld(closure, cld); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/instanceKlass.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/instanceKlass.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/instanceKlass.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/instanceKlass.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2654,7 +2654,7 @@ // and package entries. Both must be the same. This rule // applies even to classes that are defined in the unnamed // package, they still must have the same class loader. - if (oopDesc::equals(classloader1, classloader2) && (classpkg1 == classpkg2)) { + if ((classloader1 == classloader2) && (classpkg1 == classpkg2)) { return true; } @@ -2665,7 +2665,7 @@ // and classname information is enough to determine a class's package bool InstanceKlass::is_same_class_package(oop other_class_loader, const Symbol* other_class_name) const { - if (!oopDesc::equals(class_loader(), other_class_loader)) { + if (class_loader() != other_class_loader) { return false; } if (name()->fast_compare(other_class_name) == 0) { @@ -2835,6 +2835,18 @@ constantPoolHandle i_cp(THREAD, constants()); if (ooff != 0) { Klass* ok = i_cp->klass_at(ooff, CHECK_NULL); + if (!ok->is_instance_klass()) { + // If the outer class is not an instance klass then it cannot have + // declared any inner classes. + ResourceMark rm(THREAD); + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_IncompatibleClassChangeError(), + "%s and %s disagree on InnerClasses attribute", + ok->external_name(), + external_name()); + return NULL; + } outer_klass = InstanceKlass::cast(ok); *inner_is_member = true; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/klassVtable.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/klassVtable.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/klassVtable.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/klassVtable.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -83,6 +83,7 @@ methodHandle mh(THREAD, methods->at(i)); if (needs_new_vtable_entry(mh, super, classloader, classname, class_flags, major_version, THREAD)) { + assert(!methods->at(i)->is_private(), "private methods should not need a vtable entry"); vtable_length += vtableEntry::size(); // we need a new entry } } @@ -282,7 +283,7 @@ // If none found, return a null superk, else return the superk of the method this does override // For public and protected methods: if they override a superclass, they will // also be overridden themselves appropriately. -// Private methods do not override and are not overridden. +// Private methods do not override, and are not overridden and are not in the vtable. // Package Private methods are trickier: // e.g. P1.A, pub m // P2.B extends A, package private m @@ -392,8 +393,9 @@ target_method()->set_vtable_index(Method::nonvirtual_vtable_index); } - // Static and methods are never in - if (target_method()->is_static() || target_method()->name() == vmSymbols::object_initializer_name()) { + // Private, static and methods are never in + if (target_method()->is_private() || target_method()->is_static() || + (target_method()->name()->fast_compare(vmSymbols::object_initializer_name()) == 0)) { return false; } @@ -413,10 +415,7 @@ // valid itable index, if so, don't change it. // Overpass methods in an interface will be assigned an itable index later // by an inheriting class. - // Private interface methods have no itable index and are always invoked nonvirtually, - // so they retain their nonvirtual_vtable_index value, and therefore can_be_statically_bound() - // will return true. - if ((!is_default || !target_method()->has_itable_index()) && !target_method()->is_private()) { + if ((!is_default || !target_method()->has_itable_index())) { target_method()->set_vtable_index(Method::pending_itable_index); } } @@ -427,14 +426,6 @@ return allocate_new; } - // private methods in classes always have a new entry in the vtable - // specification interpretation since classic has - // private methods not overriding - // JDK8 adds private methods in interfaces which require invokespecial - if (target_method()->is_private()) { - return allocate_new; - } - // search through the vtable and update overridden entries // Since check_signature_loaders acquires SystemDictionary_lock // which can block for gc, once we are in this loop, use handles @@ -502,7 +493,7 @@ // to link to the first super, and we get all the others. Handle super_loader(THREAD, super_klass->class_loader()); - if (!oopDesc::equals(target_loader(), super_loader())) { + if (target_loader() != super_loader()) { ResourceMark rm(THREAD); Symbol* failed_type_symbol = SystemDictionary::check_signature_loaders(signature, target_loader, @@ -557,6 +548,7 @@ } void klassVtable::put_method_at(Method* m, int index) { + assert(!m->is_private(), "private methods should not be in vtable"); if (is_preinitialized_vtable()) { // At runtime initialize_vtable is rerun as part of link_class_impl() // for shared class loaded by the non-boot loader to obtain the loader @@ -608,9 +600,11 @@ // a final method never needs a new entry; final methods can be statically // resolved and they have to be present in the vtable only if they override // a super's method, in which case they re-use its entry + (target_method()->is_private()) || + // private methods don't need to be in vtable (target_method()->is_static()) || // static methods don't need to be in vtable - (target_method()->name() == vmSymbols::object_initializer_name()) + (target_method()->name()->fast_compare(vmSymbols::object_initializer_name()) == 0) // is never called dynamically-bound ) { return false; @@ -621,7 +615,7 @@ if (target_method()->method_holder() != NULL && target_method()->method_holder()->is_interface() && !target_method()->is_abstract()) { - assert(target_method()->is_default_method() || target_method()->is_private(), + assert(target_method()->is_default_method(), "unexpected interface method type"); return false; } @@ -631,12 +625,6 @@ return true; } - // private methods in classes always have a new entry in the vtable. - // Specification interpretation since classic has private methods not overriding. - if (target_method()->is_private()) { - return true; - } - // Package private methods always need a new entry to root their own // overriding. This allows transitive overriding to work. if (target_method()->is_package_private()) { @@ -663,8 +651,8 @@ // make sure you use that class for is_override InstanceKlass* superk = super_method->method_holder(); // we want only instance method matches - // pretend private methods are not in the super vtable - // since we do override around them: e.g. a.m pub/b.m private/c.m pub, + // ignore private methods found via lookup_method since they do not participate in overriding, + // and since we do override around them: e.g. a.m pub/b.m private/c.m pub, // ignore private, c.m pub does override a.m pub // For classes that were not javac'd together, we also do transitive overriding around // methods that have less accessibility @@ -1253,7 +1241,7 @@ // if checkconstraints requested if (checkconstraints) { Handle method_holder_loader (THREAD, target->method_holder()->class_loader()); - if (!oopDesc::equals(method_holder_loader(), interface_loader())) { + if (method_holder_loader() != interface_loader()) { ResourceMark rm(THREAD); Symbol* failed_type_symbol = SystemDictionary::check_signature_loaders(m->signature(), diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/objArrayKlass.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/objArrayKlass.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/objArrayKlass.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/objArrayKlass.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -220,7 +220,7 @@ // Either oop or narrowOop depending on UseCompressedOops. void ObjArrayKlass::do_copy(arrayOop s, size_t src_offset, arrayOop d, size_t dst_offset, int length, TRAPS) { - if (oopDesc::equals(s, d)) { + if (s == d) { // since source and destination are equal we do not need conversion checks. assert(length > 0, "sanity check"); ArrayAccess<>::oop_arraycopy(s, src_offset, d, dst_offset, length); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/oop.hpp openjdk-11-11.0.13+8/src/hotspot/share/oops/oop.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/oop.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/oop.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -152,8 +152,6 @@ } } - inline static bool equals(oop o1, oop o2) { return Access<>::equals(o1, o2); } - // Access to fields in a instanceOop through these methods. template oop obj_field_access(int offset) const; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/oopsHierarchy.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/oopsHierarchy.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/oopsHierarchy.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/oopsHierarchy.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -37,8 +37,7 @@ // This gets expensive, which is why checking unhandled oops is on a switch. Thread* t = Thread::current_or_null(); if (t != NULL && t->is_Java_thread()) { - frame fr = os::current_frame(); - t->unhandled_oops()->register_unhandled_oop(this, fr.pc()); + t->unhandled_oops()->register_unhandled_oop(this); } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/oops/typeArrayKlass.cpp openjdk-11-11.0.13+8/src/hotspot/share/oops/typeArrayKlass.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/oops/typeArrayKlass.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/oops/typeArrayKlass.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -70,6 +70,7 @@ // including classes in the bootstrap (NULL) class loader. // GC walks these as strong roots. null_loader_data->add_class(ak); + JFR_ONLY(ASSIGN_PRIMITIVE_CLASS_ID(ak);) // Call complete_create_array_klass after all instance variables have been initialized. complete_create_array_klass(ak, ak->super(), ModuleEntryTable::javabase_moduleEntry(), CHECK_NULL); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/addnode.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/addnode.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/addnode.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/addnode.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -29,6 +29,7 @@ #include "opto/cfgnode.hpp" #include "opto/connode.hpp" #include "opto/machnode.hpp" +#include "opto/movenode.hpp" #include "opto/mulnode.hpp" #include "opto/phaseX.hpp" #include "opto/subnode.hpp" @@ -832,6 +833,95 @@ return TypeLong::make( r0->get_con() ^ r1->get_con() ); } + +Node* MaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned, const Type* t, PhaseGVN& gvn) { + bool is_int = gvn.type(a)->isa_int(); + assert(is_int || gvn.type(a)->isa_long(), "int or long inputs"); + assert(is_int == (gvn.type(b)->isa_int() != NULL), "inconsistent inputs"); + if (!is_unsigned) { + if (is_max) { + if (is_int) { + Node* res = gvn.transform(new MaxINode(a, b)); + assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match"); + return res; + } else { + Node* cmp = gvn.transform(new CmpLNode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); + } + } else { + if (is_int) { + Node* res = gvn.transform(new MinINode(a, b)); + assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match"); + return res; + } else { + Node* cmp = gvn.transform(new CmpLNode(b, a)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); + } + } + } else { + if (is_max) { + if (is_int) { + Node* cmp = gvn.transform(new CmpUNode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveINode(bol, a, b, t->is_int())); + } else { + Node* cmp = gvn.transform(new CmpULNode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); + } + } else { + if (is_int) { + Node* cmp = gvn.transform(new CmpUNode(b, a)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveINode(bol, a, b, t->is_int())); + } else { + Node* cmp = gvn.transform(new CmpULNode(b, a)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); + } + } + } +} + +Node* MaxNode::build_min_max_diff_with_zero(Node* a, Node* b, bool is_max, const Type* t, PhaseGVN& gvn) { + bool is_int = gvn.type(a)->isa_int(); + assert(is_int || gvn.type(a)->isa_long(), "int or long inputs"); + assert(is_int == (gvn.type(b)->isa_int() != NULL), "inconsistent inputs"); + Node* zero = NULL; + if (is_int) { + zero = gvn.intcon(0); + } else { + zero = gvn.longcon(0); + } + if (is_max) { + if (is_int) { + Node* cmp = gvn.transform(new CmpINode(a, b)); + Node* sub = gvn.transform(new SubINode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveINode(bol, sub, zero, t->is_int())); + } else { + Node* cmp = gvn.transform(new CmpLNode(a, b)); + Node* sub = gvn.transform(new SubLNode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveLNode(bol, sub, zero, t->is_long())); + } + } else { + if (is_int) { + Node* cmp = gvn.transform(new CmpINode(b, a)); + Node* sub = gvn.transform(new SubINode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveINode(bol, sub, zero, t->is_int())); + } else { + Node* cmp = gvn.transform(new CmpLNode(b, a)); + Node* sub = gvn.transform(new SubLNode(a, b)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + return gvn.transform(new CMoveLNode(bol, sub, zero, t->is_long())); + } + } +} + //============================================================================= //------------------------------add_ring--------------------------------------- // Supplied function returns the sum of the inputs. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/addnode.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/addnode.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/addnode.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/addnode.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -217,9 +217,39 @@ // all the behavior of addition on a ring. Only new thing is that we allow // 2 equal inputs to be equal. class MaxNode : public AddNode { +private: + static Node* build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned, const Type* t, PhaseGVN& gvn); + static Node* build_min_max_diff_with_zero(Node* a, Node* b, bool is_max, const Type* t, PhaseGVN& gvn); + public: MaxNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {} virtual int Opcode() const = 0; + + static Node* unsigned_max(Node* a, Node* b, const Type* t, PhaseGVN& gvn) { + return build_min_max(a, b, true, true, t, gvn); + } + + static Node* unsigned_min(Node* a, Node* b, const Type* t, PhaseGVN& gvn) { + return build_min_max(a, b, false, true, t, gvn); + } + + static Node* signed_max(Node* a, Node* b, const Type* t, PhaseGVN& gvn) { + return build_min_max(a, b, true, false, t, gvn); + } + + static Node* signed_min(Node* a, Node* b, const Type* t, PhaseGVN& gvn) { + return build_min_max(a, b, false, false, t, gvn); + } + + // max(a-b, 0) + static Node* max_diff_with_zero(Node* a, Node* b, const Type* t, PhaseGVN& gvn) { + return build_min_max_diff_with_zero(a, b, true, t, gvn); + } + + // min(a-b, 0) + static Node* min_diff_with_zero(Node* a, Node* b, const Type* t, PhaseGVN& gvn) { + return build_min_max_diff_with_zero(a, b, false, t, gvn); + } }; //------------------------------MaxINode--------------------------------------- diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/block.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/block.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/block.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/block.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1218,12 +1218,18 @@ for (uint k = 0; k < n->req(); k++) { Node *def = n->in(k); if (def && def != n) { - assert(get_block_for_node(def) || def->is_Con(), "must have block; constants for debug info ok"); - // Verify that instructions in the block is in correct order. + Block* def_block = get_block_for_node(def); + assert(def_block || def->is_Con(), "must have block; constants for debug info ok"); + // Verify that all definitions dominate their uses (except for virtual + // instructions merging multiple definitions). + assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || + def_block->dominates(block), + "uses must be dominated by definitions"); + // Verify that instructions in the block are in correct order. // Uses must follow their definition if they are at the same block. // Mostly done to check that MachSpillCopy nodes are placed correctly // when CreateEx node is moved in build_ifg_physical(). - if (get_block_for_node(def) == block && !(block->head()->is_Loop() && n->is_Phi()) && + if (def_block == block && !(block->head()->is_Loop() && n->is_Phi()) && // See (+++) comment in reg_split.cpp !(n->jvms() != NULL && n->jvms()->is_monitor_use(k))) { bool is_loop = false; @@ -1239,6 +1245,14 @@ } } } + if (n->is_Proj()) { + assert(j >= 1, "a projection cannot be the first instruction in a block"); + Node* pred = block->get_node(j - 1); + Node* parent = n->in(0); + assert(parent != NULL, "projections must have a parent"); + assert(pred == parent || (pred->is_Proj() && pred->in(0) == parent), + "projections must follow their parents or other sibling projections"); + } } j = block->end_idx(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/block.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/block.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/block.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/block.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -507,6 +507,8 @@ bool _trace_opto_pipelining; // tracing flag #endif + bool unrelated_load_in_store_null_block(Node* store, Node* load); + public: PhaseCFG(Arena* arena, RootNode* root, Matcher& matcher); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/c2compiler.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/c2compiler.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/c2compiler.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/c2compiler.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -42,6 +42,9 @@ const char* C2Compiler::retry_no_escape_analysis() { return "retry without escape analysis"; } +const char* C2Compiler::retry_no_locks_coarsening() { + return "retry without locks coarsening"; +} const char* C2Compiler::retry_class_loading_during_parsing() { return "retry class loading during parsing"; } @@ -104,10 +107,11 @@ bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables() && !env->jvmti_can_get_owned_monitor_info(); bool eliminate_boxing = EliminateAutoBox; + bool do_locks_coarsening = EliminateLocks; while (!env->failing()) { // Attempt to compile while subsuming loads into machine instructions. - Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing, directive); + Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing, do_locks_coarsening, directive); // Check result and retry if appropriate. if (C.failure_reason() != NULL) { @@ -127,6 +131,12 @@ env->report_failure(C.failure_reason()); continue; // retry } + if (C.failure_reason_is(retry_no_locks_coarsening())) { + assert(do_locks_coarsening, "must make progress"); + do_locks_coarsening = false; + env->report_failure(C.failure_reason()); + continue; // retry + } if (C.has_boxed_value()) { // Recompile without boxing elimination regardless failure reason. assert(eliminate_boxing, "must make progress"); @@ -148,6 +158,10 @@ do_escape_analysis = false; continue; // retry } + if (do_locks_coarsening) { + do_locks_coarsening = false; + continue; // retry + } } // print inlining for last compilation only diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/c2compiler.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/c2compiler.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/c2compiler.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/c2compiler.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -48,6 +48,7 @@ // sentinel value used to trigger backtracking in compile_method(). static const char* retry_no_subsuming_loads(); static const char* retry_no_escape_analysis(); + static const char* retry_no_locks_coarsening(); static const char* retry_class_loading_during_parsing(); // Print compilation timers and statistics diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/callnode.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/callnode.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/callnode.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/callnode.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1476,7 +1476,7 @@ InitializeNode* init = initialization(); assert(init != NULL, "initialization not found"); length = new CastIINode(length, narrow_length_type); - length->set_req(0, init->proj_out_or_null(0)); + length->set_req(TypeFunc::Control, init->proj_out_or_null(TypeFunc::Control)); } } @@ -1772,6 +1772,12 @@ } +const char* AbstractLockNode::_kind_names[] = {"Regular", "NonEscObj", "Coarsened", "Nested"}; + +const char * AbstractLockNode::kind_as_string() const { + return _kind_names[_kind]; +} + #ifndef PRODUCT // // Create a counter which counts the number of times this lock is acquired @@ -1789,8 +1795,6 @@ } } -const char* AbstractLockNode::_kind_names[] = {"Regular", "NonEscObj", "Coarsened", "Nested"}; - void AbstractLockNode::dump_spec(outputStream* st) const { st->print("%s ", _kind_names[_kind]); CallNode::dump_spec(st); @@ -1842,6 +1846,9 @@ return result; } + if (!phase->C->do_locks_coarsening()) { + return result; // Compiling without locks coarsening + } // // Try lock coarsening // @@ -1879,6 +1886,9 @@ if (PrintEliminateLocks) { int locks = 0; int unlocks = 0; + if (Verbose) { + tty->print_cr("=== Locks coarsening ==="); + } for (int i = 0; i < lock_ops.length(); i++) { AbstractLockNode* lock = lock_ops.at(i); if (lock->Opcode() == Op_Lock) @@ -1886,10 +1896,11 @@ else unlocks++; if (Verbose) { - lock->dump(1); + tty->print(" %d: ", i); + lock->dump(); } } - tty->print_cr("***Eliminated %d unlocks and %d locks", unlocks, locks); + tty->print_cr("=== Coarsened %d unlocks and %d locks", unlocks, locks); } #endif @@ -1904,6 +1915,8 @@ #endif lock->set_coarsened(); } + // Record this coarsened group. + phase->C->add_coarsened_locks(lock_ops); } else if (ctrl->is_Region() && iter->_worklist.member(ctrl)) { // We weren't able to find any opportunities but the region this @@ -1937,15 +1950,34 @@ // Ignore complex cases: merged locks or multiple locks. Node* obj = obj_node(); LockNode* unique_lock = NULL; - if (!box->is_simple_lock_region(&unique_lock, obj)) { + Node* bad_lock = NULL; + if (!box->is_simple_lock_region(&unique_lock, obj, &bad_lock)) { #ifdef ASSERT - this->log_lock_optimization(c, "eliminate_lock_INLR_2a"); + this->log_lock_optimization(c, "eliminate_lock_INLR_2a", bad_lock); #endif return false; } if (unique_lock != this) { #ifdef ASSERT - this->log_lock_optimization(c, "eliminate_lock_INLR_2b"); + this->log_lock_optimization(c, "eliminate_lock_INLR_2b", (unique_lock != NULL ? unique_lock : bad_lock)); + if (PrintEliminateLocks && Verbose) { + tty->print_cr("=============== unique_lock != this ============"); + tty->print(" this: "); + this->dump(); + tty->print(" box: "); + box->dump(); + tty->print(" obj: "); + obj->dump(); + if (unique_lock != NULL) { + tty->print(" unique_lock: "); + unique_lock->dump(); + } + if (bad_lock != NULL) { + tty->print(" bad_lock: "); + bad_lock->dump(); + } + tty->print_cr("==============="); + } #endif return false; } @@ -2012,23 +2044,21 @@ return result; } -const char * AbstractLockNode::kind_as_string() const { - return is_coarsened() ? "coarsened" : - is_nested() ? "nested" : - is_non_esc_obj() ? "non_escaping" : - "?"; -} - -void AbstractLockNode::log_lock_optimization(Compile *C, const char * tag) const { +void AbstractLockNode::log_lock_optimization(Compile *C, const char * tag, Node* bad_lock) const { if (C == NULL) { return; } CompileLog* log = C->log(); if (log != NULL) { - log->begin_head("%s lock='%d' compile_id='%d' class_id='%s' kind='%s'", - tag, is_Lock(), C->compile_id(), + Node* box = box_node(); + Node* obj = obj_node(); + int box_id = box != NULL ? box->_idx : -1; + int obj_id = obj != NULL ? obj->_idx : -1; + + log->begin_head("%s compile_id='%d' lock_id='%d' class='%s' kind='%s' box_id='%d' obj_id='%d' bad_id='%d'", + tag, C->compile_id(), this->_idx, is_Unlock() ? "unlock" : is_Lock() ? "lock" : "?", - kind_as_string()); + kind_as_string(), box_id, obj_id, (bad_lock != NULL ? bad_lock->_idx : -1)); log->stamp(); log->end_head(); JVMState* p = is_Unlock() ? (as_Unlock()->dbg_jvms()) : jvms(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/callnode.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/callnode.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/callnode.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/callnode.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -985,9 +985,11 @@ Coarsened, // Lock was coarsened Nested // Nested lock } _kind; + + static const char* _kind_names[Nested+1]; + #ifndef PRODUCT NamedCounter* _counter; - static const char* _kind_names[Nested+1]; #endif protected: @@ -1030,7 +1032,7 @@ bool is_nested() const { return (_kind == Nested); } const char * kind_as_string() const; - void log_lock_optimization(Compile* c, const char * tag) const; + void log_lock_optimization(Compile* c, const char * tag, Node* bad_lock = NULL) const; void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); } void set_coarsened() { _kind = Coarsened; set_eliminated_lock_counter(); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/compile.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/compile.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/compile.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/compile.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -423,6 +423,7 @@ remove_opaque4_node(opaq); } } + remove_useless_coarsened_locks(useful); // remove useless coarsened locks nodes BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); bs->eliminate_useless_gc_barriers(useful); // clean up the late inline lists @@ -512,6 +513,12 @@ tty->print_cr("** Bailout: Recompile without boxing elimination **"); tty->print_cr("*********************************************************"); } + if ((_do_locks_coarsening != EliminateLocks) && PrintOpto) { + // Recompiling without locks coarsening + tty->print_cr("*********************************************************"); + tty->print_cr("** Bailout: Recompile without locks coarsening **"); + tty->print_cr("*********************************************************"); + } if (C->directive()->BreakAtCompileOption) { // Open the debugger when compiling this method. tty->print("### Breaking when compiling: "); @@ -637,13 +644,15 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, - bool subsume_loads, bool do_escape_analysis, bool eliminate_boxing, DirectiveSet* directive) + bool subsume_loads, bool do_escape_analysis, bool eliminate_boxing, + bool do_locks_coarsening, DirectiveSet* directive) : Phase(Compiler), _env(ci_env), _directive(directive), _log(ci_env->log()), _compile_id(ci_env->compile_id()), _save_argument_registers(false), + _do_locks_coarsening(do_locks_coarsening), _stub_name(NULL), _stub_function(NULL), _stub_entry_point(NULL), @@ -668,6 +677,7 @@ _inner_loops(0), _scratch_const_size(-1), _in_scratch_emit_size(false), + _coarsened_locks (comp_arena(), 8, 0, NULL), _dead_node_list(comp_arena()), _dead_node_count(0), #ifndef PRODUCT @@ -967,6 +977,7 @@ _log(ci_env->log()), _compile_id(0), _save_argument_registers(save_arg_registers), + _do_locks_coarsening(false), _method(NULL), _stub_name(stub_name), _stub_function(stub_function), @@ -4316,16 +4327,22 @@ } ciType* superelem = superk; - if (superelem->is_array_klass()) + ciType* subelem = subk; + if (superelem->is_array_klass()) { superelem = superelem->as_array_klass()->base_element_type(); + } + if (subelem->is_array_klass()) { + subelem = subelem->as_array_klass()->base_element_type(); + } if (!subk->is_interface()) { // cannot trust static interface types yet if (subk->is_subtype_of(superk)) { return SSC_always_true; // (1) false path dead; no dynamic test needed } if (!(superelem->is_klass() && superelem->as_klass()->is_interface()) && + !(subelem->is_klass() && subelem->as_klass()->is_interface()) && !superk->is_subtype_of(subk)) { - return SSC_always_false; + return SSC_always_false; // (2) true path dead; no dynamic test needed } } @@ -4714,6 +4731,103 @@ } /** + * Track coarsened Lock and Unlock nodes. + */ + +class Lock_List : public Node_List { + uint _origin_cnt; +public: + Lock_List(Arena *a, uint cnt) : Node_List(a), _origin_cnt(cnt) {} + uint origin_cnt() const { return _origin_cnt; } +}; + +void Compile::add_coarsened_locks(GrowableArray& locks) { + int length = locks.length(); + if (length > 0) { + // Have to keep this list until locks elimination during Macro nodes elimination. + Lock_List* locks_list = new (comp_arena()) Lock_List(comp_arena(), length); + for (int i = 0; i < length; i++) { + AbstractLockNode* lock = locks.at(i); + assert(lock->is_coarsened(), "expecting only coarsened AbstractLock nodes, but got '%s'[%d] node", lock->Name(), lock->_idx); + locks_list->push(lock); + } + _coarsened_locks.append(locks_list); + } +} + +void Compile::remove_useless_coarsened_locks(Unique_Node_List& useful) { + int count = coarsened_count(); + for (int i = 0; i < count; i++) { + Node_List* locks_list = _coarsened_locks.at(i); + for (uint j = 0; j < locks_list->size(); j++) { + Node* lock = locks_list->at(j); + assert(lock->is_AbstractLock(), "sanity"); + if (!useful.member(lock)) { + locks_list->yank(lock); + } + } + } +} + +void Compile::remove_coarsened_lock(Node* n) { + if (n->is_AbstractLock()) { + int count = coarsened_count(); + for (int i = 0; i < count; i++) { + Node_List* locks_list = _coarsened_locks.at(i); + locks_list->yank(n); + } + } +} + +bool Compile::coarsened_locks_consistent() { + int count = coarsened_count(); + for (int i = 0; i < count; i++) { + bool unbalanced = false; + bool modified = false; // track locks kind modifications + Lock_List* locks_list = (Lock_List*)_coarsened_locks.at(i); + uint size = locks_list->size(); + if (size == 0) { + unbalanced = false; // All locks were eliminated - good + } else if (size != locks_list->origin_cnt()) { + unbalanced = true; // Some locks were removed from list + } else { + for (uint j = 0; j < size; j++) { + Node* lock = locks_list->at(j); + // All nodes in group should have the same state (modified or not) + if (!lock->as_AbstractLock()->is_coarsened()) { + if (j == 0) { + // first on list was modified, the rest should be too for consistency + modified = true; + } else if (!modified) { + // this lock was modified but previous locks on the list were not + unbalanced = true; + break; + } + } else if (modified) { + // previous locks on list were modified but not this lock + unbalanced = true; + break; + } + } + } + if (unbalanced) { + // unbalanced monitor enter/exit - only some [un]lock nodes were removed or modified +#ifdef ASSERT + if (PrintEliminateLocks) { + tty->print_cr("=== unbalanced coarsened locks ==="); + for (uint l = 0; l < size; l++) { + locks_list->at(l)->dump(); + } + } +#endif + record_failure(C2Compiler::retry_no_locks_coarsening()); + return false; + } + } + return true; +} + +/** * Remove the speculative part of types and clean up the graph */ void Compile::remove_speculative_types(PhaseIterGVN &igvn) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/compile.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/compile.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/compile.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/compile.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -45,6 +45,7 @@ #include "runtime/vmThread.hpp" #include "utilities/ticks.hpp" +class AbstractLockNode; class AddPNode; class Block; class Bundle; @@ -63,6 +64,7 @@ class MachSafePointNode; class Node; class Node_Array; +class Node_List; class Node_Notes; class NodeCloneInfo; class OptoReg; @@ -364,6 +366,7 @@ const bool _subsume_loads; // Load can be matched as part of a larger op. const bool _do_escape_analysis; // Do escape analysis. const bool _eliminate_boxing; // Do boxing elimination. + const bool _do_locks_coarsening; // Do locks coarsening ciMethod* _method; // The method being compiled. int _entry_bci; // entry bci for osr methods. const TypeFunc* _tf; // My kind of signature @@ -431,6 +434,7 @@ GrowableArray* _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common GrowableArray* _range_check_casts; // List of CastII nodes with a range check dependency GrowableArray* _opaque4_nodes; // List of Opaque4 nodes that have a default value + GrowableArray _coarsened_locks; // List of coarsened Lock and Unlock nodes ConnectionGraph* _congraph; #ifndef PRODUCT IdealGraphPrinter* _printer; @@ -637,6 +641,8 @@ bool aggressive_unboxing() const { return _eliminate_boxing && AggressiveUnboxing; } bool save_argument_registers() const { return _save_argument_registers; } + /** Do locks coarsening. */ + bool do_locks_coarsening() const { return _do_locks_coarsening; } // Other fixed compilation parameters. ciMethod* method() const { return _method; } @@ -786,6 +792,7 @@ int macro_count() const { return _macro_nodes->length(); } int predicate_count() const { return _predicate_opaqs->length();} int expensive_count() const { return _expensive_nodes->length(); } + int coarsened_count() const { return _coarsened_locks.length(); } Node* macro_node(int idx) const { return _macro_nodes->at(idx); } Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);} Node* expensive_node(int idx) const { return _expensive_nodes->at(idx); } @@ -805,6 +812,10 @@ if (predicate_count() > 0 && _predicate_opaqs->contains(n)){ _predicate_opaqs->remove(n); } + // Remove from coarsened locks list if present + if (coarsened_count() > 0) { + remove_coarsened_lock(n); + } } void add_expensive_node(Node * n); void remove_expensive_node(Node * n) { @@ -829,6 +840,9 @@ int range_check_cast_count() const { return _range_check_casts->length(); } // Remove all range check dependent CastIINodes. void remove_range_check_casts(PhaseIterGVN &igvn); + void add_coarsened_locks(GrowableArray& locks); + void remove_coarsened_lock(Node* n); + bool coarsened_locks_consistent(); void add_opaque4_node(Node* n); void remove_opaque4_node(Node* n) { @@ -1080,6 +1094,8 @@ void remove_useless_late_inlines(GrowableArray* inlines, Unique_Node_List &useful); + void remove_useless_coarsened_locks(Unique_Node_List& useful); + void process_print_inlining(); void dump_print_inlining(); @@ -1186,7 +1202,8 @@ // continuation. Compile(ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int entry_bci, bool subsume_loads, bool do_escape_analysis, - bool eliminate_boxing, DirectiveSet* directive); + bool eliminate_boxing, bool do_locks_coarsening, + DirectiveSet* directive); // Second major entry point. From the TypeFunc signature, generate code // to pass arguments from the Java calling convention to the C calling diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/gcm.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/gcm.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/gcm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/gcm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -540,6 +540,28 @@ return early; } +// This function is used by insert_anti_dependences to find unrelated loads for stores in implicit null checks. +bool PhaseCFG::unrelated_load_in_store_null_block(Node* store, Node* load) { + // We expect an anti-dependence edge from 'load' to 'store', except when + // implicit_null_check() has hoisted 'store' above its early block to + // perform an implicit null check, and 'load' is placed in the null + // block. In this case it is safe to ignore the anti-dependence, as the + // null block is only reached if 'store' tries to write to null object and + // 'load' read from non-null object (there is preceding check for that) + // These objects can't be the same. + Block* store_block = get_block_for_node(store); + Block* load_block = get_block_for_node(load); + Node* end = store_block->end(); + if (end->is_MachNullCheck() && (end->in(1) == store) && store_block->dominates(load_block)) { + Node* if_true = end->find_out_with(Op_IfTrue); + assert(if_true != NULL, "null check without null projection"); + Node* null_block_region = if_true->find_out_with(Op_Region); + assert(null_block_region != NULL, "null check without null region"); + return get_block_for_node(null_block_region) == load_block; + } + return false; +} + //--------------------------insert_anti_dependences--------------------------- // A load may need to witness memory that nearby stores can overwrite. // For each nearby store, either insert an "anti-dependence" edge @@ -793,7 +815,7 @@ // will find him on the non_early_stores list and stick him // with a precedence edge. // (But, don't bother if LCA is already raised all the way.) - if (LCA != early) { + if (LCA != early && !unrelated_load_in_store_null_block(store, load)) { store_block->set_raise_LCA_mark(load_index); must_raise_LCA = true; non_early_stores.push(store); @@ -804,23 +826,7 @@ // Add an anti-dep edge, and squeeze 'load' into the highest block. assert(store != load->find_exact_control(load->in(0)), "dependence cycle found"); if (verify) { -#ifdef ASSERT - // We expect an anti-dependence edge from 'load' to 'store', except when - // implicit_null_check() has hoisted 'store' above its early block to - // perform an implicit null check, and 'load' is placed in the null - // block. In this case it is safe to ignore the anti-dependence, as the - // null block is only reached if 'store' tries to write to null. - Block* store_null_block = NULL; - Node* store_null_check = store->find_out_with(Op_MachNullCheck); - if (store_null_check != NULL) { - Node* if_true = store_null_check->find_out_with(Op_IfTrue); - assert(if_true != NULL, "null check without null projection"); - Node* null_block_region = if_true->find_out_with(Op_Region); - assert(null_block_region != NULL, "null check without null region"); - store_null_block = get_block_for_node(null_block_region); - } -#endif - assert(LCA == store_null_block || store->find_edge(load) != -1, + assert(store->find_edge(load) != -1 || unrelated_load_in_store_null_block(store, load), "missing precedence edge"); } else { store->add_prec(load); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/graphKit.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/graphKit.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/graphKit.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/graphKit.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1180,15 +1180,31 @@ Node *r_adr = basic_plus_adr(array, arrayOopDesc::length_offset_in_bytes()); alen = _gvn.transform( new LoadRangeNode(0, immutable_memory(), r_adr, TypeInt::POS)); } else { - alen = alloc->Ideal_length(); - Node* ccast = alloc->make_ideal_length(_gvn.type(array)->is_oopptr(), &_gvn); - if (ccast != alen) { - alen = _gvn.transform(ccast); - } + alen = array_ideal_length(alloc, _gvn.type(array)->is_oopptr(), false); } return alen; } +Node* GraphKit::array_ideal_length(AllocateArrayNode* alloc, + const TypeOopPtr* oop_type, + bool replace_length_in_map) { + Node* length = alloc->Ideal_length(); + if (replace_length_in_map == false || map()->find_edge(length) >= 0) { + Node* ccast = alloc->make_ideal_length(oop_type, &_gvn); + if (ccast != length) { + // do not transfrom ccast here, it might convert to top node for + // negative array length and break assumptions in parsing stage. + _gvn.set_type_bottom(ccast); + record_for_igvn(ccast); + if (replace_length_in_map) { + replace_in_map(length, ccast); + } + return ccast; + } + } + return length; +} + //------------------------------do_null_check---------------------------------- // Helper function to do a NULL pointer check. Returned value is // the incoming address with NULL casted away. You are allowed to use the @@ -3734,16 +3750,7 @@ Node* javaoop = set_output_for_allocation(alloc, ary_type, deoptimize_on_exception); - // Cast length on remaining path to be as narrow as possible - if (map()->find_edge(length) >= 0) { - Node* ccast = alloc->make_ideal_length(ary_type, &_gvn); - if (ccast != length) { - _gvn.set_type_bottom(ccast); - record_for_igvn(ccast); - replace_in_map(length, ccast); - } - } - + array_ideal_length(alloc, ary_type, true); return javaoop; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/graphKit.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/graphKit.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/graphKit.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/graphKit.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -336,6 +336,12 @@ Node* load_object_klass(Node* object); // Find out the length of an array. Node* load_array_length(Node* array); + // Cast array allocation's length as narrow as possible. + // If replace_length_in_map is true, replace length with CastIINode in map. + // This method is invoked after creating/moving ArrayAllocationNode or in load_array_length + Node* array_ideal_length(AllocateArrayNode* alloc, + const TypeOopPtr* oop_type, + bool replace_length_in_map); // Helper function to do a NULL pointer check or ZERO check based on type. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/lcm.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/lcm.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/lcm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/lcm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -413,7 +413,8 @@ // Move the control dependence if it is pinned to not-null block. // Don't change it in other cases: NULL or dominating control. - if (best->in(0) == not_null_block->head()) { + Node* ctrl = best->in(0); + if (ctrl != NULL && get_block_for_node(ctrl) == not_null_block) { // Set it to control edge of null check. best->set_req(0, proj->in(0)->in(0)); } @@ -1390,14 +1391,40 @@ } // If the successor blocks have a CreateEx node, move it back to the top - for(uint i4 = 0; i4 < block->_num_succs; i4++ ) { + for (uint i4 = 0; i4 < block->_num_succs; i4++) { Block *sb = block->_succs[i4]; uint new_cnt = end - beg; - // Remove any newly created, but dead, nodes. - for( uint j = new_cnt; j > 0; j-- ) { + // Remove any newly created, but dead, nodes by traversing their schedule + // backwards. Here, a dead node is a node whose only outputs (if any) are + // unused projections. + for (uint j = new_cnt; j > 0; j--) { Node *n = sb->get_node(j); - if (n->outcnt() == 0 && - (!n->is_Proj() || n->as_Proj()->in(0)->outcnt() == 1) ){ + // Individual projections are examined together with all siblings when + // their parent is visited. + if (n->is_Proj()) { + continue; + } + bool dead = true; + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node* out = n->fast_out(i); + // n is live if it has a non-projection output or a used projection. + if (!out->is_Proj() || out->outcnt() > 0) { + dead = false; + break; + } + } + if (dead) { + // n's only outputs (if any) are unused projections scheduled next to n + // (see PhaseCFG::select()). Remove these projections backwards. + for (uint k = j + n->outcnt(); k > j; k--) { + Node* proj = sb->get_node(k); + assert(proj->is_Proj() && proj->in(0) == n, + "projection should correspond to dead node"); + proj->disconnect_inputs(NULL, C); + sb->remove_node(k); + new_cnt--; + } + // Now remove the node itself. n->disconnect_inputs(NULL, C); sb->remove_node(j); new_cnt--; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/library_call.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/library_call.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/library_call.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/library_call.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -4592,6 +4592,36 @@ Node* alloc_mem = alloc->in(TypeFunc::Memory); C->gvn_replace_by(callprojs.fallthrough_ioproj, alloc->in(TypeFunc::I_O)); C->gvn_replace_by(init->proj_out(TypeFunc::Memory), alloc_mem); + + // The CastIINode created in GraphKit::new_array (in AllocateArrayNode::make_ideal_length) must stay below + // the allocation (i.e. is only valid if the allocation succeeds): + // 1) replace CastIINode with AllocateArrayNode's length here + // 2) Create CastIINode again once allocation has moved (see below) at the end of this method + // + // Multiple identical CastIINodes might exist here. Each GraphKit::load_array_length() call will generate + // new separate CastIINode (arraycopy guard checks or any array length use between array allocation and ararycopy) + Node* init_control = init->proj_out(TypeFunc::Control); + Node* alloc_length = alloc->Ideal_length(); +#ifdef ASSERT + Node* prev_cast = NULL; +#endif + for (uint i = 0; i < init_control->outcnt(); i++) { + Node* init_out = init_control->raw_out(i); + if (init_out->is_CastII() && init_out->in(TypeFunc::Control) == init_control && init_out->in(1) == alloc_length) { +#ifdef ASSERT + if (prev_cast == NULL) { + prev_cast = init_out; + } else { + if (prev_cast->cmp(*init_out) == false) { + prev_cast->dump(); + init_out->dump(); + assert(false, "not equal CastIINode"); + } + } +#endif + C->gvn_replace_by(init_out, alloc_length); + } + } C->gvn_replace_by(init->proj_out(TypeFunc::Control), alloc->in(0)); // move the allocation here (after the guards) @@ -4623,6 +4653,8 @@ dest->set_req(0, control()); Node* destx = _gvn.transform(dest); assert(destx == dest, "where has the allocation result gone?"); + + array_ideal_length(alloc, ary_type, true); } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/locknode.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/locknode.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/locknode.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/locknode.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -85,7 +85,7 @@ } // Is BoxLock node used for one simple lock region (same box and obj)? -bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) { +bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj, Node** bad_lock) { LockNode* lock = NULL; bool has_one_lock = false; for (uint i = 0; i < this->outcnt(); i++) { @@ -102,9 +102,15 @@ has_one_lock = true; } else if (lock != alock->as_Lock()) { has_one_lock = false; + if (bad_lock != NULL) { + *bad_lock = alock; + } } } } else { + if (bad_lock != NULL) { + *bad_lock = alock; + } return false; // Different objects } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/locknode.hpp openjdk-11-11.0.13+8/src/hotspot/share/opto/locknode.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/locknode.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/locknode.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -63,7 +63,7 @@ void set_eliminated() { _is_eliminated = true; } // Is BoxLock node used for one simple lock region? - bool is_simple_lock_region(LockNode** unique_lock, Node* obj); + bool is_simple_lock_region(LockNode** unique_lock, Node* obj, Node** bad_lock); #ifndef PRODUCT virtual void format( PhaseRegAlloc *, outputStream *st ) const; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/loopTransform.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/loopTransform.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/loopTransform.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/loopTransform.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -381,35 +381,39 @@ // If we got the effect of peeling, either by actually peeling or by making // a pre-loop which must execute at least once, we can remove all // loop-invariant dominated tests in the main body. -void PhaseIdealLoop::peeled_dom_test_elim( IdealLoopTree *loop, Node_List &old_new ) { +void PhaseIdealLoop::peeled_dom_test_elim(IdealLoopTree* loop, Node_List& old_new) { bool progress = true; - while( progress ) { - progress = false; // Reset for next iteration - Node *prev = loop->_head->in(LoopNode::LoopBackControl);//loop->tail(); - Node *test = prev->in(0); - while( test != loop->_head ) { // Scan till run off top of loop - + while (progress) { + progress = false; // Reset for next iteration + Node* prev = loop->_head->in(LoopNode::LoopBackControl); // loop->tail(); + Node* test = prev->in(0); + while (test != loop->_head) { // Scan till run off top of loop int p_op = prev->Opcode(); - if( (p_op == Op_IfFalse || p_op == Op_IfTrue) && - test->is_If() && // Test? - !test->in(1)->is_Con() && // And not already obvious? - // Condition is not a member of this loop? - !loop->is_member(get_loop(get_ctrl(test->in(1))))){ + assert(test != NULL, "test cannot be NULL"); + Node* test_cond = NULL; + if ((p_op == Op_IfFalse || p_op == Op_IfTrue) && test->is_If()) { + test_cond = test->in(1); + } + if (test_cond != NULL && // Test? + !test_cond->is_Con() && // And not already obvious? + // And condition is not a member of this loop? + !loop->is_member(get_loop(get_ctrl(test_cond)))) { // Walk loop body looking for instances of this test - for( uint i = 0; i < loop->_body.size(); i++ ) { - Node *n = loop->_body.at(i); - if( n->is_If() && n->in(1) == test->in(1) /*&& n != loop->tail()->in(0)*/ ) { + for (uint i = 0; i < loop->_body.size(); i++) { + Node* n = loop->_body.at(i); + // Check against cached test condition because dominated_by() + // replaces the test condition with a constant. + if (n->is_If() && n->in(1) == test_cond) { // IfNode was dominated by version in peeled loop body progress = true; - dominated_by( old_new[prev->_idx], n ); + dominated_by(old_new[prev->_idx], n); } } } prev = test; test = idom(test); } // End of scan tests in loop - - } // End of while( progress ) + } // End of while (progress) } //------------------------------do_peeling------------------------------------- @@ -2178,22 +2182,40 @@ register_new_node(limit, pre_ctrl); } - // Clamp the limit to handle integer under-/overflows. + // Clamp the limit to handle integer under-/overflows by using long values. + // We only convert the limit back to int when we handled under-/overflows. + // Note that all values are longs in the following computations. // When reducing the limit, clamp to [min_jint, old_limit]: - // MIN(old_limit, MAX(limit, min_jint)) + // INT(MINL(old_limit, MAXL(limit, min_jint))) + // - integer underflow of limit: MAXL chooses min_jint. + // - integer overflow of limit: MINL chooses old_limit (<= MAX_INT < limit) // When increasing the limit, clamp to [old_limit, max_jint]: - // MAX(old_limit, MIN(limit, max_jint)) - Node* cmp = new CmpLNode(limit, _igvn.longcon(is_positive_stride ? min_jint : max_jint)); + // INT(MAXL(old_limit, MINL(limit, max_jint))) + // - integer overflow of limit: MINL chooses max_jint. + // - integer underflow of limit: MAXL chooses old_limit (>= MIN_INT > limit) + // INT() is finally converting the limit back to an integer value. + + // We use CMove nodes to implement long versions of min/max (MINL/MAXL). + // We use helper methods for inner MINL/MAXL which return CMoveL nodes to keep a long value for the outer MINL/MAXL comparison: + Node* inner_result_long; + if (is_positive_stride) { + inner_result_long = MaxNode::signed_max(limit, _igvn.longcon(min_jint), TypeLong::LONG, _igvn); + } else { + inner_result_long = MaxNode::signed_min(limit, _igvn.longcon(max_jint), TypeLong::LONG, _igvn); + } + set_subtree_ctrl(inner_result_long); + + // Outer MINL/MAXL: + // The comparison is done with long values but the result is the converted back to int by using CmovI. + Node* old_limit_long = new ConvI2LNode(old_limit); + register_new_node(old_limit_long, pre_ctrl); + Node* cmp = new CmpLNode(old_limit_long, limit); register_new_node(cmp, pre_ctrl); - Node* bol = new BoolNode(cmp, is_positive_stride ? BoolTest::lt : BoolTest::gt); + Node* bol = new BoolNode(cmp, is_positive_stride ? BoolTest::gt : BoolTest::lt); register_new_node(bol, pre_ctrl); - limit = new ConvL2INode(limit); - register_new_node(limit, pre_ctrl); - limit = new CMoveINode(bol, limit, _igvn.intcon(is_positive_stride ? min_jint : max_jint), TypeInt::INT); - register_new_node(limit, pre_ctrl); - - limit = is_positive_stride ? (Node*)(new MinINode(old_limit, limit)) - : (Node*)(new MaxINode(old_limit, limit)); + Node* inner_result_int = new ConvL2INode(inner_result_long); // Could under-/overflow but that's fine as comparison was done with CmpL + register_new_node(inner_result_int, pre_ctrl); + limit = new CMoveINode(bol, old_limit, inner_result_int, TypeInt::INT); register_new_node(limit, pre_ctrl); return limit; } @@ -2693,6 +2715,16 @@ register_new_node( main_cmp, main_cle->in(0) ); _igvn.replace_input_of(main_bol, 1, main_cmp); } + assert(main_limit == cl->limit() || get_ctrl(main_limit) == pre_ctrl, "wrong control for added limit"); + const TypeInt* orig_limit_t = _igvn.type(orig_limit)->is_int(); + bool upward = cl->stride_con() > 0; + // The new loop limit is <= (for an upward loop) >= (for a downward loop) than the orig limit. + // The expression that computes the new limit may be too complicated and the computed type of the new limit + // may be too pessimistic. A CastII here guarantees it's not lost. + main_limit = new CastIINode(main_limit, TypeInt::make(upward ? min_jint : orig_limit_t->_lo, + upward ? orig_limit_t->_hi : max_jint, Type::WidenMax)); + main_limit->init_req(0, pre_ctrl); + register_new_node(main_limit, pre_ctrl); // Hack the now-private loop bounds _igvn.replace_input_of(main_cmp, 2, main_limit); // The OpaqueNode is unshared by design @@ -3169,6 +3201,7 @@ phase->do_peeling(this,old_new); } else if (should_unswitch) { phase->do_unswitching(this, old_new); + return false; // need to recalculate idom data } return true; } @@ -3187,7 +3220,7 @@ if (cl->is_normal_loop()) { if (should_unswitch) { phase->do_unswitching(this, old_new); - return true; + return false; // need to recalculate idom data } bool should_maximally_unroll = policy_maximally_unroll(phase); if (should_maximally_unroll) { @@ -3312,6 +3345,7 @@ } } else if (policy_unswitching(phase)) { phase->do_unswitching(this, old_new); + return false; // need to recalculate idom data } } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/loopopts.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/loopopts.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/loopopts.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/loopopts.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1076,7 +1076,7 @@ // For inner loop uses move it to the preheader area. Node *PhaseIdealLoop::place_near_use(Node *useblock) const { IdealLoopTree *u_loop = get_loop( useblock ); - if (u_loop->_irreducible) { + if (u_loop->_irreducible || !u_loop->_head->is_Loop()) { return useblock; } if (u_loop->_child) { @@ -2041,10 +2041,14 @@ // Step 1: Clone the loop body. Make the old->new mapping. uint i; - for( i = 0; i < loop->_body.size(); i++ ) { - Node *old = loop->_body.at(i); - Node *nnn = old->clone(); - old_new.map( old->_idx, nnn ); + for (i = 0; i < loop->_body.size(); i++) { + Node* old = loop->_body.at(i); + Node* nnn = old->clone(); + old_new.map(old->_idx, nnn); + if (old->is_reduction()) { + // Reduction flag is not copied by default. Copy it here when cloning the entire loop body. + nnn->add_flag(Node::Flag_is_reduction); + } if (C->do_vector_loop()) { cm.verify_insert_and_clone(old, nnn, cm.clone_idx()); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/macro.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/macro.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/macro.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/macro.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -2017,15 +2017,15 @@ // Mark all associated (same box and obj) lock and unlock nodes for // elimination if some of them marked already. void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) { - if (oldbox->as_BoxLock()->is_eliminated()) + if (oldbox->as_BoxLock()->is_eliminated()) { return; // This BoxLock node was processed already. - + } // New implementation (EliminateNestedLocks) has separate BoxLock // node for each locked region so mark all associated locks/unlocks as // eliminated even if different objects are referenced in one locked region // (for example, OSR compilation of nested loop inside locked scope). if (EliminateNestedLocks || - oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj)) { + oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj, NULL)) { // Box is used only in one lock region. Mark this box as eliminated. _igvn.hash_delete(oldbox); oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value @@ -2197,11 +2197,7 @@ #ifndef PRODUCT if (PrintEliminateLocks) { - if (alock->is_Lock()) { - tty->print_cr("++++ Eliminated: %d Lock", alock->_idx); - } else { - tty->print_cr("++++ Eliminated: %d Unlock", alock->_idx); - } + tty->print_cr("++++ Eliminated: %d %s '%s'", alock->_idx, (alock->is_Lock() ? "Lock" : "Unlock"), alock->kind_as_string()); } #endif @@ -2573,16 +2569,21 @@ if (C->macro_count() == 0) return; - // First, attempt to eliminate locks + // Before elimination may re-mark (change to Nested or NonEscObj) + // all associated (same box and obj) lock and unlock nodes. int cnt = C->macro_count(); for (int i=0; i < cnt; i++) { Node *n = C->macro_node(i); if (n->is_AbstractLock()) { // Lock and Unlock nodes - // Before elimination mark all associated (same box and obj) - // lock and unlock nodes. mark_eliminated_locking_nodes(n->as_AbstractLock()); } } + // Re-marking may break consistency of Coarsened locks. + if (!C->coarsened_locks_consistent()) { + return; // recompile without Coarsened locks if broken + } + + // First, attempt to eliminate locks bool progress = true; while (progress) { progress = false; @@ -2643,6 +2644,7 @@ bool PhaseMacroExpand::expand_macro_nodes() { // Last attempt to eliminate macro nodes. eliminate_macro_nodes(); + if (C->failing()) return true; // Make sure expansion will not cause node limit to be exceeded. // Worst case is a macro node gets expanded into about 200 nodes. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/macroArrayCopy.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/macroArrayCopy.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/macroArrayCopy.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/macroArrayCopy.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -731,7 +731,9 @@ } _igvn.replace_node(_memproj_fallthrough, out_mem); - _igvn.replace_node(_ioproj_fallthrough, *io); + if (_ioproj_fallthrough != NULL) { + _igvn.replace_node(_ioproj_fallthrough, *io); + } _igvn.replace_node(_fallthroughcatchproj, *ctrl); #ifdef ASSERT @@ -996,8 +998,14 @@ } transform_later(out_mem); - *io = _ioproj_fallthrough->clone(); - transform_later(*io); + // When src is negative and arraycopy is before an infinite loop, _ioproj_fallthrough + // could be NULL. Skip clone and update NULL _ioproj_fallthrough. + if (_ioproj_fallthrough != NULL) { + *io = _ioproj_fallthrough->clone(); + transform_later(*io); + } else { + *io = NULL; + } return out_mem; } @@ -1219,7 +1227,9 @@ } _igvn.replace_node(_memproj_fallthrough, merge_mem); - _igvn.replace_node(_ioproj_fallthrough, io); + if (_ioproj_fallthrough != NULL) { + _igvn.replace_node(_ioproj_fallthrough, io); + } _igvn.replace_node(_fallthroughcatchproj, ctrl); return; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/node.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/node.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/node.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/node.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -503,6 +503,10 @@ C->add_macro_node(n); if (is_expensive()) C->add_expensive_node(n); + if (n->is_reduction()) { + // Do not copy reduction information. This must be explicitly set by the calling code. + n->remove_flag(Node::Flag_is_reduction); + } BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); bs->register_potential_barrier_node(n); // If the cloned node is a range check dependent CastII, add it to the list. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/reg_split.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/reg_split.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/reg_split.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/reg_split.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -114,6 +114,8 @@ // Do not insert between a call and his Catch if( b->get_node(i)->is_Catch() ) { // Put the instruction at the top of the fall-thru block. + // This assumes that the instruction is not used in the other exception + // blocks. Global code motion is responsible for maintaining this invariant. // Find the fall-thru projection while( 1 ) { const CatchProjNode *cp = b->get_node(++i)->as_CatchProj(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/opto/stringopts.cpp openjdk-11-11.0.13+8/src/hotspot/share/opto/stringopts.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/opto/stringopts.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/opto/stringopts.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1149,6 +1149,11 @@ int arg_val = arg->get_int(); int count = 1; if (arg_val < 0) { + // Special case for min_jint - it can't be negated. + if (arg_val == min_jint) { + return __ intcon(11); + } + arg_val = -arg_val; count++; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/jni.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/jni.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/jni.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/jni.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -37,6 +37,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "gc/shared/gcLocker.inline.hpp" +#include "gc/shared/stringdedup/stringDedup.hpp" #include "interpreter/linkResolver.hpp" #include "jfr/jfrEvents.hpp" #include "jfr/support/jfrThreadId.hpp" @@ -585,7 +586,7 @@ oop super_mirror = JNIHandles::resolve_non_null(super); if (java_lang_Class::is_primitive(sub_mirror) || java_lang_Class::is_primitive(super_mirror)) { - jboolean ret = oopDesc::equals(sub_mirror, super_mirror); + jboolean ret = (sub_mirror == super_mirror); HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN(ret); return ret; @@ -1230,7 +1231,7 @@ HOTSPOT_JNI_NEWOBJECTA_ENTRY(env, clazz, (uintptr_t) methodID); jobject obj = NULL; - DT_RETURN_MARK(NewObjectA, jobject, (const jobject)obj); + DT_RETURN_MARK(NewObjectA, jobject, (const jobject&)obj); instanceOop i = alloc_object(clazz, CHECK_NULL); obj = JNIHandles::make_local(env, i); @@ -3212,30 +3213,62 @@ HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_RETURN(); JNI_END +// If a copy of string value should be returned instead +static bool should_copy_string_value(oop str) { + return java_lang_String::is_latin1(str) || + // To prevent deduplication from replacing the value array while setting up or in + // the critical section. That would lead to the release operation + // unpinning the wrong object. + (Universe::heap()->supports_object_pinning() && StringDedup::is_enabled()); +} + +static typeArrayOop lock_gc_or_pin_string_value(JavaThread* thread, oop str) { + if (Universe::heap()->supports_object_pinning()) { + typeArrayOop s_value = java_lang_String::value(str); + return (typeArrayOop) Universe::heap()->pin_object(thread, s_value); + } else { + Handle h(thread, str); // Handlize across potential safepoint. + GCLocker::lock_critical(thread); + return java_lang_String::value(h()); + } +} + +static void unlock_gc_or_unpin_string_value(JavaThread* thread, oop str) { + if (Universe::heap()->supports_object_pinning()) { + typeArrayOop s_value = java_lang_String::value(str); + Universe::heap()->unpin_object(thread, s_value); + } else { + GCLocker::unlock_critical(thread); + } +} JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy)) JNIWrapper("GetStringCritical"); HOTSPOT_JNI_GETSTRINGCRITICAL_ENTRY(env, string, (uintptr_t *) isCopy); - oop s = lock_gc_or_pin_object(thread, string); - typeArrayOop s_value = java_lang_String::value(s); - bool is_latin1 = java_lang_String::is_latin1(s); - if (isCopy != NULL) { - *isCopy = is_latin1 ? JNI_TRUE : JNI_FALSE; - } + oop s = JNIHandles::resolve_non_null(string); jchar* ret; - if (!is_latin1) { - ret = (jchar*) s_value->base(T_CHAR); - } else { - // Inflate latin1 encoded string to UTF16 + if (should_copy_string_value(s)) { + typeArrayOop s_value = java_lang_String::value(s); int s_len = java_lang_String::length(s); ret = NEW_C_HEAP_ARRAY_RETURN_NULL(jchar, s_len + 1, mtInternal); // add one for zero termination /* JNI Specification states return NULL on OOM */ if (ret != NULL) { - for (int i = 0; i < s_len; i++) { - ret[i] = ((jchar) s_value->byte_at(i)) & 0xff; + bool is_latin1 = java_lang_String::is_latin1(s); + // Inflate latin1 encoded string to UTF16 + if (is_latin1) { + for (int i = 0; i < s_len; i++) { + ret[i] = ((jchar) s_value->byte_at(i)) & 0xff; + } + } else { + memcpy(ret, s_value->char_at_addr(0), s_len * sizeof(jchar)); } ret[s_len] = 0; } + if (isCopy != NULL) *isCopy = JNI_TRUE; + } else { + typeArrayOop s_value = lock_gc_or_pin_string_value(thread, s); + ret = (jchar*) s_value->base(T_CHAR); + if (isCopy != NULL) *isCopy = JNI_FALSE; } HOTSPOT_JNI_GETSTRINGCRITICAL_RETURN((uint16_t *) ret); return ret; @@ -3247,13 +3280,14 @@ HOTSPOT_JNI_RELEASESTRINGCRITICAL_ENTRY(env, str, (uint16_t *) chars); // The str and chars arguments are ignored for UTF16 strings oop s = JNIHandles::resolve_non_null(str); - bool is_latin1 = java_lang_String::is_latin1(s); - if (is_latin1) { - // For latin1 string, free jchar array allocated by earlier call to GetStringCritical. + if (should_copy_string_value(s)) { + // For copied string value, free jchar array allocated by earlier call to GetStringCritical. // This assumes that ReleaseStringCritical bookends GetStringCritical. FREE_C_HEAP_ARRAY(jchar, chars); + } else { + // For not copied string value, drop the associated gc-locker/pin. + unlock_gc_or_unpin_string_value(thread, s); } - unlock_gc_or_unpin_object(thread, str); HOTSPOT_JNI_RELEASESTRINGCRITICAL_RETURN(); JNI_END diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/jvm.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/jvm.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/jvm.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/jvm.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1369,7 +1369,7 @@ protection_domain = method->method_holder()->protection_domain(); } - if ((!oopDesc::equals(previous_protection_domain, protection_domain)) && (protection_domain != NULL)) { + if ((previous_protection_domain != protection_domain) && (protection_domain != NULL)) { local_array->push(protection_domain); previous_protection_domain = protection_domain; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmti.xml openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmti.xml --- openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmti.xml 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmti.xml 2021-10-12 20:42:15.000000000 +0000 @@ -9909,9 +9909,11 @@ there is a jint parameter, the event handler should be declared: - void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...) + void JNICALL myHandler(jvmtiEnv* jvmti_env, ...) Note the terminal "..." which indicates varargs. + The jint argument inside myHandler needs to be extracted using + the va_* syntax of the C programming language. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmtiExport.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExport.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmtiExport.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExport.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1543,16 +1543,12 @@ } } -void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame current_frame) { +void JvmtiExport::post_method_exit(JavaThread* thread, Method* method, frame current_frame) { HandleMark hm(thread); methodHandle mh(thread, method); - EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Trg Method Exit triggered %s.%s", - JvmtiTrace::safe_get_thread_name(thread), - (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(), - (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() )); - JvmtiThreadState *state = thread->jvmti_thread_state(); + if (state == NULL || !state->is_interp_only_mode()) { // for any thread that actually wants method exit, interp_only_mode is set return; @@ -1561,13 +1557,11 @@ // return a flag when a method terminates by throwing an exception // i.e. if an exception is thrown and it's not caught by the current method bool exception_exit = state->is_exception_detected() && !state->is_exception_caught(); - + Handle result; + jvalue value; + value.j = 0L; if (state->is_enabled(JVMTI_EVENT_METHOD_EXIT)) { - Handle result; - jvalue value; - value.j = 0L; - // if the method hasn't been popped because of an exception then we populate // the return_value parameter for the callback. At this point we only have // the address of a "raw result" and we just call into the interpreter to @@ -1577,9 +1571,36 @@ BasicType type = current_frame.interpreter_frame_result(&oop_result, &value); if (type == T_OBJECT || type == T_ARRAY) { result = Handle(thread, oop_result); + value.l = JNIHandles::make_local(thread, result()); } } + } + // Deferred transition to VM, so we can stash away the return oop before GC + // Note that this transition is not needed when throwing an exception, because + // there is no oop to retain. + JRT_BLOCK + post_method_exit_inner(thread, mh, state, exception_exit, current_frame, value); + JRT_BLOCK_END + + if (result.not_null() && !mh->is_native()) { + // We have to restore the oop on the stack for interpreter frames + *(oop*)current_frame.interpreter_frame_tos_address() = result(); + } +} + +void JvmtiExport::post_method_exit_inner(JavaThread* thread, + methodHandle& mh, + JvmtiThreadState *state, + bool exception_exit, + frame current_frame, + jvalue& value) { + EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Trg Method Exit triggered %s.%s", + JvmtiTrace::safe_get_thread_name(thread), + (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(), + (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() )); + + if (state->is_enabled(JVMTI_EVENT_METHOD_EXIT)) { JvmtiEnvThreadStateIterator it(state); for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) { if (ets->is_enabled(JVMTI_EVENT_METHOD_EXIT)) { @@ -1590,9 +1611,6 @@ JvmtiEnv *env = ets->get_env(); JvmtiMethodEventMark jem(thread, mh); - if (result.not_null()) { - value.l = JNIHandles::make_local(thread, result()); - } JvmtiJavaThreadEventTransition jet(thread); jvmtiEventMethodExit callback = env->callbacks()->MethodExit; if (callback != NULL) { @@ -1781,7 +1799,9 @@ if(state->is_interp_only_mode()) { // method exit and frame pop events are posted only in interp mode. // When these events are enabled code should be in running in interp mode. - JvmtiExport::post_method_exit(thread, method, thread->last_frame()); + jvalue no_value; + no_value.j = 0L; + JvmtiExport::post_method_exit_inner(thread, mh, state, true, thread->last_frame(), no_value); // The cached cur_stack_depth might have changed from the // operations of frame pop or method exit. We are not 100% sure // the cached cur_stack_depth is still valid depth so invalidate diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmtiExport.hpp openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExport.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmtiExport.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExport.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -187,6 +187,13 @@ // dependency information is complete or not. static bool _all_dependencies_are_recorded; + static void post_method_exit_inner(JavaThread* thread, + methodHandle& mh, + JvmtiThreadState *state, + bool exception_exit, + frame current_frame, + jvalue& value); + public: inline static bool has_redefined_a_class() { JVMTI_ONLY(return _has_redefined_a_class); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmtiExtensions.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExtensions.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/jvmtiExtensions.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/jvmtiExtensions.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -34,7 +34,14 @@ // extension function -static jvmtiError JNICALL IsClassUnloadingEnabled(const jvmtiEnv* env, jboolean* enabled, ...) { +static jvmtiError JNICALL IsClassUnloadingEnabled(const jvmtiEnv* env, ...) { + jboolean* enabled = NULL; + va_list ap; + + va_start(ap, env); + enabled = va_arg(ap, jboolean *); + va_end(ap); + if (enabled == NULL) { return JVMTI_ERROR_NULL_POINTER; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/methodHandles.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/methodHandles.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/methodHandles.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/methodHandles.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -999,7 +999,7 @@ if (!java_lang_invoke_MemberName::is_instance(result())) return -99; // caller bug! oop saved = MethodHandles::init_field_MemberName(result, st.field_descriptor()); - if (!oopDesc::equals(saved, result())) + if (saved != result()) results->obj_at_put(rfill-1, saved); // show saved instance to user } else if (++overflow >= overflow_limit) { match_flags = 0; break; // got tired of looking at overflow @@ -1051,7 +1051,7 @@ return -99; // caller bug! CallInfo info(m, NULL, CHECK_0); oop saved = MethodHandles::init_method_MemberName(result, info); - if (!oopDesc::equals(saved, result())) + if (saved != result()) results->obj_at_put(rfill-1, saved); // show saved instance to user } else if (++overflow >= overflow_limit) { match_flags = 0; break; // got tired of looking at overflow diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/resolvedMethodTable.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/resolvedMethodTable.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/resolvedMethodTable.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/resolvedMethodTable.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/classLoaderData.hpp" #include "classfile/javaClasses.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" @@ -78,7 +79,8 @@ } unsigned int ResolvedMethodTable::compute_hash(Method* method) { - unsigned int hash = method->klass_name()->identity_hash(); + unsigned int hash = method->method_holder()->class_loader_data()->identity_hash(); + hash = (hash * 31) ^ method->klass_name()->identity_hash(); hash = (hash * 31) ^ method->name()->identity_hash(); hash = (hash * 31) ^ method->signature()->identity_hash(); return hash; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/stackwalk.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/stackwalk.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/stackwalk.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/stackwalk.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -48,7 +48,7 @@ bool BaseFrameStream::check_magic(objArrayHandle frames_array) { oop m1 = frames_array->obj_at(magic_pos); jlong m2 = _anchor; - if (oopDesc::equals(m1, _thread->threadObj()) && m2 == address_value()) return true; + if (m1 == _thread->threadObj() && m2 == address_value()) return true; return false; } @@ -79,7 +79,7 @@ { assert(thread != NULL && thread->is_Java_thread(), ""); oop m1 = frames_array->obj_at(magic_pos); - if (!oopDesc::equals(m1, thread->threadObj())) return NULL; + if (m1 != thread->threadObj()) return NULL; if (magic == 0L) return NULL; BaseFrameStream* stream = (BaseFrameStream*) (intptr_t) magic; if (!stream->is_valid_in(thread, frames_array)) return NULL; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/unsafe.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/unsafe.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/unsafe.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/unsafe.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -901,7 +901,7 @@ oop p = JNIHandles::resolve(obj); assert_field_offset_sane(p, offset); oop ret = HeapAccess::oop_atomic_cmpxchg_at(x, p, (ptrdiff_t)offset, e); - return oopDesc::equals(ret, e); + return ret == e; } UNSAFE_END UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetInt(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jint e, jint x)) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/prims/whitebox.cpp openjdk-11-11.0.13+8/src/hotspot/share/prims/whitebox.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/prims/whitebox.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/prims/whitebox.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -1550,7 +1550,7 @@ oop class_loader_oop = JNIHandles::resolve(class_loader); ClassLoaderData* cld = class_loader_oop != NULL - ? java_lang_ClassLoader::loader_data(class_loader_oop) + ? java_lang_ClassLoader::loader_data_acquire(class_loader_oop) : ClassLoaderData::the_null_class_loader_data(); void* metadata = MetadataFactory::new_array(cld, WhiteBox::array_bytes_to_length((size_t)size), thread); @@ -1561,7 +1561,7 @@ WB_ENTRY(void, WB_FreeMetaspace(JNIEnv* env, jobject wb, jobject class_loader, jlong addr, jlong size)) oop class_loader_oop = JNIHandles::resolve(class_loader); ClassLoaderData* cld = class_loader_oop != NULL - ? java_lang_ClassLoader::loader_data(class_loader_oop) + ? java_lang_ClassLoader::loader_data_acquire(class_loader_oop) : ClassLoaderData::the_null_class_loader_data(); MetadataFactory::free_array(cld, (Array*)(uintptr_t)addr); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/arguments.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/arguments.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/arguments.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/arguments.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -3138,6 +3138,11 @@ set_mode_flags(_int); } +#ifdef ZERO + // Zero always runs in interpreted mode + set_mode_flags(_int); +#endif + // eventually fix up InitialTenuringThreshold if only MaxTenuringThreshold is set if (FLAG_IS_DEFAULT(InitialTenuringThreshold) && (InitialTenuringThreshold > MaxTenuringThreshold)) { FLAG_SET_ERGO(uintx, InitialTenuringThreshold, MaxTenuringThreshold); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/biasedLocking.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/biasedLocking.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/biasedLocking.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/biasedLocking.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -257,7 +257,7 @@ BasicLock* highest_lock = NULL; for (int i = 0; i < cached_monitor_info->length(); i++) { MonitorInfo* mon_info = cached_monitor_info->at(i); - if (oopDesc::equals(mon_info->owner(), obj)) { + if (mon_info->owner() == obj) { log_trace(biasedlocking)(" mon_info->owner (" PTR_FORMAT ") == obj (" PTR_FORMAT ")", p2i((void *) mon_info->owner()), p2i((void *) obj)); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/handles.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/handles.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/handles.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/handles.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -78,8 +78,8 @@ oop operator () () const { return obj(); } oop operator -> () const { return non_null_obj(); } - bool operator == (oop o) const { return oopDesc::equals(obj(), o); } - bool operator == (const Handle& h) const { return oopDesc::equals(obj(), h.obj()); } + bool operator == (oop o) const { return obj() == o; } + bool operator == (const Handle& h) const { return obj() == h.obj(); } // Null checks bool is_null() const { return _handle == NULL; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/javaCalls.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/javaCalls.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/javaCalls.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/javaCalls.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -349,9 +349,6 @@ assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation"); assert(!thread->handle_area()->no_handle_mark_active(), "cannot call out to Java here"); - - CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();) - #if INCLUDE_JVMCI // Gets the nmethod (if any) that should be called instead of normal target nmethod* alternative_target = args->alternative_target(); @@ -398,10 +395,6 @@ BasicType result_type = runtime_type_from(result); bool oop_result_flag = (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY); - // NOTE: if we move the computation of the result_val_address inside - // the call to call_stub, the optimizer produces wrong code. - intptr_t* result_val_address = (intptr_t*)(result->get_value_addr()); - // Find receiver Handle receiver = (!method->is_static()) ? args->receiver() : Handle(); @@ -439,6 +432,11 @@ { JavaCallWrapper link(method, receiver, result, CHECK); { HandleMark hm(thread); // HandleMark used by HandleMarkCleaner + // NOTE: if we move the computation of the result_val_address inside + // the call to call_stub, the optimizer produces wrong code. + intptr_t* result_val_address = (intptr_t*)(result->get_value_addr()); + intptr_t* parameter_address = args->parameters(); + StubRoutines::call_stub()( (address)&link, // (intptr_t*)&(result->_value), // see NOTE above (compiler problem) @@ -446,7 +444,7 @@ result_type, method(), entry_point, - args->parameters(), + parameter_address, args->size_of_parameters(), CHECK ); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/jniHandles.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/jniHandles.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/jniHandles.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/jniHandles.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -84,7 +84,7 @@ inline bool JNIHandles::is_same_object(jobject handle1, jobject handle2) { oop obj1 = resolve_no_keepalive(handle1); oop obj2 = resolve_no_keepalive(handle2); - return oopDesc::equals(obj1, obj2); + return obj1 == obj2; } inline oop JNIHandles::resolve_non_null(jobject handle) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/mutexLocker.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/mutexLocker.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/mutexLocker.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/mutexLocker.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -105,7 +105,7 @@ Mutex* ProfilePrint_lock = NULL; Mutex* ExceptionCache_lock = NULL; Mutex* OsrList_lock = NULL; - +Mutex* NMethodSweeperStats_lock = NULL; #ifndef PRODUCT Mutex* FullGCALot_lock = NULL; #endif @@ -139,6 +139,7 @@ Monitor* JfrMsg_lock = NULL; Mutex* JfrBuffer_lock = NULL; Mutex* JfrStream_lock = NULL; +Monitor* JfrThreadSampler_lock = NULL; #endif #ifndef SUPPORTS_NATIVE_CX8 @@ -147,7 +148,11 @@ Monitor* CodeHeapStateAnalytics_lock = NULL; Mutex* MetaspaceExpand_lock = NULL; +Mutex* ClassLoaderDataGraph_lock = NULL; Mutex* ThreadIdTableCreate_lock = NULL; +Monitor* ThreadsSMRDelete_lock = NULL; +Mutex* SharedDecoder_lock = NULL; +Mutex* DCmdFactory_lock = NULL; #define MAX_NUM_MUTEX 128 static Monitor * _mutex_array[MAX_NUM_MUTEX]; @@ -235,13 +240,14 @@ def(OopMapCacheAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for oop_map_cache allocation. def(MetaspaceExpand_lock , PaddedMutex , leaf-1, true, Monitor::_safepoint_check_never); + def(ClassLoaderDataGraph_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_always); def(Patching_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); // used for safepointing and code patching. def(Service_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // used for service thread operations def(JmethodIdCreation_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never); // used for creating jmethodIDs. def(SystemDictionary_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_always); // lookups done by VM thread - def(SharedDictionary_lock , PaddedMutex, leaf, true, Monitor::_safepoint_check_always); // lookups done by VM thread + def(SharedDictionary_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // lookups done by VM thread def(Module_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_always); def(InlineCacheBuffer_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); def(VMStatistic_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); @@ -323,6 +329,7 @@ def(JfrBuffer_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never); def(JfrStream_lock , PaddedMutex , leaf+1, true, Monitor::_safepoint_check_never); // ensure to rank lower than 'safepoint' def(JfrStacktrace_lock , PaddedMutex , special, true, Monitor::_safepoint_check_sometimes); + def(JfrThreadSampler_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never); #endif #ifndef SUPPORTS_NATIVE_CX8 @@ -331,6 +338,11 @@ def(CodeHeapStateAnalytics_lock , PaddedMutex , nonleaf+6, false, Monitor::_safepoint_check_always); def(ThreadIdTableCreate_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); + + def(NMethodSweeperStats_lock , PaddedMutex , special, true, Monitor::_safepoint_check_sometimes); + def(ThreadsSMRDelete_lock , PaddedMonitor, special, false, Monitor::_safepoint_check_never); + def(SharedDecoder_lock , PaddedMutex , native, false, Monitor::_safepoint_check_never); + def(DCmdFactory_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never); } GCMutexLocker::GCMutexLocker(Monitor * mutex) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/mutexLocker.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/mutexLocker.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/mutexLocker.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/mutexLocker.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -109,6 +109,7 @@ extern Mutex* ProfilePrint_lock; // a lock used to serialize the printing of profiles extern Mutex* ExceptionCache_lock; // a lock used to synchronize exception cache updates extern Mutex* OsrList_lock; // a lock used to serialize access to OSR queues +extern Mutex* NMethodSweeperStats_lock; // a lock used to serialize access to sweeper statistics #ifndef PRODUCT extern Mutex* FullGCALot_lock; // a lock to make FullGCALot MT safe @@ -134,11 +135,15 @@ extern Monitor* RedefineClasses_lock; // locks classes from parallel redefinition extern Mutex* ThreadHeapSampler_lock; // protects the static data for initialization. +extern Monitor* ThreadsSMRDelete_lock; // Used by ThreadsSMRSupport to take pressure off the Threads_lock +extern Mutex* SharedDecoder_lock; // serializes access to the decoder during normal (not error reporting) use +extern Mutex* DCmdFactory_lock; // serialize access to DCmdFactory information #if INCLUDE_JFR extern Mutex* JfrStacktrace_lock; // used to guard access to the JFR stacktrace table extern Monitor* JfrMsg_lock; // protects JFR messaging extern Mutex* JfrBuffer_lock; // protects JFR buffer operations extern Mutex* JfrStream_lock; // protects JFR stream access +extern Monitor* JfrThreadSampler_lock; // used to suspend/resume JFR thread sampler #endif #ifndef SUPPORTS_NATIVE_CX8 @@ -146,7 +151,7 @@ #endif extern Mutex* MetaspaceExpand_lock; // protects Metaspace virtualspace and chunk expansions - +extern Mutex* ClassLoaderDataGraph_lock; // protects CLDG list, needed for concurrent unloading extern Monitor* CodeHeapStateAnalytics_lock; // lock print functions against concurrent analyze functions. // Only used locally in PrintCodeCacheLayout processing. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/os.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/os.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/os.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/os.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -359,11 +359,33 @@ switch (sig) { case SIGBREAK: { +#if INCLUDE_SERVICES // Check if the signal is a trigger to start the Attach Listener - in that // case don't print stack traces. - if (!DisableAttachMechanism && AttachListener::is_init_trigger()) { - continue; + if (!DisableAttachMechanism) { + // Attempt to transit state to AL_INITIALIZING. + AttachListenerState cur_state = AttachListener::transit_state(AL_INITIALIZING, AL_NOT_INITIALIZED); + if (cur_state == AL_INITIALIZING) { + // Attach Listener has been started to initialize. Ignore this signal. + continue; + } else if (cur_state == AL_NOT_INITIALIZED) { + // Start to initialize. + if (AttachListener::is_init_trigger()) { + // Attach Listener has been initialized. + // Accept subsequent request. + continue; + } else { + // Attach Listener could not be started. + // So we need to transit the state to AL_NOT_INITIALIZED. + AttachListener::set_state(AL_NOT_INITIALIZED); + } + } else if (AttachListener::check_socket_file()) { + // Attach Listener has been started, but unix domain socket file + // does not exist. So restart Attach Listener. + continue; + } } +#endif // Print stack traces // Any SIGBREAK operations added here should make sure to flush // the output stream (e.g. tty->flush()) after output. See 4803766. diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/reflection.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/reflection.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/reflection.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/reflection.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -420,7 +420,7 @@ assert(lower_dim->is_array_klass(), "just checking"); result2 = lower_dim->java_mirror(); } - assert(oopDesc::equals(result, result2), "results must be consistent"); + assert(result == result2, "results must be consistent"); #endif //ASSERT return result; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepoint.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepoint.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepoint.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepoint.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1192,6 +1192,7 @@ if( nm->is_at_poll_return(real_return_addr) ) { // See if return type is an oop. bool return_oop = nm->method()->is_returning_oop(); + HandleMark hm(thread()); Handle return_value; if (return_oop) { // The oop result has been saved on the stack together with all diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepointMechanism.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepointMechanism.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -83,6 +83,16 @@ } } +void SafepointMechanism::block_if_requested_slow(JavaThread *thread) { + // local poll already checked, if used. + if (global_poll()) { + SafepointSynchronize::block(thread); + } + if (uses_thread_local_poll() && thread->has_handshake()) { + thread->handshake_process_by_self(); + } +} + void SafepointMechanism::initialize_header(JavaThread* thread) { disarm_local_poll(thread); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepointMechanism.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepointMechanism.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -49,7 +49,7 @@ static inline bool local_poll(Thread* thread); static inline bool global_poll(); - static inline void block_if_requested_local_poll(JavaThread *thread); + static void block_if_requested_slow(JavaThread *thread); static void default_initialize(); static void initialize_serialize_page(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepointMechanism.inline.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.inline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/safepointMechanism.inline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/safepointMechanism.inline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -55,28 +55,11 @@ } } -void SafepointMechanism::block_if_requested_local_poll(JavaThread *thread) { - bool armed = local_poll_armed(thread); // load acquire, polling page -> op / global state - if(armed) { - // We could be armed for either a handshake operation or a safepoint - if (global_poll()) { - SafepointSynchronize::block(thread); - } - if (thread->has_handshake()) { - thread->handshake_process_by_self(); - } - } -} - void SafepointMechanism::block_if_requested(JavaThread *thread) { - if (uses_thread_local_poll()) { - block_if_requested_local_poll(thread); - } else { - // If we don't have per thread poll this could a handshake or a safepoint - if (global_poll()) { - SafepointSynchronize::block(thread); - } + if (uses_thread_local_poll() && !SafepointMechanism::local_poll_armed(thread)) { + return; } + block_if_requested_slow(thread); } void SafepointMechanism::arm_local_poll(JavaThread* thread) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/sweeper.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/sweeper.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/sweeper.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/sweeper.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -160,8 +160,6 @@ Tickspan NMethodSweeper::_peak_sweep_time; // Peak time for a full sweep Tickspan NMethodSweeper::_peak_sweep_fraction_time; // Peak time sweeping one fraction -Monitor* NMethodSweeper::_stat_lock = new Monitor(Mutex::special, "Sweeper::Statistics", true, Monitor::_safepoint_check_sometimes); - class MarkActivationClosure: public CodeBlobClosure { public: virtual void do_code_blob(CodeBlob* cb) { @@ -505,7 +503,7 @@ const Ticks sweep_end_counter = Ticks::now(); const Tickspan sweep_time = sweep_end_counter - sweep_start_counter; { - MutexLockerEx mu(_stat_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx mu(NMethodSweeperStats_lock, Mutex::_no_safepoint_check_flag); _total_time_sweeping += sweep_time; _total_time_this_sweep += sweep_time; _peak_sweep_fraction_time = MAX2(sweep_time, _peak_sweep_fraction_time); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/sweeper.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/sweeper.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/sweeper.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/sweeper.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -88,8 +88,6 @@ static Tickspan _peak_sweep_time; // Peak time for a full sweep static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction - static Monitor* _stat_lock; - static MethodStateChange process_compiled_method(CompiledMethod *nm); static void init_sweeper_log() NOT_DEBUG_RETURN; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/synchronizer.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/synchronizer.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/synchronizer.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/synchronizer.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -168,7 +168,7 @@ if (mark->has_monitor()) { ObjectMonitor * const mon = mark->monitor(); - assert(oopDesc::equals((oop) mon->object(), obj), "invariant"); + assert(mon->object() == obj, "invariant"); if (mon->owner() != self) return false; // slow-path for IMS exception if (mon->first_waiter() != NULL) { @@ -212,7 +212,7 @@ if (mark->has_monitor()) { ObjectMonitor * const m = mark->monitor(); - assert(oopDesc::equals((oop) m->object(), obj), "invariant"); + assert(m->object() == obj, "invariant"); Thread * const owner = (Thread *) m->_owner; // Lock contention and Transactional Lock Elision (TLE) diagnostics @@ -1410,7 +1410,7 @@ if (mark->has_monitor()) { ObjectMonitor * inf = mark->monitor(); assert(inf->header()->is_neutral(), "invariant"); - assert(oopDesc::equals((oop) inf->object(), object), "invariant"); + assert(inf->object() == object, "invariant"); assert(ObjectSynchronizer::verify_objmon_isinpool(inf), "monitor is invalid"); return inf; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/thread.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/thread.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/thread.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/thread.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1622,6 +1622,9 @@ _adjusting_comp_level = false; _jvmci._alternate_call_target = NULL; assert(_jvmci._implicit_exception_pc == NULL, "must be"); + _jvmci_reserved0 = NULL; + _jvmci_reserved1 = NULL; + _jvmci_reserved_oop0 = NULL; if (JVMCICounterSize > 0) { _jvmci_counters = NEW_C_HEAP_ARRAY(jlong, JVMCICounterSize, mtInternal); memset(_jvmci_counters, 0, sizeof(jlong) * JVMCICounterSize); @@ -2923,6 +2926,9 @@ f->do_oop((oop*) &_vm_result); f->do_oop((oop*) &_exception_oop); f->do_oop((oop*) &_pending_async_exception); +#if INCLUDE_JVMCI + f->do_oop((oop*) &_jvmci_reserved_oop0); +#endif if (jvmti_thread_state() != NULL) { jvmti_thread_state()->oops_do(f, cf); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/thread.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/thread.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/thread.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/thread.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1083,6 +1083,11 @@ // Support for high precision, thread sensitive counters in JVMCI compiled code. jlong* _jvmci_counters; + // Fast thread locals for use by JVMCI + intptr_t* _jvmci_reserved0; + intptr_t* _jvmci_reserved1; + oop _jvmci_reserved_oop0; + public: static jlong* _jvmci_old_thread_counters; static void collect_counters(typeArrayOop array); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/threadSMR.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/threadSMR.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/threadSMR.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/threadSMR.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -38,10 +38,6 @@ #include "utilities/resourceHash.hpp" #include "utilities/vmError.hpp" -Monitor* ThreadsSMRSupport::_delete_lock = - new Monitor(Monitor::special, "Thread_SMR_delete_lock", - false /* allow_vm_block */, - Monitor::_safepoint_check_never); // The '_cnt', '_max' and '_times" fields are enabled via // -XX:+EnableThreadSMRStatistics: diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/threadSMR.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/threadSMR.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/threadSMR.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/threadSMR.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -91,7 +91,8 @@ // The coordination between ThreadsSMRSupport::release_stable_list() and // ThreadsSMRSupport::smr_delete() uses the delete_lock in order to // reduce the traffic on the Threads_lock. - static Monitor* _delete_lock; + static Monitor* delete_lock() { return ThreadsSMRDelete_lock; } + // The '_cnt', '_max' and '_times" fields are enabled via // -XX:+EnableThreadSMRStatistics (see thread.cpp for a // description about each field): @@ -121,7 +122,6 @@ static void add_deleted_thread_times(uint add_value); static void add_tlh_times(uint add_value); static void clear_delete_notify(); - static Monitor* delete_lock() { return _delete_lock; } static bool delete_notify(); static void free_list(ThreadsList* threads); static void inc_deleted_thread_cnt(); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/unhandledOops.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/unhandledOops.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/unhandledOops.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/unhandledOops.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -56,18 +56,18 @@ // For debugging unhandled oop detector _in the debugger_ // You don't want to turn it on in compiled code here. -static bool unhandled_oop_print=0; +static Thread* unhandled_oop_print = NULL; -void UnhandledOops::register_unhandled_oop(oop* op, address pc) { +void UnhandledOops::register_unhandled_oop(oop* op) { if (!_thread->is_in_stack((address)op)) return; - _level ++; - if (unhandled_oop_print) { - for (int i=0; i<_level; i++) tty->print(" "); + _level++; + if (unhandled_oop_print == _thread) { + for (int i=0; i < _level; i++) tty->print(" "); tty->print_cr("r " INTPTR_FORMAT, p2i(op)); } - UnhandledOopEntry entry(op, pc); + UnhandledOopEntry entry(op); _oop_list->push(entry); } @@ -99,11 +99,11 @@ void UnhandledOops::unregister_unhandled_oop(oop* op) { if (!_thread->is_in_stack((address)op)) return; - _level --; - if (unhandled_oop_print) { - for (int i=0; i<_level; i++) tty->print(" "); + if (unhandled_oop_print == _thread) { + for (int i=0; i < _level; i++) tty->print(" "); tty->print_cr("u " INTPTR_FORMAT, p2i(op)); } + _level--; int i = _oop_list->find_from_end(op, match_oop_entry); assert(i!=-1, "oop not in unhandled_oop_list"); @@ -120,8 +120,7 @@ // in the unhandled oop generator. if(!_thread->is_in_stack((address)entry._oop_ptr)) { tty->print_cr("oop_ptr is " INTPTR_FORMAT, p2i(entry._oop_ptr)); - tty->print_cr("thread is " INTPTR_FORMAT " from pc " INTPTR_FORMAT, - p2i(_thread), p2i(entry._pc)); + tty->print_cr("thread is " INTPTR_FORMAT, p2i(_thread)); assert(false, "heap is corrupted by the unhandled oop detector"); } // Set unhandled oops to a pattern that will crash distinctively diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/unhandledOops.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/unhandledOops.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/unhandledOops.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/unhandledOops.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -53,12 +53,11 @@ private: oop* _oop_ptr; bool _ok_for_gc; - address _pc; public: oop* oop_ptr() { return _oop_ptr; } - UnhandledOopEntry() : _oop_ptr(NULL), _ok_for_gc(false), _pc(NULL) {} - UnhandledOopEntry(oop* op, address pc) : - _oop_ptr(op), _ok_for_gc(false), _pc(pc) {} + UnhandledOopEntry() : _oop_ptr(NULL), _ok_for_gc(false) {} + UnhandledOopEntry(oop* op) : + _oop_ptr(op), _ok_for_gc(false) {} }; @@ -75,7 +74,7 @@ public: static void dump_oops(UnhandledOops* list); - void register_unhandled_oop(oop* op, address pc); + void register_unhandled_oop(oop* op); void unregister_unhandled_oop(oop* op); }; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/vframe.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/vframe.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/vframe.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/vframe.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -59,6 +59,14 @@ _fr = *fr; } +vframe* vframe::new_vframe(StackFrameStream& fst, JavaThread* thread) { + if (fst.current()->is_runtime_frame()) { + fst.next(); + } + guarantee(!fst.is_done(), "missing caller"); + return new_vframe(fst.current(), fst.register_map(), thread); +} + vframe* vframe::new_vframe(const frame* f, const RegisterMap* reg_map, JavaThread* thread) { // Interpreter frame if (f->is_interpreted_frame()) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/vframe.hpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/vframe.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/vframe.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/vframe.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -60,8 +60,9 @@ vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread); vframe(const frame* fr, JavaThread* thread); public: - // Factory method for creating vframes + // Factory methods for creating vframes static vframe* new_vframe(const frame* f, const RegisterMap *reg_map, JavaThread* thread); + static vframe* new_vframe(StackFrameStream& fst, JavaThread* thread); // Accessors frame fr() const { return _fr; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/runtime/vmStructs.cpp openjdk-11-11.0.13+8/src/hotspot/share/runtime/vmStructs.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/runtime/vmStructs.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/runtime/vmStructs.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1982,8 +1982,8 @@ declare_integer_type(AccessFlags) /* FIXME: wrong type (not integer) */\ declare_toplevel_type(address) /* FIXME: should this be an integer type? */\ declare_integer_type(BasicType) /* FIXME: wrong type (not integer) */\ - declare_toplevel_type(BreakpointInfo) \ - declare_toplevel_type(BreakpointInfo*) \ + JVMTI_ONLY(declare_toplevel_type(BreakpointInfo)) \ + JVMTI_ONLY(declare_toplevel_type(BreakpointInfo*)) \ declare_toplevel_type(CodeBlob*) \ declare_toplevel_type(RuntimeBlob*) \ declare_toplevel_type(CompressedWriteStream*) \ diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/attachListener.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/attachListener.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/attachListener.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/attachListener.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -44,7 +44,7 @@ #include "utilities/debug.hpp" #include "utilities/formatBuffer.hpp" -volatile bool AttachListener::_initialized; +volatile AttachListenerState AttachListener::_state = AL_NOT_INITIALIZED; // Implementation of "properties" command. // @@ -236,19 +236,7 @@ // This helps reduces the amount of unreachable objects in the dump // and makes it easier to browse. HeapDumper dumper(live_objects_only /* request GC */); - int res = dumper.dump(op->arg(0)); - if (res == 0) { - out->print_cr("Heap dump file created"); - } else { - // heap dump failed - ResourceMark rm; - char* error = dumper.error_as_C_string(); - if (error == NULL) { - out->print_cr("Dump failed - reason unknown"); - } else { - out->print_cr("%s", error); - } - } + dumper.dump(op->arg(0), out); } return JNI_OK; } @@ -348,6 +336,7 @@ "Should already be setup"); if (AttachListener::pd_init() != 0) { + AttachListener::set_state(AL_NOT_INITIALIZED); return; } AttachListener::set_initialized(); @@ -355,6 +344,7 @@ for (;;) { AttachOperation* op = AttachListener::dequeue(); if (op == NULL) { + AttachListener::set_state(AL_NOT_INITIALIZED); return; // dequeue failed or shutdown } @@ -398,6 +388,8 @@ // operation complete - send result and output to client op->complete(res, &st); } + + ShouldNotReachHere(); } bool AttachListener::has_init_error(TRAPS) { @@ -421,6 +413,7 @@ const char thread_name[] = "Attach Listener"; Handle string = java_lang_String::create_from_str(thread_name, THREAD); if (has_init_error(THREAD)) { + set_state(AL_NOT_INITIALIZED); return; } @@ -432,6 +425,7 @@ string, THREAD); if (has_init_error(THREAD)) { + set_state(AL_NOT_INITIALIZED); return; } @@ -445,6 +439,7 @@ thread_oop, THREAD); if (has_init_error(THREAD)) { + set_state(AL_NOT_INITIALIZED); return; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/attachListener.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/attachListener.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/attachListener.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/attachListener.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -26,6 +26,8 @@ #define SHARE_VM_SERVICES_ATTACHLISTENER_HPP #include "memory/allocation.hpp" +#include "metaprogramming/isRegisteredEnum.hpp" +#include "runtime/atomic.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" @@ -49,6 +51,14 @@ AttachOperationFunction func; }; +enum AttachListenerState { + AL_NOT_INITIALIZED, + AL_INITIALIZING, + AL_INITIALIZED +}; + +template<> struct IsRegisteredEnum : public TrueType {}; + class AttachListener: AllStatic { public: static void vm_start() NOT_SERVICES_RETURN; @@ -58,6 +68,9 @@ // invoke to perform clean-up tasks when all clients detach static void detachall() NOT_SERVICES_RETURN; + // check unix domain socket file on filesystem + static bool check_socket_file() NOT_SERVICES_RETURN_(false); + // indicates if the Attach Listener needs to be created at startup static bool init_at_startup() NOT_SERVICES_RETURN_(false); @@ -67,12 +80,31 @@ #if !INCLUDE_SERVICES static bool is_attach_supported() { return false; } #else + private: - static volatile bool _initialized; + static volatile AttachListenerState _state; public: - static bool is_initialized() { return _initialized; } - static void set_initialized() { _initialized = true; } + static void set_state(AttachListenerState new_state) { + Atomic::store(new_state, &_state); + } + + static AttachListenerState get_state() { + return Atomic::load(&_state); + } + + static AttachListenerState transit_state(AttachListenerState new_state, + AttachListenerState cmp_state) { + return Atomic::cmpxchg(new_state, &_state, cmp_state); + } + + static bool is_initialized() { + return Atomic::load(&_state) == AL_INITIALIZED; + } + + static void set_initialized() { + Atomic::store(AL_INITIALIZED, &_state); + } // indicates if this VM supports attach-on-demand static bool is_attach_supported() { return !DisableAttachMechanism; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticCommand.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticCommand.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticCommand.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticCommand.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -299,6 +299,7 @@ } #if INCLUDE_SERVICES +#if INCLUDE_JVMTI JVMTIAgentLoadDCmd::JVMTIAgentLoadDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), _libpath("library path", "Absolute path of the JVMTI agent to load.", @@ -358,6 +359,7 @@ return 0; } } +#endif // INCLUDE_JVMTI #endif // INCLUDE_SERVICES void PrintSystemPropertiesDCmd::execute(DCmdSource source, TRAPS) { @@ -504,9 +506,12 @@ DCmdWithParser(output, heap), _filename("filename","Name of the dump file", "STRING",true), _all("-all", "Dump all objects, including unreachable objects", - "BOOLEAN", false, "false") { + "BOOLEAN", false, "false"), + _overwrite("-overwrite", "If specified, the dump file will be overwritten if it exists", + "BOOLEAN", false, "false") { _dcmdparser.add_dcmd_option(&_all); _dcmdparser.add_dcmd_argument(&_filename); + _dcmdparser.add_dcmd_option(&_overwrite); } void HeapDumpDCmd::execute(DCmdSource source, TRAPS) { @@ -514,19 +519,7 @@ // This helps reduces the amount of unreachable objects in the dump // and makes it easier to browse. HeapDumper dumper(!_all.value() /* request GC if _all is false*/); - int res = dumper.dump(_filename.value()); - if (res == 0) { - output()->print_cr("Heap dump file created"); - } else { - // heap dump failed - ResourceMark rm; - char* error = dumper.error_as_C_string(); - if (error == NULL) { - output()->print_cr("Dump failed - reason unknown"); - } else { - output()->print_cr("%s", error); - } - } + dumper.dump(_filename.value(), output(), _overwrite.value()); } int HeapDumpDCmd::num_arguments() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticCommand.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticCommand.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticCommand.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticCommand.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -331,6 +331,7 @@ protected: DCmdArgument _filename; DCmdArgument _all; + DCmdArgument _overwrite; public: HeapDumpDCmd(outputStream* output, bool heap); static const char* name() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticFramework.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticFramework.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticFramework.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticFramework.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -491,11 +491,10 @@ } } -Mutex* DCmdFactory::_dcmdFactory_lock = new Mutex(Mutex::leaf, "DCmdFactory", true, Monitor::_safepoint_check_never); bool DCmdFactory::_send_jmx_notification = false; DCmdFactory* DCmdFactory::factory(DCmdSource source, const char* name, size_t len) { - MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag); DCmdFactory* factory = _DCmdFactoryList; while (factory != NULL) { if (strlen(factory->name()) == len && @@ -512,7 +511,7 @@ } int DCmdFactory::register_DCmdFactory(DCmdFactory* factory) { - MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag); factory->_next = _DCmdFactoryList; _DCmdFactoryList = factory; if (_send_jmx_notification && !factory->_hidden @@ -537,7 +536,7 @@ } GrowableArray* DCmdFactory::DCmd_list(DCmdSource source) { - MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag); GrowableArray* array = new GrowableArray(); DCmdFactory* factory = _DCmdFactoryList; while (factory != NULL) { @@ -550,7 +549,7 @@ } GrowableArray* DCmdFactory::DCmdInfo_list(DCmdSource source ) { - MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag); GrowableArray* array = new GrowableArray(); DCmdFactory* factory = _DCmdFactoryList; while (factory != NULL) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticFramework.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticFramework.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/diagnosticFramework.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/diagnosticFramework.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -344,7 +344,6 @@ // management.cpp) class DCmdFactory: public CHeapObj { private: - static Mutex* _dcmdFactory_lock; static bool _send_jmx_notification; static bool _has_pending_jmx_notification; static DCmdFactory* _DCmdFactoryList; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/gcNotifier.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/gcNotifier.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/gcNotifier.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/gcNotifier.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -159,7 +159,7 @@ gcInfoklass, vmSymbols::com_sun_management_GcInfo_constructor_signature(), &constructor_args, - CHECK_NH); + THREAD); } void GCNotifier::sendNotification(TRAPS) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/heapDumper.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/heapDumper.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/heapDumper.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/heapDumper.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -378,7 +378,9 @@ class DumpWriter : public StackObj { private: enum { - io_buffer_size = 8*M + io_buffer_max_size = 8*M, + io_buffer_min_size = 64*K, + dump_segment_header_size = 9 }; int _fd; // file descriptor (-1 if dump file not open) @@ -388,13 +390,19 @@ size_t _size; size_t _pos; - jlong _dump_start; + bool _in_dump_segment; // Are we currently in a dump segment? + bool _is_huge_sub_record; // Are we writing a sub-record larger than the buffer size? + DEBUG_ONLY(size_t _sub_record_left;) // The bytes not written for the current sub-record. + DEBUG_ONLY(bool _sub_record_ended;) // True if we have called the end_sub_record(). char* _error; // error message when I/O fails void set_file_descriptor(int fd) { _fd = fd; } int file_descriptor() const { return _fd; } + bool is_open() const { return file_descriptor() >= 0; } + void flush(); + char* buffer() const { return _buffer; } size_t buffer_size() const { return _size; } size_t position() const { return _pos; } @@ -406,32 +414,16 @@ void write_internal(void* s, size_t len); public: - DumpWriter(const char* path); + DumpWriter(const char* path, bool overwrite); ~DumpWriter(); void close(); - bool is_open() const { return file_descriptor() >= 0; } - void flush(); - - jlong dump_start() const { return _dump_start; } - void set_dump_start(jlong pos); - julong current_record_length(); // total number of bytes written to the disk julong bytes_written() const { return _bytes_written; } - // adjust the number of bytes written to disk (used to keep the count - // of the number of bytes written in case of rewrites) - void adjust_bytes_written(jlong n) { _bytes_written += n; } - - // number of (buffered) bytes as yet unwritten to the dump file - size_t bytes_unwritten() const { return position(); } - char* error() const { return _error; } - jlong current_offset(); - void seek_to_offset(jlong pos); - // writer functions void write_raw(void* s, size_t len); void write_u1(u1 x) { write_raw((void*)&x, 1); } @@ -442,38 +434,43 @@ void write_symbolID(Symbol* o); void write_classID(Klass* k); void write_id(u4 x); + + // Start a new sub-record. Starts a new heap dump segment if needed. + void start_sub_record(u1 tag, u4 len); + // Ends the current sub-record. + void end_sub_record(); + // Finishes the current dump segment if not already finished. + void finish_dump_segment(); }; -DumpWriter::DumpWriter(const char* path) { +DumpWriter::DumpWriter(const char* path, bool overwrite) : _fd(-1), _bytes_written(0), _pos(0), + _in_dump_segment(false), _error(NULL) { // try to allocate an I/O buffer of io_buffer_size. If there isn't // sufficient memory then reduce size until we can allocate something. - _size = io_buffer_size; + _size = io_buffer_max_size; do { _buffer = (char*)os::malloc(_size, mtInternal); if (_buffer == NULL) { _size = _size >> 1; } - } while (_buffer == NULL && _size > 0); - assert((_size > 0 && _buffer != NULL) || (_size == 0 && _buffer == NULL), "sanity check"); - _pos = 0; - _error = NULL; - _bytes_written = 0L; - _dump_start = (jlong)-1; - _fd = os::create_binary_file(path, false); // don't replace existing file - - // if the open failed we record the error - if (_fd < 0) { - _error = (char*)os::strdup(os::strerror(errno)); + } while (_buffer == NULL && _size >= io_buffer_min_size); + + if (_buffer == NULL) { + set_error("Could not allocate buffer memory for heap dump"); + } else { + _fd = os::create_binary_file(path, overwrite); // don't replace existing file + + // if the open failed we record the error + if (_fd < 0) { + set_error(os::strerror(errno)); + } } } DumpWriter::~DumpWriter() { - // flush and close dump file - if (is_open()) { - close(); - } - if (_buffer != NULL) os::free(_buffer); - if (_error != NULL) os::free(_error); + close(); + os::free(_buffer); + os::free(_error); } // closes dump file (if open) @@ -486,29 +483,13 @@ } } -// sets the dump starting position -void DumpWriter::set_dump_start(jlong pos) { - _dump_start = pos; -} - -julong DumpWriter::current_record_length() { - if (is_open()) { - // calculate the size of the dump record - julong dump_end = bytes_written() + bytes_unwritten(); - assert(dump_end == (size_t)current_offset(), "checking"); - julong dump_len = dump_end - dump_start() - 4; - return dump_len; - } - return 0; -} - // write directly to the file void DumpWriter::write_internal(void* s, size_t len) { if (is_open()) { const char* pos = (char*)s; ssize_t n = 0; while (len > 0) { - uint tmp = (uint)MIN2(len, (size_t)UINT_MAX); + uint tmp = (uint)MIN2(len, (size_t)INT_MAX); n = os::write(file_descriptor(), pos, tmp); if (n < 0) { @@ -528,53 +509,30 @@ // write raw bytes void DumpWriter::write_raw(void* s, size_t len) { - if (is_open()) { - // flush buffer to make room - if ((position() + len) >= buffer_size()) { - flush(); - } + assert(!_in_dump_segment || (_sub_record_left >= len), "sub-record too large"); + debug_only(_sub_record_left -= len); - // buffer not available or too big to buffer it - if ((buffer() == NULL) || (len >= buffer_size())) { + // flush buffer to make room + if (len > buffer_size() - position()) { + assert(!_in_dump_segment || _is_huge_sub_record, "Cannot overflow in non-huge sub-record."); + flush(); + + // If larger than the buffer, just write it directly. + if (len > buffer_size()) { write_internal(s, len); - } else { - // Should optimize this for u1/u2/u4/u8 sizes. - memcpy(buffer() + position(), s, len); - set_position(position() + len); + + return; } } + + memcpy(buffer() + position(), s, len); + set_position(position() + len); } // flush any buffered bytes to the file void DumpWriter::flush() { - if (is_open() && position() > 0) { - write_internal(buffer(), position()); - set_position(0); - } -} - -jlong DumpWriter::current_offset() { - if (is_open()) { - // the offset is the file offset plus whatever we have buffered - jlong offset = os::current_file_offset(file_descriptor()); - assert(offset >= 0, "lseek failed"); - return offset + position(); - } else { - return (jlong)-1; - } -} - -void DumpWriter::seek_to_offset(jlong off) { - assert(off >= 0, "bad offset"); - - // need to flush before seeking - flush(); - - // may be closed due to I/O error - if (is_open()) { - jlong n = os::seek_to_file_offset(file_descriptor(), off); - assert(n >= 0, "lseek failed"); - } + write_internal(buffer(), position()); + set_position(0); } void DumpWriter::write_u2(u2 x) { @@ -626,7 +584,58 @@ write_objectID(k->java_mirror()); } +void DumpWriter::finish_dump_segment() { + if (_in_dump_segment) { + assert(_sub_record_left == 0, "Last sub-record not written completely"); + assert(_sub_record_ended, "sub-record must have ended"); + + // Fix up the dump segment length if we haven't written a huge sub-record last + // (in which case the segment length was already set to the correct value initially). + if (!_is_huge_sub_record) { + assert(position() > dump_segment_header_size, "Dump segment should have some content"); + Bytes::put_Java_u4((address) (buffer() + 5), (u4) (position() - dump_segment_header_size)); + } + flush(); + _in_dump_segment = false; + } +} + +void DumpWriter::start_sub_record(u1 tag, u4 len) { + if (!_in_dump_segment) { + if (position() > 0) { + flush(); + assert(position() == 0, "Must be at the start"); + } + + write_u1(HPROF_HEAP_DUMP_SEGMENT); + write_u4(0); // timestamp + // Will be fixed up later if we add more sub-records. If this is a huge sub-record, + // this is already the correct length, since we don't add more sub-records. + write_u4(len); + _in_dump_segment = true; + _is_huge_sub_record = len > buffer_size() - dump_segment_header_size; + } else if (_is_huge_sub_record || (len > buffer_size() - position())) { + // This object will not fit in completely or the last sub-record was huge. + // Finish the current segement and try again. + finish_dump_segment(); + start_sub_record(tag, len); + + return; + } + + debug_only(_sub_record_left = len); + debug_only(_sub_record_ended = false); + + write_u1(tag); +} + +void DumpWriter::end_sub_record() { + assert(_in_dump_segment, "must be in dump segment"); + assert(_sub_record_left == 0, "sub-record not written completely"); + assert(!_sub_record_ended, "Must not have ended yet"); + debug_only(_sub_record_ended = true); +} // Support class with a collection of functions used when dumping the heap @@ -640,6 +649,8 @@ static hprofTag sig2tag(Symbol* sig); // returns hprof tag for the given basic type static hprofTag type2tag(BasicType type); + // Returns the size of the data to write. + static u4 sig2size(Symbol* sig); // returns the size of the instance of the given class static u4 instance_size(Klass* k); @@ -650,10 +661,14 @@ static void dump_double(DumpWriter* writer, jdouble d); // dumps the raw value of the given field static void dump_field_value(DumpWriter* writer, char type, oop obj, int offset); + // returns the size of the static fields; also counts the static fields + static u4 get_static_fields_size(InstanceKlass* ik, u2& field_count); // dumps static fields of the given class static void dump_static_fields(DumpWriter* writer, Klass* k); // dump the raw values of the instance fields of the given object static void dump_instance_fields(DumpWriter* writer, oop o); + // get the count of the instance fields for a given class + static u2 get_instance_fields_count(InstanceKlass* ik); // dumps the definition of the instance fields for a given class static void dump_instance_field_descriptors(DumpWriter* writer, Klass* k); // creates HPROF_GC_INSTANCE_DUMP record for the given object @@ -675,14 +690,18 @@ // check if we need to truncate an array static int calculate_array_max_length(DumpWriter* writer, arrayOop array, short header_size); - // writes a HPROF_HEAP_DUMP_SEGMENT record - static void write_dump_header(DumpWriter* writer); - - // fixes up the length of the current dump record - static void write_current_dump_record_length(DumpWriter* writer); - // fixes up the current dump record and writes HPROF_HEAP_DUMP_END record static void end_of_dump(DumpWriter* writer); + + static oop mask_dormant_archived_object(oop o) { + if (o != NULL && o->klass()->java_mirror() == NULL) { + // Ignore this object since the corresponding java mirror is not loaded. + // Might be a dormant archive object. + return NULL; + } else { + return o; + } + } }; // write a header of the given type @@ -723,6 +742,22 @@ } } +u4 DumperSupport::sig2size(Symbol* sig) { + switch (sig->byte_at(0)) { + case JVM_SIGNATURE_CLASS: + case JVM_SIGNATURE_ARRAY: return sizeof(address); + case JVM_SIGNATURE_BOOLEAN: + case JVM_SIGNATURE_BYTE: return 1; + case JVM_SIGNATURE_SHORT: + case JVM_SIGNATURE_CHAR: return 2; + case JVM_SIGNATURE_INT: + case JVM_SIGNATURE_FLOAT: return 4; + case JVM_SIGNATURE_LONG: + case JVM_SIGNATURE_DOUBLE: return 8; + default: ShouldNotReachHere(); /* to shut up compiler */ return 0; + } +} + // dump a jfloat void DumperSupport::dump_float(DumpWriter* writer, jfloat f) { if (g_isnan(f)) { @@ -758,6 +793,13 @@ case JVM_SIGNATURE_CLASS : case JVM_SIGNATURE_ARRAY : { oop o = obj->obj_field_access(offset); + if (o != NULL && log_is_enabled(Debug, cds, heap) && mask_dormant_archived_object(o) == NULL) { + ResourceMark rm; + log_debug(cds, heap)("skipped dormant archived object " INTPTR_FORMAT " (%s) referenced by " INTPTR_FORMAT " (%s)", + p2i(o), o->klass()->external_name(), + p2i(obj), obj->klass()->external_name()); + } + o = mask_dormant_archived_object(o); assert(oopDesc::is_oop_or_null(o), "Expected an oop or NULL at " PTR_FORMAT, p2i(o)); writer->write_objectID(o); break; @@ -818,39 +860,22 @@ for (FieldStream fld(ik, false, false); !fld.eos(); fld.next()) { if (!fld.access_flags().is_static()) { - Symbol* sig = fld.signature(); - switch (sig->byte_at(0)) { - case JVM_SIGNATURE_CLASS : - case JVM_SIGNATURE_ARRAY : size += oopSize; break; - - case JVM_SIGNATURE_BYTE : - case JVM_SIGNATURE_BOOLEAN : size += 1; break; - - case JVM_SIGNATURE_CHAR : - case JVM_SIGNATURE_SHORT : size += 2; break; - - case JVM_SIGNATURE_INT : - case JVM_SIGNATURE_FLOAT : size += 4; break; - - case JVM_SIGNATURE_LONG : - case JVM_SIGNATURE_DOUBLE : size += 8; break; - - default : ShouldNotReachHere(); - } + size += sig2size(fld.signature()); } } return size; } -// dumps static fields of the given class -void DumperSupport::dump_static_fields(DumpWriter* writer, Klass* k) { +u4 DumperSupport::get_static_fields_size(InstanceKlass* ik, u2& field_count) { HandleMark hm; - InstanceKlass* ik = InstanceKlass::cast(k); + field_count = 0; + u4 size = 0; - // pass 1 - count the static fields - u2 field_count = 0; for (FieldStream fldc(ik, true, true); !fldc.eos(); fldc.next()) { - if (fldc.access_flags().is_static()) field_count++; + if (fldc.access_flags().is_static()) { + field_count++; + size += sig2size(fldc.signature()); + } } // Add in resolved_references which is referenced by the cpCache @@ -859,12 +884,14 @@ oop resolved_references = ik->constants()->resolved_references_or_null(); if (resolved_references != NULL) { field_count++; + size += sizeof(address); // Add in the resolved_references of the used previous versions of the class // in the case of RedefineClasses InstanceKlass* prev = ik->previous_versions(); while (prev != NULL && prev->constants()->resolved_references_or_null() != NULL) { field_count++; + size += sizeof(address); prev = prev->previous_versions(); } } @@ -874,11 +901,19 @@ oop init_lock = ik->init_lock(); if (init_lock != NULL) { field_count++; + size += sizeof(address); } - writer->write_u2(field_count); + // We write the value itself plus a name and a one byte type tag per field. + return size + field_count * (sizeof(address) + 1); +} - // pass 2 - dump the field descriptors and raw values +// dumps static fields of the given class +void DumperSupport::dump_static_fields(DumpWriter* writer, Klass* k) { + HandleMark hm; + InstanceKlass* ik = InstanceKlass::cast(k); + + // dump the field descriptors and raw values for (FieldStream fld(ik, true, true); !fld.eos(); fld.next()) { if (fld.access_flags().is_static()) { Symbol* sig = fld.signature(); @@ -892,6 +927,7 @@ } // Add resolved_references for each class that has them + oop resolved_references = ik->constants()->resolved_references_or_null(); if (resolved_references != NULL) { writer->write_symbolID(vmSymbols::resolved_references_name()); // name writer->write_u1(sig2tag(vmSymbols::object_array_signature())); // type @@ -908,6 +944,7 @@ } // Add init lock to the end if the class is not yet initialized + oop init_lock = ik->init_lock(); if (init_lock != NULL) { writer->write_symbolID(vmSymbols::init_lock_name()); // name writer->write_u1(sig2tag(vmSymbols::int_array_signature())); // type @@ -929,19 +966,23 @@ } // dumps the definition of the instance fields for a given class -void DumperSupport::dump_instance_field_descriptors(DumpWriter* writer, Klass* k) { +u2 DumperSupport::get_instance_fields_count(InstanceKlass* ik) { HandleMark hm; - InstanceKlass* ik = InstanceKlass::cast(k); - - // pass 1 - count the instance fields u2 field_count = 0; + for (FieldStream fldc(ik, true, true); !fldc.eos(); fldc.next()) { if (!fldc.access_flags().is_static()) field_count++; } - writer->write_u2(field_count); + return field_count; +} - // pass 2 - dump the field descriptors +// dumps the definition of the instance fields for a given class +void DumperSupport::dump_instance_field_descriptors(DumpWriter* writer, Klass* k) { + HandleMark hm; + InstanceKlass* ik = InstanceKlass::cast(k); + + // dump the field descriptors for (FieldStream fld(ik, true, true); !fld.eos(); fld.next()) { if (!fld.access_flags().is_static()) { Symbol* sig = fld.signature(); @@ -955,24 +996,25 @@ // creates HPROF_GC_INSTANCE_DUMP record for the given object void DumperSupport::dump_instance(DumpWriter* writer, oop o) { Klass* k = o->klass(); - if (k->java_mirror() == NULL) { - // Ignoring this object since the corresponding java mirror is not loaded. - // Might be a dormant archive object. - return; - } - writer->write_u1(HPROF_GC_INSTANCE_DUMP); + InstanceKlass* ik = InstanceKlass::cast(k); + u4 is = instance_size(ik); + u4 size = 1 + sizeof(address) + 4 + sizeof(address) + 4 + is; + + writer->start_sub_record(HPROF_GC_INSTANCE_DUMP, size); writer->write_objectID(o); writer->write_u4(STACK_TRACE_ID); // class ID - writer->write_classID(k); + writer->write_classID(ik); // number of bytes that follow - writer->write_u4(instance_size(k) ); + writer->write_u4(is); // field values dump_instance_fields(writer, o); + + writer->end_sub_record(); } // creates HPROF_GC_CLASS_DUMP record for the given class and each of @@ -987,7 +1029,13 @@ return; } - writer->write_u1(HPROF_GC_CLASS_DUMP); + u2 static_fields_count = 0; + u4 static_size = get_static_fields_size(ik, static_fields_count); + u2 instance_fields_count = get_instance_fields_count(ik); + u4 instance_fields_size = instance_fields_count * (sizeof(address) + 1); + u4 size = 1 + sizeof(address) + 4 + 6 * sizeof(address) + 4 + 2 + 2 + static_size + 2 + instance_fields_size; + + writer->start_sub_record(HPROF_GC_CLASS_DUMP, size); // class ID writer->write_classID(ik); @@ -1010,29 +1058,33 @@ writer->write_objectID(oop(NULL)); // instance size - writer->write_u4(DumperSupport::instance_size(k)); + writer->write_u4(DumperSupport::instance_size(ik)); // size of constant pool - ignored by HAT 1.1 writer->write_u2(0); - // number of static fields - dump_static_fields(writer, k); + // static fields + writer->write_u2(static_fields_count); + dump_static_fields(writer, ik); // description of instance fields - dump_instance_field_descriptors(writer, k); + writer->write_u2(instance_fields_count); + dump_instance_field_descriptors(writer, ik); + + writer->end_sub_record(); // array classes - k = k->array_klass_or_null(); + k = ik->array_klass_or_null(); while (k != NULL) { - Klass* klass = k; - assert(klass->is_objArray_klass(), "not an ObjArrayKlass"); + assert(k->is_objArray_klass(), "not an ObjArrayKlass"); - writer->write_u1(HPROF_GC_CLASS_DUMP); - writer->write_classID(klass); + u4 size = 1 + sizeof(address) + 4 + 6 * sizeof(address) + 4 + 2 + 2 + 2; + writer->start_sub_record(HPROF_GC_CLASS_DUMP, size); + writer->write_classID(k); writer->write_u4(STACK_TRACE_ID); // super class of array classes is java.lang.Object - java_super = klass->java_super(); + java_super = k->java_super(); assert(java_super != NULL, "checking"); writer->write_classID(java_super); @@ -1047,8 +1099,10 @@ writer->write_u2(0); // static fields writer->write_u2(0); // instance fields + writer->end_sub_record(); + // get the array class for the next rank - k = klass->array_klass_or_null(); + k = k->array_klass_or_null(); } } @@ -1059,7 +1113,8 @@ while (k != NULL) { Klass* klass = k; - writer->write_u1(HPROF_GC_CLASS_DUMP); + u4 size = 1 + sizeof(address) + 4 + 6 * sizeof(address) + 4 + 2 + 2 + 2; + writer->start_sub_record(HPROF_GC_CLASS_DUMP, size); writer->write_classID(klass); writer->write_u4(STACK_TRACE_ID); @@ -1079,6 +1134,8 @@ writer->write_u2(0); // static fields writer->write_u2(0); // instance fields + writer->end_sub_record(); + // get the array class for the next rank k = klass->array_klass_or_null(); } @@ -1100,23 +1157,8 @@ } size_t length_in_bytes = (size_t)length * type_size; + uint max_bytes = max_juint - header_size; - // Create a new record if the current record is non-empty and the array can't fit. - julong current_record_length = writer->current_record_length(); - if (current_record_length > 0 && - (current_record_length + header_size + length_in_bytes) > max_juint) { - write_current_dump_record_length(writer); - write_dump_header(writer); - - // We now have an empty record. - current_record_length = 0; - } - - // Calculate max bytes we can use. - uint max_bytes = max_juint - (header_size + current_record_length); - - // Array too long for the record? - // Calculate max length and return it. if (length_in_bytes > max_bytes) { length = max_bytes / type_size; length_in_bytes = (size_t)length * type_size; @@ -1131,10 +1173,10 @@ void DumperSupport::dump_object_array(DumpWriter* writer, objArrayOop array) { // sizeof(u1) + 2 * sizeof(u4) + sizeof(objectID) + sizeof(classID) short header_size = 1 + 2 * 4 + 2 * sizeof(address); - int length = calculate_array_max_length(writer, array, header_size); + u4 size = header_size + length * sizeof(address); - writer->write_u1(HPROF_GC_OBJ_ARRAY_DUMP); + writer->start_sub_record(HPROF_GC_OBJ_ARRAY_DUMP, size); writer->write_objectID(array); writer->write_u4(STACK_TRACE_ID); writer->write_u4(length); @@ -1145,8 +1187,17 @@ // [id]* elements for (int index = 0; index < length; index++) { oop o = array->obj_at(index); + if (o != NULL && log_is_enabled(Debug, cds, heap) && mask_dormant_archived_object(o) == NULL) { + ResourceMark rm; + log_debug(cds, heap)("skipped dormant archived object " INTPTR_FORMAT " (%s) referenced by " INTPTR_FORMAT " (%s)", + p2i(o), o->klass()->external_name(), + p2i(array), array->klass()->external_name()); + } + o = mask_dormant_archived_object(o); writer->write_objectID(o); } + + writer->end_sub_record(); } #define WRITE_ARRAY(Array, Type, Size, Length) \ @@ -1162,8 +1213,9 @@ int length = calculate_array_max_length(writer, array, header_size); int type_size = type2aelembytes(type); u4 length_in_bytes = (u4)length * type_size; + u4 size = header_size + length_in_bytes; - writer->write_u1(HPROF_GC_PRIM_ARRAY_DUMP); + writer->start_sub_record(HPROF_GC_PRIM_ARRAY_DUMP, size); writer->write_objectID(array); writer->write_u4(STACK_TRACE_ID); writer->write_u4(length); @@ -1171,6 +1223,7 @@ // nothing to copy if (length == 0) { + writer->end_sub_record(); return; } @@ -1240,6 +1293,8 @@ } default : ShouldNotReachHere(); } + + writer->end_sub_record(); } // create a HPROF_FRAME record of the given Method* and bci @@ -1315,10 +1370,12 @@ // ignore null handles oop o = *obj_p; if (o != NULL) { - writer()->write_u1(HPROF_GC_ROOT_JNI_LOCAL); + u4 size = 1 + sizeof(address) + 4 + 4; + writer()->start_sub_record(HPROF_GC_ROOT_JNI_LOCAL, size); writer()->write_objectID(o); writer()->write_u4(_thread_serial_num); writer()->write_u4((u4)_frame_num); + writer()->end_sub_record(); } } @@ -1346,9 +1403,11 @@ // we ignore global ref to symbols and other internal objects if (o->is_instance() || o->is_objArray() || o->is_typeArray()) { - writer()->write_u1(HPROF_GC_ROOT_JNI_GLOBAL); + u4 size = 1 + 2 * sizeof(address); + writer()->start_sub_record(HPROF_GC_ROOT_JNI_GLOBAL, size); writer()->write_objectID(o); writer()->write_objectID((oopDesc*)obj_p); // global ref ID + writer()->end_sub_record(); } }; @@ -1364,8 +1423,10 @@ _writer = writer; } void do_oop(oop* obj_p) { - writer()->write_u1(HPROF_GC_ROOT_MONITOR_USED); + u4 size = 1 + sizeof(address); + writer()->start_sub_record(HPROF_GC_ROOT_MONITOR_USED, size); writer()->write_objectID(*obj_p); + writer()->end_sub_record(); } void do_oop(narrowOop* obj_p) { ShouldNotReachHere(); } }; @@ -1384,10 +1445,12 @@ void do_klass(Klass* k) { if (k->is_instance_klass()) { InstanceKlass* ik = InstanceKlass::cast(k); - writer()->write_u1(HPROF_GC_ROOT_STICKY_CLASS); - writer()->write_classID(ik); - } + u4 size = 1 + sizeof(address); + writer()->start_sub_record(HPROF_GC_ROOT_STICKY_CLASS, size); + writer()->write_classID(ik); + writer()->end_sub_record(); } + } }; @@ -1403,9 +1466,6 @@ VM_HeapDumper* dumper() { return _dumper; } DumpWriter* writer() { return _writer; } - // used to indicate that a record has been writen - void mark_end_of_record(); - public: HeapObjectDumper(VM_HeapDumper* dumper, DumpWriter* writer) { _dumper = dumper; @@ -1424,18 +1484,20 @@ } } + if (DumperSupport::mask_dormant_archived_object(o) == NULL) { + log_debug(cds, heap)("skipped dormant archived object " INTPTR_FORMAT " (%s)", p2i(o), o->klass()->external_name()); + return; + } + if (o->is_instance()) { // create a HPROF_GC_INSTANCE record for each object DumperSupport::dump_instance(writer(), o); - mark_end_of_record(); } else if (o->is_objArray()) { // create a HPROF_GC_OBJ_ARRAY_DUMP record for each object array DumperSupport::dump_object_array(writer(), objArrayOop(o)); - mark_end_of_record(); } else if (o->is_typeArray()) { // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array DumperSupport::dump_prim_array(writer(), typeArrayOop(o)); - mark_end_of_record(); } } @@ -1525,8 +1587,6 @@ } VMOp_Type type() const { return VMOp_HeapDumper; } - // used to mark sub-record boundary - void check_segment_length(); void doit(); }; @@ -1537,72 +1597,13 @@ return false; } - // writes a HPROF_HEAP_DUMP_SEGMENT record -void DumperSupport::write_dump_header(DumpWriter* writer) { - if (writer->is_open()) { - writer->write_u1(HPROF_HEAP_DUMP_SEGMENT); - writer->write_u4(0); // current ticks - - // record the starting position for the dump (its length will be fixed up later) - writer->set_dump_start(writer->current_offset()); - writer->write_u4(0); - } -} - -// fixes up the length of the current dump record -void DumperSupport::write_current_dump_record_length(DumpWriter* writer) { - if (writer->is_open()) { - julong dump_end = writer->bytes_written() + writer->bytes_unwritten(); - julong dump_len = writer->current_record_length(); - - // record length must fit in a u4 - if (dump_len > max_juint) { - warning("record is too large"); - } - - // seek to the dump start and fix-up the length - assert(writer->dump_start() >= 0, "no dump start recorded"); - writer->seek_to_offset(writer->dump_start()); - writer->write_u4((u4)dump_len); - - // adjust the total size written to keep the bytes written correct. - writer->adjust_bytes_written(-((jlong) sizeof(u4))); - - // seek to dump end so we can continue - writer->seek_to_offset(dump_end); - - // no current dump record - writer->set_dump_start((jlong)-1); - } -} - -// used on a sub-record boundary to check if we need to start a -// new segment. -void VM_HeapDumper::check_segment_length() { - if (writer()->is_open()) { - julong dump_len = writer()->current_record_length(); - - if (dump_len > 2UL*G) { - DumperSupport::write_current_dump_record_length(writer()); - DumperSupport::write_dump_header(writer()); - } - } -} - // fixes up the current dump record and writes HPROF_HEAP_DUMP_END record void DumperSupport::end_of_dump(DumpWriter* writer) { - if (writer->is_open()) { - write_current_dump_record_length(writer); + writer->finish_dump_segment(); - writer->write_u1(HPROF_HEAP_DUMP_END); - writer->write_u4(0); - writer->write_u4(0); - } -} - -// marks sub-record boundary -void HeapObjectDumper::mark_end_of_record() { - dumper()->check_segment_length(); + writer->write_u1(HPROF_HEAP_DUMP_END); + writer->write_u4(0); + writer->write_u4(0); } // writes a HPROF_LOAD_CLASS record for the class (and each of its @@ -1692,10 +1693,12 @@ oop o = locals->obj_at(slot)(); if (o != NULL) { - writer()->write_u1(HPROF_GC_ROOT_JAVA_FRAME); + u4 size = 1 + sizeof(address) + 4 + 4; + writer()->start_sub_record(HPROF_GC_ROOT_JAVA_FRAME, size); writer()->write_objectID(o); writer()->write_u4(thread_serial_num); writer()->write_u4((u4) (stack_depth + extra_frames)); + writer()->end_sub_record(); } } } @@ -1704,10 +1707,12 @@ if (exprs->at(index)->type() == T_OBJECT) { oop o = exprs->obj_at(index)(); if (o != NULL) { - writer()->write_u1(HPROF_GC_ROOT_JAVA_FRAME); + u4 size = 1 + sizeof(address) + 4 + 4; + writer()->start_sub_record(HPROF_GC_ROOT_JAVA_FRAME, size); writer()->write_objectID(o); writer()->write_u4(thread_serial_num); writer()->write_u4((u4) (stack_depth + extra_frames)); + writer()->end_sub_record(); } } } @@ -1755,10 +1760,12 @@ oop threadObj = thread->threadObj(); u4 thread_serial_num = i+1; u4 stack_serial_num = thread_serial_num + STACK_TRACE_ID; - writer()->write_u1(HPROF_GC_ROOT_THREAD_OBJ); + u4 size = 1 + sizeof(address) + 4 + 4; + writer()->start_sub_record(HPROF_GC_ROOT_THREAD_OBJ, size); writer()->write_objectID(threadObj); writer()->write_u4(thread_serial_num); // thread number writer()->write_u4(stack_serial_num); // stack trace serial number + writer()->end_sub_record(); int num_frames = do_thread(thread, thread_serial_num); assert(num_frames == _stack_traces[i]->get_stack_depth(), "total number of Java frames not matched"); @@ -1833,13 +1840,9 @@ // this must be called after _klass_map is built when iterating the classes above. dump_stack_traces(); - // write HPROF_HEAP_DUMP_SEGMENT - DumperSupport::write_dump_header(writer()); - // Writes HPROF_GC_CLASS_DUMP records ClassLoaderDataGraph::classes_do(&do_class_dump); Universe::basic_type_classes_do(&do_basic_type_array_class_dump); - check_segment_length(); // writes HPROF_GC_INSTANCE_DUMP records. // After each sub-record is written check_segment_length will be invoked @@ -1852,19 +1855,16 @@ // HPROF_GC_ROOT_THREAD_OBJ + frames + jni locals do_threads(); - check_segment_length(); // HPROF_GC_ROOT_MONITOR_USED MonitorUsedDumper mon_dumper(writer()); ObjectSynchronizer::oops_do(&mon_dumper); - check_segment_length(); // HPROF_GC_ROOT_JNI_GLOBAL JNIGlobalsDumper jni_dumper(writer()); JNIHandles::oops_do(&jni_dumper); Universe::oops_do(&jni_dumper); // technically not jni roots, but global roots // for things like preallocated throwable backtraces - check_segment_length(); // HPROF_GC_ROOT_STICKY_CLASS // These should be classes in the NULL class loader data, and not all classes @@ -1872,7 +1872,7 @@ StickyClassDumper class_dumper(writer()); ClassLoaderData::the_null_class_loader_data()->classes_do(&class_dumper); - // fixes up the length of the dump record and writes the HPROF_HEAP_DUMP_END record. + // Writes the HPROF_HEAP_DUMP_END record. DumperSupport::end_of_dump(writer()); // Now we clear the global variables, so that a future dumper might run. @@ -1935,21 +1935,21 @@ } // dump the heap to given path. -int HeapDumper::dump(const char* path) { +int HeapDumper::dump(const char* path, outputStream* out, bool overwrite) { assert(path != NULL && strlen(path) > 0, "path missing"); // print message in interactive case - if (print_to_tty()) { - tty->print_cr("Dumping heap to %s ...", path); + if (out != NULL) { + out->print_cr("Dumping heap to %s ...", path); timer()->start(); } // create the dump writer. If the file can be opened then bail - DumpWriter writer(path); - if (!writer.is_open()) { + DumpWriter writer(path, overwrite); + if (writer.error() != NULL) { set_error(writer.error()); - if (print_to_tty()) { - tty->print_cr("Unable to create %s: %s", path, + if (out != NULL) { + out->print_cr("Unable to create %s: %s", path, (error() != NULL) ? error() : "reason unknown"); } return -1; @@ -1969,13 +1969,13 @@ set_error(writer.error()); // print message in interactive case - if (print_to_tty()) { + if (out != NULL) { timer()->stop(); if (error() == NULL) { - tty->print_cr("Heap dump file created [" JULONG_FORMAT " bytes in %3.3f secs]", + out->print_cr("Heap dump file created [" JULONG_FORMAT " bytes in %3.3f secs]", writer.bytes_written(), timer()->seconds()); } else { - tty->print_cr("Dump file is incomplete: %s", writer.error()); + out->print_cr("Dump file is incomplete: %s", writer.error()); } } @@ -2103,8 +2103,7 @@ dump_file_seq++; // increment seq number for next time we dump HeapDumper dumper(false /* no GC before heap dump */, - true /* send to tty */, oome /* pass along out-of-memory-error flag */); - dumper.dump(my_path); + dumper.dump(my_path, tty); os::free(my_path); } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/heapDumper.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/heapDumper.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/heapDumper.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/heapDumper.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -41,24 +41,22 @@ // } // +class outputStream; + class HeapDumper : public StackObj { private: char* _error; - bool _print_to_tty; bool _gc_before_heap_dump; bool _oome; elapsedTimer _t; - HeapDumper(bool gc_before_heap_dump, bool print_to_tty, bool oome) : - _gc_before_heap_dump(gc_before_heap_dump), _error(NULL), _print_to_tty(print_to_tty), _oome(oome) { } + HeapDumper(bool gc_before_heap_dump, bool oome) : + _gc_before_heap_dump(gc_before_heap_dump), _error(NULL), _oome(oome) { } // string representation of error char* error() const { return _error; } void set_error(char* error); - // indicates if progress messages can be sent to tty - bool print_to_tty() const { return _print_to_tty; } - // internal timer. elapsedTimer* timer() { return &_t; } @@ -66,12 +64,13 @@ public: HeapDumper(bool gc_before_heap_dump) : - _gc_before_heap_dump(gc_before_heap_dump), _error(NULL), _print_to_tty(false), _oome(false) { } + _gc_before_heap_dump(gc_before_heap_dump), _error(NULL), _oome(false) { } ~HeapDumper(); // dumps the heap to the specified file, returns 0 if success. - int dump(const char* path); + // additional info is written to out if not NULL. + int dump(const char* path, outputStream* out = NULL, bool overwrite = false); // returns error message (resource allocated), or NULL if no error char* error_as_C_string() const; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/memBaseline.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/memBaseline.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/memBaseline.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/memBaseline.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -95,7 +95,7 @@ } bool do_malloc_site(const MallocSite* site) { - if (site->size() >= MemBaseline::SIZE_THRESHOLD) { + if (site->size() > 0) { if (_malloc_sites.add(*site) != NULL) { _count++; return true; @@ -103,7 +103,7 @@ return false; // OOM } } else { - // malloc site does not meet threshold, ignore and continue + // Ignore empty sites. return true; } } @@ -125,15 +125,17 @@ VirtualMemoryAllocationWalker() : _count(0) { } bool do_allocation_site(const ReservedMemoryRegion* rgn) { - if (rgn->size() >= MemBaseline::SIZE_THRESHOLD) { + if (rgn->size() > 0) { if (_virtual_memory_regions.add(*rgn) != NULL) { _count ++; return true; } else { return false; } + } else { + // Ignore empty sites. + return true; } - return true; } LinkedList* virtual_memory_allocations() { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/memBaseline.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/memBaseline.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/memBaseline.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/memBaseline.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -43,9 +43,6 @@ */ class MemBaseline { public: - enum BaselineThreshold { - SIZE_THRESHOLD = K // Only allocation size over this threshold will be baselined. - }; enum BaselineType { Not_baselined, diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/memoryManager.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/memoryManager.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/memoryManager.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/memoryManager.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -70,7 +70,7 @@ int add_pool(MemoryPool* pool); - bool is_manager(instanceHandle mh) { return oopDesc::equals(mh(), _memory_mgr_obj); } + bool is_manager(instanceHandle mh) { return mh() == _memory_mgr_obj; } virtual instanceOop get_memory_manager_instance(TRAPS); virtual bool is_gc_memory_manager() { return false; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/memoryPool.hpp openjdk-11-11.0.13+8/src/hotspot/share/services/memoryPool.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/memoryPool.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/memoryPool.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -93,7 +93,7 @@ // max size could be changed virtual size_t max_size() const { return _max_size; } - bool is_pool(instanceHandle pool) { return oopDesc::equals(pool(), _memory_pool_obj); } + bool is_pool(instanceHandle pool) { return pool() == _memory_pool_obj; } bool available_for_allocation() { return _available_for_allocation; } bool set_available_for_allocation(bool value) { diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/services/threadService.cpp openjdk-11-11.0.13+8/src/hotspot/share/services/threadService.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/services/threadService.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/services/threadService.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -680,7 +680,7 @@ for (int j = 0; j < len; j++) { oop monitor = locked_monitors->at(j); assert(monitor != NULL, "must be a Java object"); - if (oopDesc::equals(monitor, object)) { + if (monitor == object) { found = true; break; } @@ -861,7 +861,10 @@ _sleep_ticks = stat->sleep_ticks(); _sleep_count = stat->sleep_count(); - _thread_status = java_lang_Thread::get_thread_status(_threadObj); + // If thread is still attaching then threadObj will be NULL. + _thread_status = _threadObj == NULL ? java_lang_Thread::NEW + : java_lang_Thread::get_thread_status(_threadObj); + _is_ext_suspended = thread->is_being_ext_suspended(); _is_in_native = (thread->thread_state() == _thread_in_native); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/debug.cpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/debug.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/debug.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/debug.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -254,8 +254,7 @@ report_vm_error(file, line, error_msg, "error %s(%d), %s", os::errno_name(status), status, detail); } -void report_fatal(const char* file, int line, const char* detail_fmt, ...) -{ +void report_fatal(VMErrorType error_type, const char* file, int line, const char* detail_fmt, ...) { if (Debugging || error_is_suppressed(file, line)) return; va_list detail_args; va_start(detail_args, detail_fmt); @@ -265,7 +264,9 @@ context = g_assertion_context; } #endif // CAN_SHOW_REGISTERS_ON_ASSERT - VMError::report_and_die(Thread::current_or_null(), context, file, line, "fatal error", detail_fmt, detail_args); + VMError::report_and_die(error_type, "fatal error", detail_fmt, detail_args, + Thread::current_or_null(), NULL, NULL, context, + file, line, 0); va_end(detail_args); } @@ -335,7 +336,7 @@ if (CrashOnOutOfMemoryError) { tty->print_cr("Aborting due to java.lang.OutOfMemoryError: %s", message); - fatal("OutOfMemory encountered: %s", message); + report_fatal(OOM_JAVA_HEAP_FATAL, __FILE__, __LINE__, "OutOfMemory encountered: %s", message); } if (ExitOnOutOfMemoryError) { @@ -770,4 +771,3 @@ return false; } #endif // CAN_SHOW_REGISTERS_ON_ASSERT - diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/debug.hpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/debug.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/debug.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/debug.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -109,7 +109,7 @@ #define fatal(...) \ do { \ TOUCH_ASSERT_POISON; \ - report_fatal(__FILE__, __LINE__, __VA_ARGS__); \ + report_fatal(INTERNAL_ERROR, __FILE__, __LINE__, __VA_ARGS__); \ BREAKPOINT; \ } while (0) @@ -152,7 +152,9 @@ enum VMErrorType { INTERNAL_ERROR = 0xe0000000, OOM_MALLOC_ERROR = 0xe0000001, - OOM_MMAP_ERROR = 0xe0000002 + OOM_MMAP_ERROR = 0xe0000002, + OOM_MPROTECT_ERROR = 0xe0000003, + OOM_JAVA_HEAP_FATAL = 0xe0000004 }; // error reporting helper functions @@ -174,7 +176,7 @@ #endif void report_vm_status_error(const char* file, int line, const char* error_msg, int status, const char* detail); -void report_fatal(const char* file, int line, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(3, 4); +void report_fatal(VMErrorType error_type, const char* file, int line, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(4, 5); void report_vm_out_of_memory(const char* file, int line, size_t size, VMErrorType vm_err_type, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(5, 6); void report_should_not_call(const char* file, int line); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/decoder.cpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/decoder.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/decoder.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/decoder.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -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 @@ -41,14 +41,9 @@ AbstractDecoder* Decoder::_shared_decoder = NULL; AbstractDecoder* Decoder::_error_handler_decoder = NULL; NullDecoder Decoder::_do_nothing_decoder; -Mutex* Decoder::_shared_decoder_lock = new Mutex(Mutex::native, - "SharedDecoderLock", - false, - Monitor::_safepoint_check_never); AbstractDecoder* Decoder::get_shared_instance() { - assert(_shared_decoder_lock != NULL && _shared_decoder_lock->owned_by_self(), - "Require DecoderLock to enter"); + assert(shared_decoder_lock()->owned_by_self(), "Require DecoderLock to enter"); if (_shared_decoder == NULL) { _shared_decoder = create_decoder(); @@ -89,21 +84,22 @@ DecoderLocker::DecoderLocker() : MutexLockerEx(DecoderLocker::is_first_error_thread() ? - NULL : Decoder::shared_decoder_lock(), true) { + NULL : Decoder::shared_decoder_lock(), + Mutex::_no_safepoint_check_flag) { _decoder = is_first_error_thread() ? Decoder::get_error_handler_instance() : Decoder::get_shared_instance(); assert(_decoder != NULL, "null decoder"); } Mutex* Decoder::shared_decoder_lock() { - assert(_shared_decoder_lock != NULL, "Just check"); - return _shared_decoder_lock; + assert(SharedDecoder_lock != NULL, "Just check"); + return SharedDecoder_lock; } bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) { - assert(_shared_decoder_lock != NULL, "Just check"); bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; - MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); + MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(), + Mutex::_no_safepoint_check_flag); AbstractDecoder* decoder = error_handling_thread ? get_error_handler_instance(): get_shared_instance(); assert(decoder != NULL, "null decoder"); @@ -112,9 +108,9 @@ } bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const void* base) { - assert(_shared_decoder_lock != NULL, "Just check"); bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; - MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); + MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(), + Mutex::_no_safepoint_check_flag); AbstractDecoder* decoder = error_handling_thread ? get_error_handler_instance(): get_shared_instance(); assert(decoder != NULL, "null decoder"); @@ -124,9 +120,9 @@ bool Decoder::demangle(const char* symbol, char* buf, int buflen) { - assert(_shared_decoder_lock != NULL, "Just check"); bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid; - MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true); + MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(), + Mutex::_no_safepoint_check_flag); AbstractDecoder* decoder = error_handling_thread ? get_error_handler_instance(): get_shared_instance(); assert(decoder != NULL, "null decoder"); diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/decoder.hpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/decoder.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/decoder.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/decoder.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -131,7 +131,6 @@ static NullDecoder _do_nothing_decoder; protected: - static Mutex* _shared_decoder_lock; static Mutex* shared_decoder_lock(); friend class DecoderLocker; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/exceptions.cpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/exceptions.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/exceptions.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/exceptions.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -436,9 +436,9 @@ volatile int Exceptions::_out_of_memory_error_class_metaspace_errors = 0; void Exceptions::count_out_of_memory_exceptions(Handle exception) { - if (oopDesc::equals(exception(), Universe::out_of_memory_error_metaspace())) { + if (exception() == Universe::out_of_memory_error_metaspace()) { Atomic::inc(&_out_of_memory_error_metaspace_errors); - } else if (oopDesc::equals(exception(), Universe::out_of_memory_error_class_metaspace())) { + } else if (exception() == Universe::out_of_memory_error_class_metaspace()) { Atomic::inc(&_out_of_memory_error_class_metaspace_errors); } else { // everything else reported as java heap OOM diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/globalDefinitions_gcc.hpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/globalDefinitions_gcc.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/globalDefinitions_gcc.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/globalDefinitions_gcc.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -218,8 +218,8 @@ // Checking for finiteness -inline int g_isfinite(jfloat f) { return finite(f); } -inline int g_isfinite(jdouble f) { return finite(f); } +inline int g_isfinite(jfloat f) { return isfinite(f); } +inline int g_isfinite(jdouble f) { return isfinite(f); } // Wide characters diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/growableArray.hpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/growableArray.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/growableArray.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/growableArray.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -216,15 +216,6 @@ void print(); - inline static bool safe_equals(oop obj1, oop obj2) { - return oopDesc::equals(obj1, obj2); - } - - template - inline static bool safe_equals(X i1, X i2) { - return i1 == i2; - } - int append(const E& elem) { check_nesting(); if (_len == _max) grow(_len); @@ -309,7 +300,7 @@ bool contains(const E& elem) const { for (int i = 0; i < _len; i++) { - if (safe_equals(_data[i], elem)) return true; + if (_data[i] == elem) return true; } return false; } diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/vmError.cpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/vmError.cpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/vmError.cpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/vmError.cpp 2021-10-12 20:42:15.000000000 +0000 @@ -604,7 +604,7 @@ STEP("printing bug submit message") - if (should_report_bug(_id) && _verbose) { + if (should_submit_bug_report(_id) && _verbose) { print_bug_submit_message(st, _thread); } @@ -1555,7 +1555,7 @@ } } - static bool skip_bug_url = !should_report_bug(_id); + static bool skip_bug_url = !should_submit_bug_report(_id); if (!skip_bug_url) { skip_bug_url = true; diff -Nru openjdk-11-11.0.12+7/src/hotspot/share/utilities/vmError.hpp openjdk-11-11.0.13+8/src/hotspot/share/utilities/vmError.hpp --- openjdk-11-11.0.12+7/src/hotspot/share/utilities/vmError.hpp 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/hotspot/share/utilities/vmError.hpp 2021-10-12 20:42:15.000000000 +0000 @@ -114,6 +114,10 @@ return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR); } + static bool should_submit_bug_report(unsigned int id) { + return should_report_bug(id) && (id != OOM_JAVA_HEAP_FATAL); + } + // Write a hint to the stream in case siginfo relates to a segv/bus error // and the offending address points into CDS store. static void check_failing_cds_access(outputStream* st, const void* siginfo); diff -Nru openjdk-11-11.0.12+7/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java openjdk-11-11.0.13+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java --- openjdk-11-11.0.12+7/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java 2021-10-12 20:42:15.000000000 +0000 @@ -116,7 +116,10 @@ try (Stream lines = readFilePrivileged(Paths.get("/proc/self/cgroup"))) { - lines.map(line -> line.split(":")) + // The limit value of 3 is because /proc/self/cgroup contains three + // colon-separated tokens per line. The last token, cgroup path, might + // contain a ':'. + lines.map(line -> line.split(":", 3)) .filter(line -> (line.length >= 3)) .forEach(line -> setSubSystemPath(metrics, line)); diff -Nru openjdk-11-11.0.12+7/src/java.base/macosx/native/libjava/java_props_macosx.c openjdk-11-11.0.13+8/src/java.base/macosx/native/libjava/java_props_macosx.c --- openjdk-11-11.0.12+7/src/java.base/macosx/native/libjava/java_props_macosx.c 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/macosx/native/libjava/java_props_macosx.c 2021-10-12 20:42:15.000000000 +0000 @@ -254,14 +254,19 @@ // Hardcode os_name, and fill in os_version sprops->os_name = strdup("Mac OS X"); + NSString *nsVerStr = NULL; char* osVersionCStr = NULL; // Mac OS 10.9 includes the [NSProcessInfo operatingSystemVersion] function, - // but it's not in the 10.9 SDK. So, call it via objc_msgSend_stret. + // but it's not in the 10.9 SDK. So, call it via NSInvocation. if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)]) { - OSVerStruct (*procInfoFn)(id rec, SEL sel) = (OSVerStruct(*)(id, SEL))objc_msgSend_stret; - OSVerStruct osVer = procInfoFn([NSProcessInfo processInfo], - @selector(operatingSystemVersion)); - NSString *nsVerStr; + OSVerStruct osVer; + NSMethodSignature *sig = [[NSProcessInfo processInfo] methodSignatureForSelector: + @selector(operatingSystemVersion)]; + NSInvocation *invoke = [NSInvocation invocationWithMethodSignature:sig]; + invoke.selector = @selector(operatingSystemVersion); + [invoke invokeWithTarget:[NSProcessInfo processInfo]]; + [invoke getReturnValue:&osVer]; + // Copy out the char* if running on version other than 10.16 Mac OS (10.16 == 11.x) // or explicitly requesting version compatibility if (!((long)osVer.majorVersion == 10 && (long)osVer.minorVersion >= 16) || @@ -273,36 +278,30 @@ nsVerStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)osVer.majorVersion, (long)osVer.minorVersion, (long)osVer.patchVersion]; } - // Copy out the char* - osVersionCStr = strdup([nsVerStr UTF8String]); } else { // Version 10.16, without explicit env setting of SYSTEM_VERSION_COMPAT - // AKA 11.x; compute the version number from the letter in the ProductBuildVersion + // AKA 11+ Read the *real* ProductVersion from the hidden link to avoid SYSTEM_VERSION_COMPAT + // If not found, fallback below to the SystemVersion.plist NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile : - @"/System/Library/CoreServices/SystemVersion.plist"]; + @"/System/Library/CoreServices/.SystemVersionPlatform.plist"]; if (version != NULL) { - NSString *nsBuildVerStr = [version objectForKey : @"ProductBuildVersion"]; - if (nsBuildVerStr != NULL && nsBuildVerStr.length >= 3) { - int letter = [nsBuildVerStr characterAtIndex:2]; - if (letter >= 'B' && letter <= 'Z') { - int vers = letter - 'A' - 1; - asprintf(&osVersionCStr, "11.%d", vers); - } - } + nsVerStr = [version objectForKey : @"ProductVersion"]; } } } // Fallback if running on pre-10.9 Mac OS - if (osVersionCStr == NULL) { + if (nsVerStr == NULL) { NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile : @"/System/Library/CoreServices/SystemVersion.plist"]; if (version != NULL) { - NSString *nsVerStr = [version objectForKey : @"ProductVersion"]; - if (nsVerStr != NULL) { - osVersionCStr = strdup([nsVerStr UTF8String]); - } + nsVerStr = [version objectForKey : @"ProductVersion"]; } } + + if (nsVerStr != NULL) { + // Copy out the char* + osVersionCStr = strdup([nsVerStr UTF8String]); + } if (osVersionCStr == NULL) { osVersionCStr = strdup("Unknown"); } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java openjdk-11-11.0.13+8/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java 2021-10-12 20:42:15.000000000 +0000 @@ -291,7 +291,7 @@ } } catch (Exception e) { - throw new KeyStoreException(e.getMessage()); + throw new KeyStoreException(e.getMessage(), e); } } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/java/lang/StringCoding.java openjdk-11-11.0.13+8/src/java.base/share/classes/java/lang/StringCoding.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/java/lang/StringCoding.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/java/lang/StringCoding.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -191,6 +191,12 @@ return result.with(StringLatin1.inflate(ba, off, len), UTF16); } } + // fastpath for always Latin1 decodable single byte + if (COMPACT_STRINGS && cd instanceof ArrayDecoder && ((ArrayDecoder)cd).isLatin1Decodable()) { + byte[] dst = new byte[len]; + ((ArrayDecoder)cd).decodeToLatin1(ba, off, len, dst); + return result.with(dst, LATIN1); + } int en = scale(len, cd.maxCharsPerByte()); char[] ca = new char[en]; if (cd instanceof ArrayDecoder) { @@ -278,6 +284,13 @@ ((ArrayDecoder)cd).isASCIICompatible() && !hasNegatives(ba, off, len)) { return decodeLatin1(ba, off, len); } + // fastpath for always Latin1 decodable single byte + if (COMPACT_STRINGS && cd instanceof ArrayDecoder && ((ArrayDecoder)cd).isLatin1Decodable()) { + byte[] dst = new byte[len]; + ((ArrayDecoder)cd).decodeToLatin1(ba, off, len, dst); + return new Result().with(dst, LATIN1); + } + int en = scale(len, cd.maxCharsPerByte()); if (len == 0) { return new Result().with(); diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/java/net/URLClassLoader.java openjdk-11-11.0.13+8/src/java.base/share/classes/java/net/URLClassLoader.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/java/net/URLClassLoader.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/java/net/URLClassLoader.java 2021-10-12 20:42:15.000000000 +0000 @@ -458,6 +458,11 @@ return defineClass(name, res); } catch (IOException e) { throw new ClassNotFoundException(name, e); + } catch (ClassFormatError e2) { + if (res.getDataError() != null) { + e2.addSuppressed(res.getDataError()); + } + throw e2; } } else { return null; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/java/util/HashMap.java openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/HashMap.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/java/util/HashMap.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/HashMap.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -27,6 +27,7 @@ import java.io.IOException; import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; @@ -1418,23 +1419,28 @@ * could not be found * @throws IOException if an I/O error occurs */ - private void readObject(java.io.ObjectInputStream s) + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { - // Read in the threshold (ignored), loadfactor, and any hidden stuff - s.defaultReadObject(); + + ObjectInputStream.GetField fields = s.readFields(); + + // Read loadFactor (ignore threshold) + float lf = fields.get("loadFactor", 0.75f); + if (lf <= 0 || Float.isNaN(lf)) + throw new InvalidObjectException("Illegal load factor: " + lf); + + lf = Math.min(Math.max(0.25f, lf), 4.0f); + HashMap.UnsafeHolder.putLoadFactor(this, lf); + reinitialize(); - if (loadFactor <= 0 || Float.isNaN(loadFactor)) - throw new InvalidObjectException("Illegal load factor: " + - loadFactor); + s.readInt(); // Read and ignore number of buckets int mappings = s.readInt(); // Read number of mappings (size) - if (mappings < 0) - throw new InvalidObjectException("Illegal mappings count: " + - mappings); - else if (mappings > 0) { // (if zero, use defaults) - // Size the table using given load factor only if within - // range of 0.25...4.0 - float lf = Math.min(Math.max(0.25f, loadFactor), 4.0f); + if (mappings < 0) { + throw new InvalidObjectException("Illegal mappings count: " + mappings); + } else if (mappings == 0) { + // use defaults + } else if (mappings > 0) { float fc = (float)mappings / lf + 1.0f; int cap = ((fc < DEFAULT_INITIAL_CAPACITY) ? DEFAULT_INITIAL_CAPACITY : @@ -1463,6 +1469,18 @@ } } + // Support for resetting final field during deserializing + private static final class UnsafeHolder { + private UnsafeHolder() { throw new InternalError(); } + private static final jdk.internal.misc.Unsafe unsafe + = jdk.internal.misc.Unsafe.getUnsafe(); + private static final long LF_OFFSET + = unsafe.objectFieldOffset(HashMap.class, "loadFactor"); + static void putLoadFactor(HashMap map, float lf) { + unsafe.putFloat(map, LF_OFFSET, lf); + } + } + /* ------------------------------------------------------------ */ // iterators diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/java/util/HashSet.java openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/HashSet.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/java/util/HashSet.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/HashSet.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -294,8 +294,8 @@ */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { - // Read in any hidden serialization magic - s.defaultReadObject(); + // Consume and ignore stream fields (currently zero). + s.readFields(); // Read capacity and verify non-negative. int capacity = s.readInt(); @@ -310,12 +310,13 @@ throw new InvalidObjectException("Illegal load factor: " + loadFactor); } + // Clamp load factor to range of 0.25...4.0. + loadFactor = Math.min(Math.max(0.25f, loadFactor), 4.0f); // Read size and verify non-negative. int size = s.readInt(); if (size < 0) { - throw new InvalidObjectException("Illegal size: " + - size); + throw new InvalidObjectException("Illegal size: " + size); } // Set the capacity according to the size and load factor ensuring that diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/java/util/jar/JarFile.java openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/jar/JarFile.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/java/util/jar/JarFile.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/java/util/jar/JarFile.java 2021-10-12 20:42:15.000000000 +0000 @@ -153,6 +153,8 @@ private static final boolean MULTI_RELEASE_ENABLED; private static final boolean MULTI_RELEASE_FORCED; private static final ThreadLocal isInitializing = new ThreadLocal<>(); + // The maximum size of array to allocate. Some VMs reserve some header words in an array. + private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; private SoftReference manRef; private JarEntry manEntry; @@ -804,7 +806,11 @@ */ private byte[] getBytes(ZipEntry ze) throws IOException { try (InputStream is = super.getInputStream(ze)) { - int len = (int)ze.getSize(); + long uncompressedSize = ze.getSize(); + if (uncompressedSize > MAX_ARRAY_SIZE) { + throw new IOException("Unsupported size: " + uncompressedSize); + } + int len = (int)uncompressedSize; int bytesRead; byte[] b; // trust specified entry sizes when reasonably small diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/javax/crypto/spec/IvParameterSpec.java openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/IvParameterSpec.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/javax/crypto/spec/IvParameterSpec.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/IvParameterSpec.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -76,13 +76,16 @@ if (iv == null) { throw new IllegalArgumentException("IV missing"); } - if (iv.length - offset < len) { - throw new IllegalArgumentException - ("IV buffer too short for given offset/length combination"); + if (offset < 0) { + throw new ArrayIndexOutOfBoundsException("offset is negative"); } if (len < 0) { throw new ArrayIndexOutOfBoundsException("len is negative"); } + if (iv.length - offset < len) { + throw new IllegalArgumentException + ("IV buffer too short for given offset/length combination"); + } this.iv = new byte[len]; System.arraycopy(iv, offset, this.iv, 0, len); } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -114,7 +114,12 @@ this.version = version; this.rounds = rounds; this.wordSize = wordSize; - if (iv == null) throw new IllegalArgumentException("IV missing"); + if (iv == null) { + throw new IllegalArgumentException("IV missing"); + } + if (offset < 0) { + throw new ArrayIndexOutOfBoundsException("offset is negative"); + } int blockSize = (wordSize / 8) * 2; if (iv.length - offset < blockSize) { throw new IllegalArgumentException("IV too short"); diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/javax/crypto/spec/SecretKeySpec.java 2021-10-12 20:42:15.000000000 +0000 @@ -142,13 +142,16 @@ if (key.length == 0) { throw new IllegalArgumentException("Empty key"); } - if (key.length-offset < len) { - throw new IllegalArgumentException - ("Invalid offset/length combination"); + if (offset < 0) { + throw new ArrayIndexOutOfBoundsException("offset is negative"); } if (len < 0) { throw new ArrayIndexOutOfBoundsException("len is negative"); } + if (key.length - offset < len) { + throw new IllegalArgumentException + ("Invalid offset/length combination"); + } this.key = new byte[len]; System.arraycopy(key, offset, this.key, 0, len); this.algorithm = algorithm; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/jdk/internal/loader/Resource.java openjdk-11-11.0.13+8/src/java.base/share/classes/jdk/internal/loader/Resource.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/jdk/internal/loader/Resource.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/jdk/internal/loader/Resource.java 2021-10-12 20:42:15.000000000 +0000 @@ -185,4 +185,12 @@ public CodeSigner[] getCodeSigners() { return null; } + + /** + * Returns non-fatal reading error during data retrieval if there's any. + * For example, CRC error when reading a JAR entry. + */ + public Exception getDataError() { + return null; + } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java openjdk-11-11.0.13+8/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java 2021-10-12 20:42:15.000000000 +0000 @@ -61,6 +61,7 @@ import java.util.Set; import java.util.StringTokenizer; import java.util.jar.JarFile; +import java.util.zip.CRC32; import java.util.zip.ZipEntry; import java.util.jar.JarEntry; import java.util.jar.Manifest; @@ -859,6 +860,7 @@ } return new Resource() { + private Exception dataError = null; public String getName() { return name; } public URL getURL() { return url; } public URL getCodeSourceURL() { return csu; } @@ -874,6 +876,18 @@ { return entry.getCertificates(); }; public CodeSigner[] getCodeSigners() { return entry.getCodeSigners(); }; + public Exception getDataError() + { return dataError; } + public byte[] getBytes() throws IOException { + byte[] bytes = super.getBytes(); + CRC32 crc32 = new CRC32(); + crc32.update(bytes); + if (crc32.getValue() != entry.getCrc()) { + dataError = new IOException( + "CRC error while extracting entry from JAR file"); + } + return bytes; + } }; } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/nio/cs/ArrayDecoder.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/nio/cs/ArrayDecoder.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/nio/cs/ArrayDecoder.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/nio/cs/ArrayDecoder.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -28,6 +28,9 @@ /* * FastPath byte[]->char[] decoder, REPLACE on malformed or * unmappable input. + * + * FastPath encoded byte[]-> "String Latin1 coding" byte[] decoder for use when + * charset is always decodable to the internal String Latin1 coding byte[], ie. all mappings <=0xff */ public interface ArrayDecoder { @@ -36,4 +39,14 @@ default boolean isASCIICompatible() { return false; } + + // Is always decodable to internal String Latin1 coding, ie. all mappings <= 0xff + default boolean isLatin1Decodable() { + return false; + } + + // Decode to internal String Latin1 coding byte[] fastpath for when isLatin1Decodable == true + default int decodeToLatin1(byte[] src, int sp, int len, byte[] dst) { + return 0; + } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/nio/cs/SingleByte.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/nio/cs/SingleByte.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/nio/cs/SingleByte.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/nio/cs/SingleByte.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -50,17 +50,27 @@ implements ArrayDecoder { private final char[] b2c; private final boolean isASCIICompatible; + private final boolean isLatin1Decodable; public Decoder(Charset cs, char[] b2c) { super(cs, 1.0f, 1.0f); this.b2c = b2c; this.isASCIICompatible = false; + this.isLatin1Decodable = false; } public Decoder(Charset cs, char[] b2c, boolean isASCIICompatible) { super(cs, 1.0f, 1.0f); this.b2c = b2c; this.isASCIICompatible = isASCIICompatible; + this.isLatin1Decodable = false; + } + + public Decoder(Charset cs, char[] b2c, boolean isASCIICompatible, boolean isLatin1Decodable) { + super(cs, 1.0f, 1.0f); + this.b2c = b2c; + this.isASCIICompatible = isASCIICompatible; + this.isLatin1Decodable = isLatin1Decodable; } private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) { @@ -125,6 +135,18 @@ } @Override + public int decodeToLatin1(byte[] src, int sp, int len, byte[] dst) { + if (len > dst.length) + len = dst.length; + + int dp = 0; + while (dp < len) { + dst[dp++] = (byte)decode(src[sp++]); + } + return dp; + } + + @Override public int decode(byte[] src, int sp, int len, char[] dst) { if (len > dst.length) len = dst.length; @@ -143,6 +165,11 @@ public boolean isASCIICompatible() { return isASCIICompatible; } + + @Override + public boolean isLatin1Decodable() { + return isLatin1Decodable; + } } public static final class Encoder extends CharsetEncoder diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java 2021-10-12 20:42:15.000000000 +0000 @@ -263,6 +263,9 @@ if (!(key instanceof java.security.PrivateKey)) { throw new KeyStoreException("Cannot store non-PrivateKeys"); } + if (password == null) { + throw new KeyStoreException("password can't be null"); + } try { synchronized(entries) { KeyEntry entry = new KeyEntry(); diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java 2021-10-12 20:42:15.000000000 +0000 @@ -31,6 +31,7 @@ import java.security.cert.X509Certificate; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -44,6 +45,7 @@ import sun.security.ssl.CipherSuite.KeyExchange; import sun.security.ssl.SSLHandshake.HandshakeMessage; import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.ssl.X509Authentication.X509PossessionGenerator; /** * Pack of the CertificateRequest handshake message. @@ -328,6 +330,16 @@ // clean up this consumer chc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_REQUEST.id); + chc.receivedCertReq = true; + + // If we're processing this message and the server's certificate + // message consumer has not already run then this is a state + // machine violation. + if (chc.handshakeConsumers.containsKey( + SSLHandshake.CERTIFICATE.id)) { + throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected CertificateRequest handshake message"); + } SSLConsumer certStatCons = chc.handshakeConsumers.remove( SSLHandshake.CERTIFICATE_STATUS.id); @@ -654,6 +666,16 @@ // clean up this consumer chc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_REQUEST.id); + chc.receivedCertReq = true; + + // If we're processing this message and the server's certificate + // message consumer has not already run then this is a state + // machine violation. + if (chc.handshakeConsumers.containsKey( + SSLHandshake.CERTIFICATE.id)) { + throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected CertificateRequest handshake message"); + } SSLConsumer certStatCons = chc.handshakeConsumers.remove( SSLHandshake.CERTIFICATE_STATUS.id); @@ -696,12 +718,11 @@ chc.handshakeSession.setPeerSupportedSignatureAlgorithms(sss); chc.peerSupportedAuthorities = crm.getAuthorities(); - // For TLS 1.2, we no longer use the certificate_types field - // from the CertificateRequest message to directly determine - // the SSLPossession. Instead, the choosePossession method - // will use the accepted signature schemes in the message to - // determine the set of acceptable certificate types to select from. - SSLPossession pos = choosePossession(chc); + // For TLS 1.2, we need to use a combination of the CR message's + // allowed key types and the signature algorithms in order to + // find a certificate chain that has the right key and all certs + // using one or more of the allowed cert signature schemes. + SSLPossession pos = choosePossession(chc, crm); if (pos == null) { return; } @@ -711,8 +732,8 @@ SSLHandshake.CERTIFICATE_VERIFY); } - private static SSLPossession choosePossession(HandshakeContext hc) - throws IOException { + private static SSLPossession choosePossession(HandshakeContext hc, + T12CertificateRequestMessage crm) throws IOException { if (hc.peerRequestedCertSignSchemes == null || hc.peerRequestedCertSignSchemes.isEmpty()) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { @@ -722,6 +743,9 @@ return null; } + // Put the CR key type into a more friendly format for searching + List crKeyTypes = Arrays.asList(crm.getKeyTypes()); + Collection checkedKeyTypes = new HashSet<>(); for (SignatureScheme ss : hc.peerRequestedCertSignSchemes) { if (checkedKeyTypes.contains(ss.keyAlgorithm)) { @@ -748,7 +772,7 @@ continue; } - SSLAuthentication ka = X509Authentication.valueOf(ss); + X509Authentication ka = X509Authentication.valueOf(ss); if (ka == null) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { SSLLogger.warning( @@ -756,6 +780,27 @@ } checkedKeyTypes.add(ss.keyAlgorithm); continue; + } else { + // Any auth object will have a possession generator and + // we need to make sure the key types for that generator + // share at least one common algorithm with the CR's + // allowed key types. + if (ka.possessionGenerator instanceof + X509PossessionGenerator) { + X509PossessionGenerator xpg = + (X509PossessionGenerator) ka.possessionGenerator; + if (Collections.disjoint(crKeyTypes, + Arrays.asList(xpg.keyTypes))) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unsupported authentication scheme: " + + ss.name); + } + checkedKeyTypes.add(ss.keyAlgorithm); + continue; + } + } } SSLPossession pos = ka.createPossession(hc); @@ -918,6 +963,15 @@ // clean up this consumer chc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_REQUEST.id); + chc.receivedCertReq = true; + + // Ensure that the CertificateRequest has not been sent prior + // to EncryptedExtensions + if (chc.handshakeConsumers.containsKey( + SSLHandshake.ENCRYPTED_EXTENSIONS.id)) { + throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected CertificateRequest handshake message"); + } T13CertificateRequestMessage crm = new T13CertificateRequestMessage(chc, message); diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/CipherSuite.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/CipherSuite.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/CipherSuite.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/CipherSuite.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -56,20 +56,25 @@ // the following criteria: // 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be // changed later, see below). - // 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM), + // 2. Prefer forward secrecy cipher suites. + // 3. Prefer the stronger bulk cipher, in the order of AES_256(GCM), // AES_128(GCM), AES_256, AES_128, 3DES-EDE. - // 3. Prefer the stronger MAC algorithm, in the order of SHA384, + // 4. Prefer the stronger MAC algorithm, in the order of SHA384, // SHA256, SHA, MD5. - // 4. Prefer the better performance of key exchange and digital + // 5. Prefer the better performance of key exchange and digital // signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, - // RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS. + // DHE-RSA, DHE-DSS, ECDH-ECDSA, ECDH-RSA, RSA. - TLS_AES_128_GCM_SHA256( - 0x1301, true, "TLS_AES_128_GCM_SHA256", - ProtocolVersion.PROTOCOLS_OF_13, B_AES_128_GCM_IV, H_SHA256), + // TLS 1.3 cipher suites. TLS_AES_256_GCM_SHA384( 0x1302, true, "TLS_AES_256_GCM_SHA384", ProtocolVersion.PROTOCOLS_OF_13, B_AES_256_GCM_IV, H_SHA384), + TLS_AES_128_GCM_SHA256( + 0x1301, true, "TLS_AES_128_GCM_SHA256", + ProtocolVersion.PROTOCOLS_OF_13, B_AES_128_GCM_IV, H_SHA256), + TLS_CHACHA20_POLY1305_SHA256( + 0x1303, true, "TLS_CHACHA20_POLY1305_SHA256", + ProtocolVersion.PROTOCOLS_OF_13, B_CC20_P1305, H_SHA256), // Suite B compliant cipher suites, see RFC 6460. // @@ -91,49 +96,48 @@ // not forward secret cipher suites. // - // AES_256(GCM) + // Not suite B, but we want it to position the suite early in the list + // of 1.2 suites. + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256( + 0xCCA9, true, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_ECDSA, B_CC20_P1305, M_NULL, H_SHA256), + + // + // Forward screcy cipher suites. + // + + // AES_256(GCM) - ECDHE TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384( 0xC030, true, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, K_ECDHE_RSA, B_AES_256_GCM, M_NULL, H_SHA384), - TLS_RSA_WITH_AES_256_GCM_SHA384( - 0x009D, true, "TLS_RSA_WITH_AES_256_GCM_SHA384", "", + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256( + 0xCCA8, true, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "", ProtocolVersion.PROTOCOLS_OF_12, - K_RSA, B_AES_256_GCM, M_NULL, H_SHA384), - TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384( - 0xC02E, true, "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDH_ECDSA, B_AES_256_GCM, M_NULL, H_SHA384), - TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384( - 0xC032, true, "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", "", + K_ECDHE_RSA, B_CC20_P1305, M_NULL, H_SHA256), + + // AES_128(GCM) - ECDHE + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256( + 0xC02F, true, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "", ProtocolVersion.PROTOCOLS_OF_12, - K_ECDH_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + K_ECDHE_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + + // AES_256(GCM) - DHE TLS_DHE_RSA_WITH_AES_256_GCM_SHA384( 0x009F, true, "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, K_DHE_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256( + 0xCCAA, true, "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_CC20_P1305, M_NULL, H_SHA256), TLS_DHE_DSS_WITH_AES_256_GCM_SHA384( 0x00A3, true, "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, K_DHE_DSS, B_AES_256_GCM, M_NULL, H_SHA384), - // AES_128(GCM) - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256( - 0xC02F, true, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDHE_RSA, B_AES_128_GCM, M_NULL, H_SHA256), - TLS_RSA_WITH_AES_128_GCM_SHA256( - 0x009C, true, "TLS_RSA_WITH_AES_128_GCM_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_RSA, B_AES_128_GCM, M_NULL, H_SHA256), - TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256( - 0xC02D, true, "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDH_ECDSA, B_AES_128_GCM, M_NULL, H_SHA256), - TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256( - 0xC031, true, "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDH_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + // AES_128(GCM) - DHE TLS_DHE_RSA_WITH_AES_128_GCM_SHA256( 0x009E, true, "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", "", ProtocolVersion.PROTOCOLS_OF_12, @@ -143,7 +147,7 @@ ProtocolVersion.PROTOCOLS_OF_12, K_DHE_DSS, B_AES_128_GCM, M_NULL, H_SHA256), - // AES_256(CBC) + // AES_256(CBC) - ECDHE TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384( 0xC024, true, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, @@ -152,10 +156,62 @@ 0xC028, true, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, K_ECDHE_RSA, B_AES_256, M_SHA384, H_SHA384), - TLS_RSA_WITH_AES_256_CBC_SHA256( - 0x003D, true, "TLS_RSA_WITH_AES_256_CBC_SHA256", "", + + // AES_128(CBC) - ECDHE + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256( + 0xC023, true, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", "", ProtocolVersion.PROTOCOLS_OF_12, - K_RSA, B_AES_256, M_SHA256, H_SHA256), + K_ECDHE_ECDSA, B_AES_128, M_SHA256, H_SHA256), + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256( + 0xC027, true, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_RSA, B_AES_128, M_SHA256, H_SHA256), + + // AES_256(CBC) - DHE + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256( + 0x006B, true, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_AES_256, M_SHA256, H_SHA256), + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256( + 0x006A, true, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_DSS, B_AES_256, M_SHA256, H_SHA256), + + // AES_128(CBC) - DHE + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256( + 0x0067, true, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_AES_128, M_SHA256, H_SHA256), + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256( + 0x0040, true, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_DSS, B_AES_128, M_SHA256, H_SHA256), + + // + // not forward screcy cipher suites. + // + + // AES_256(GCM) + TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384( + 0xC02E, true, "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_ECDSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384( + 0xC032, true, "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + + // AES_128(GCM) + TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256( + 0xC02D, true, "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_ECDSA, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256( + 0xC031, true, "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + + // AES_256(CBC) TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384( 0xC026, true, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, @@ -164,15 +220,22 @@ 0xC02A, true, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", "", ProtocolVersion.PROTOCOLS_OF_12, K_ECDH_RSA, B_AES_256, M_SHA384, H_SHA384), - TLS_DHE_RSA_WITH_AES_256_CBC_SHA256( - 0x006B, true, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", "", + + // AES_128(CBC) + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256( + 0xC025, true, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", "", ProtocolVersion.PROTOCOLS_OF_12, - K_DHE_RSA, B_AES_256, M_SHA256, H_SHA256), - TLS_DHE_DSS_WITH_AES_256_CBC_SHA256( - 0x006A, true, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", "", + K_ECDH_ECDSA, B_AES_128, M_SHA256, H_SHA256), + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256( + 0xC029, true, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", "", ProtocolVersion.PROTOCOLS_OF_12, - K_DHE_DSS, B_AES_256, M_SHA256, H_SHA256), + K_ECDH_RSA, B_AES_128, M_SHA256, H_SHA256), + // + // Legacy, used for compatibility + // + + // AES_256(CBC) - ECDHE - Using SHA TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA( 0xC00A, true, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, @@ -181,18 +244,18 @@ 0xC014, true, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, K_ECDHE_RSA, B_AES_256, M_SHA, H_SHA256), - TLS_RSA_WITH_AES_256_CBC_SHA( - 0x0035, true, "TLS_RSA_WITH_AES_256_CBC_SHA", "", - ProtocolVersion.PROTOCOLS_TO_12, - K_RSA, B_AES_256, M_SHA, H_SHA256), - TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA( - 0xC005, true, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", "", + + // AES_128(CBC) - ECDHE - using SHA + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA( + 0xC009, true, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_ECDH_ECDSA, B_AES_256, M_SHA, H_SHA256), - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA( - 0xC00F, true, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", "", + K_ECDHE_ECDSA, B_AES_128, M_SHA, H_SHA256), + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA( + 0xC013, true, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_ECDH_RSA, B_AES_256, M_SHA, H_SHA256), + K_ECDHE_RSA, B_AES_128, M_SHA, H_SHA256), + + // AES_256(CBC) - DHE - Using SHA TLS_DHE_RSA_WITH_AES_256_CBC_SHA( 0x0039, true, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, @@ -202,48 +265,27 @@ ProtocolVersion.PROTOCOLS_TO_12, K_DHE_DSS, B_AES_256, M_SHA, H_SHA256), - // AES_128(CBC) - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256( - 0xC023, true, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDHE_ECDSA, B_AES_128, M_SHA256, H_SHA256), - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256( - 0xC027, true, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDHE_RSA, B_AES_128, M_SHA256, H_SHA256), - TLS_RSA_WITH_AES_128_CBC_SHA256( - 0x003C, true, "TLS_RSA_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_RSA, B_AES_128, M_SHA256, H_SHA256), - TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256( - 0xC025, true, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDH_ECDSA, B_AES_128, M_SHA256, H_SHA256), - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256( - 0xC029, true, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_ECDH_RSA, B_AES_128, M_SHA256, H_SHA256), - TLS_DHE_RSA_WITH_AES_128_CBC_SHA256( - 0x0067, true, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_DHE_RSA, B_AES_128, M_SHA256, H_SHA256), - TLS_DHE_DSS_WITH_AES_128_CBC_SHA256( - 0x0040, true, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", "", - ProtocolVersion.PROTOCOLS_OF_12, - K_DHE_DSS, B_AES_128, M_SHA256, H_SHA256), - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA( - 0xC009, true, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", "", + // AES_128(CBC) - DHE - using SHA + TLS_DHE_RSA_WITH_AES_128_CBC_SHA( + 0x0033, true, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_ECDHE_ECDSA, B_AES_128, M_SHA, H_SHA256), - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA( - 0xC013, true, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "", + K_DHE_RSA, B_AES_128, M_SHA, H_SHA256), + TLS_DHE_DSS_WITH_AES_128_CBC_SHA( + 0x0032, true, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_ECDHE_RSA, B_AES_128, M_SHA, H_SHA256), - TLS_RSA_WITH_AES_128_CBC_SHA( - 0x002F, true, "TLS_RSA_WITH_AES_128_CBC_SHA", "", + K_DHE_DSS, B_AES_128, M_SHA, H_SHA256), + + // AES_256(CBC) - using SHA, not forward screcy + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA( + 0xC005, true, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_RSA, B_AES_128, M_SHA, H_SHA256), + K_ECDH_ECDSA, B_AES_256, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA( + 0xC00F, true, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_RSA, B_AES_256, M_SHA, H_SHA256), + + // AES_128(CBC) - using SHA, not forward screcy TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA( 0xC004, true, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, @@ -252,16 +294,48 @@ 0xC00E, true, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, K_ECDH_RSA, B_AES_128, M_SHA, H_SHA256), - TLS_DHE_RSA_WITH_AES_128_CBC_SHA( - 0x0033, true, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "", + + // + // deprecated, used for compatibility + // + + // RSA, AES_256(GCM) + TLS_RSA_WITH_AES_256_GCM_SHA384( + 0x009D, true, "TLS_RSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + + // RSA, AES_128(GCM) + TLS_RSA_WITH_AES_128_GCM_SHA256( + 0x009C, true, "TLS_RSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + + // RSA, AES_256(CBC) + TLS_RSA_WITH_AES_256_CBC_SHA256( + 0x003D, true, "TLS_RSA_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_256, M_SHA256, H_SHA256), + + // RSA, AES_128(CBC) + TLS_RSA_WITH_AES_128_CBC_SHA256( + 0x003C, true, "TLS_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_128, M_SHA256, H_SHA256), + + // RSA, AES_256(CBC) - using SHA, not forward screcy + TLS_RSA_WITH_AES_256_CBC_SHA( + 0x0035, true, "TLS_RSA_WITH_AES_256_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_DHE_RSA, B_AES_128, M_SHA, H_SHA256), - TLS_DHE_DSS_WITH_AES_128_CBC_SHA( - 0x0032, true, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "", + K_RSA, B_AES_256, M_SHA, H_SHA256), + + // RSA, AES_128(CBC) - using SHA, not forward screcy + TLS_RSA_WITH_AES_128_CBC_SHA( + 0x002F, true, "TLS_RSA_WITH_AES_128_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, - K_DHE_DSS, B_AES_128, M_SHA, H_SHA256), + K_RSA, B_AES_128, M_SHA, H_SHA256), - // 3DES_EDE + // 3DES_EDE, forward secrecy. TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA( 0xC008, true, "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, @@ -270,19 +344,6 @@ 0xC012, true, "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", "", ProtocolVersion.PROTOCOLS_TO_12, K_ECDHE_RSA, B_3DES, M_SHA, H_SHA256), - SSL_RSA_WITH_3DES_EDE_CBC_SHA( - 0x000A, true, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - ProtocolVersion.PROTOCOLS_TO_12, - K_RSA, B_3DES, M_SHA, H_SHA256), - TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA( - 0xC003, true, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", "", - ProtocolVersion.PROTOCOLS_TO_12, - K_ECDH_ECDSA, B_3DES, M_SHA, H_SHA256), - TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA( - 0xC00D, true, "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", "", - ProtocolVersion.PROTOCOLS_TO_12, - K_ECDH_RSA, B_3DES, M_SHA, H_SHA256), SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA( 0x0016, true, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", @@ -294,6 +355,21 @@ ProtocolVersion.PROTOCOLS_TO_12, K_DHE_DSS, B_3DES, M_SHA, H_SHA256), + // 3DES_EDE, not forward secrecy. + TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA( + 0xC003, true, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ECDSA, B_3DES, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA( + 0xC00D, true, "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_RSA, B_3DES, M_SHA, H_SHA256), + SSL_RSA_WITH_3DES_EDE_CBC_SHA( + 0x000A, true, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_12, + K_RSA, B_3DES, M_SHA, H_SHA256), + // Renegotiation protection request Signalling Cipher Suite Value (SCSV). TLS_EMPTY_RENEGOTIATION_INFO_SCSV( // RFC 5746, TLS 1.2 and prior 0x00FF, true, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", "", @@ -484,8 +560,6 @@ // Definition of the cipher suites that are not supported but the names // are known. - TLS_CHACHA20_POLY1305_SHA256( // TLS 1.3 - "TLS_CHACHA20_POLY1305_SHA256", 0x1303), TLS_AES_128_CCM_SHA256( // TLS 1.3 "TLS_AES_128_CCM_SHA256", 0x1304), TLS_AES_128_CCM_8_SHA256( // TLS 1.3 diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -90,6 +90,11 @@ ClientHelloMessage initialClientHelloMsg = null; + // Flag to indicate receipt of a CertificateRequest message from + // the server. Because this is optional, we cannot guarantee + // the handshakeConsumers Map will always have it present there. + boolean receivedCertReq = false; + // PSK identity is selected in first Hello and used again after HRR byte[] pskIdentity; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java 2021-10-12 20:42:15.000000000 +0000 @@ -567,6 +567,9 @@ HashMap> holesMap; + // A map used to check duplicated handshake messages. + HashMap messageSeqMap; + HandshakeFlight() { this.handshakeType = HF_UNKNOWN; this.flightEpoch = 0; @@ -577,6 +580,7 @@ this.maxRecordSeq = -1; this.holesMap = new HashMap<>(5); + this.messageSeqMap = new HashMap<>(5); } boolean isRetransmitOf(HandshakeFlight hs) { @@ -598,6 +602,7 @@ hf.maxRecordSeq = this.maxRecordSeq; hf.holesMap = new HashMap<>(this.holesMap); + hf.messageSeqMap = new HashMap<>(this.messageSeqMap); return hf; } @@ -640,7 +645,7 @@ } // Queue up a handshake message. - void queueUpHandshake(HandshakeFragment hsf) { + void queueUpHandshake(HandshakeFragment hsf) throws SSLProtocolException { if (!isDesirable(hsf)) { // Not a dedired record, discard it. return; @@ -707,6 +712,7 @@ holes.add(new HoleDescriptor(0, hsf.messageLength)); } handshakeFlight.holesMap.put(hsf.handshakeType, holes); + handshakeFlight.messageSeqMap.put(hsf.handshakeType, hsf.messageSeq); } else if (holes.isEmpty()) { // Have got the full handshake message. This record may be // a handshake message retransmission. Discard this record. @@ -778,7 +784,8 @@ } // Queue up a ChangeCipherSpec message - void queueUpChangeCipherSpec(RecordFragment rf) { + void queueUpChangeCipherSpec(RecordFragment rf) + throws SSLProtocolException { if (!isDesirable(rf)) { // Not a dedired record, discard it. return; @@ -807,7 +814,7 @@ // Queue up a ciphertext message. // // Note: not yet be able to decrypt the message. - void queueUpFragment(RecordFragment rf) { + void queueUpFragment(RecordFragment rf) throws SSLProtocolException { if (!isDesirable(rf)) { // Not a dedired record, discard it. return; @@ -895,7 +902,7 @@ // Is a desired record? // // Check for retransmission and lost records. - private boolean isDesirable(RecordFragment rf) { + private boolean isDesirable(RecordFragment rf) throws SSLProtocolException { // // Discard records old than the previous epoch. // @@ -970,6 +977,27 @@ return false; } + // Unexpected duplicated handshake messages. + if (rf.recordEpoch == handshakeEpoch && + // For handshake messages only. + rf instanceof HandshakeFragment) { + HandshakeFragment hsf = (HandshakeFragment) rf; + // Check on the received handshake messages. + if (handshakeFlight.holesMap.containsKey(hsf.handshakeType)) { + Integer cachedMsgSeq = handshakeFlight.messageSeqMap.get( + hsf.handshakeType); + if (cachedMsgSeq != null && cachedMsgSeq != hsf.messageSeq) { + // Handshake messages of the same type but with different + // message sequence numbers are not allowed. + throw new SSLProtocolException( + "Two message sequence numbers are used for the " + + "same handshake message (" + + SSLHandshake.nameOf(hsf.handshakeType) + + ")"); + } + } + } + return true; } @@ -1086,6 +1114,9 @@ // cleanup holes map handshakeFlight.holesMap.clear(); + // cleanup handshake message sequence numbers map + handshakeFlight.messageSeqMap.clear(); + // Ready to accept new input record. flightIsReady = false; needToCheckFlight = false; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java 2021-10-12 20:42:15.000000000 +0000 @@ -27,6 +27,7 @@ import java.io.IOException; import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; import java.security.GeneralSecurityException; import java.security.PublicKey; import java.security.interfaces.ECPublicKey; @@ -35,6 +36,7 @@ import java.security.spec.ECParameterSpec; import java.security.spec.NamedParameterSpec; import java.text.MessageFormat; +import java.util.EnumSet; import java.util.Locale; import javax.crypto.SecretKey; import sun.security.ssl.SSLHandshake.HandshakeMessage; @@ -317,12 +319,20 @@ // create the credentials try { - NamedGroup ng = namedGroup; // "effectively final" the lambda - // AlgorithmConstraints are checked internally. - SSLCredentials sslCredentials = namedGroup.decodeCredentials( - cke.encodedPoint, shc.algorithmConstraints, - s -> shc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, - "ClientKeyExchange " + ng + ": " + s)); + SSLCredentials sslCredentials = + namedGroup.decodeCredentials(cke.encodedPoint); + if (shc.algorithmConstraints != null && + sslCredentials instanceof NamedGroupCredentials) { + NamedGroupCredentials namedGroupCredentials = + (NamedGroupCredentials) sslCredentials; + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroupCredentials.getPublicKey())) { + shc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "ClientKeyExchange for " + namedGroup + + " does not comply with algorithm constraints"); + } + } shc.handshakeCredentials.add(sslCredentials); } catch (GeneralSecurityException e) { @@ -499,12 +509,20 @@ // create the credentials try { - NamedGroup ng = namedGroup; // "effectively final" the lambda - // AlgorithmConstraints are checked internally. - SSLCredentials sslCredentials = namedGroup.decodeCredentials( - cke.encodedPoint, shc.algorithmConstraints, - s -> shc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, - "ClientKeyExchange " + ng + ": " + s)); + SSLCredentials sslCredentials = + namedGroup.decodeCredentials(cke.encodedPoint); + if (shc.algorithmConstraints != null && + sslCredentials instanceof NamedGroupCredentials) { + NamedGroupCredentials namedGroupCredentials = + (NamedGroupCredentials) sslCredentials; + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroupCredentials.getPublicKey())) { + shc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "ClientKeyExchange for " + namedGroup + + " does not comply with algorithm constraints"); + } + } shc.handshakeCredentials.add(sslCredentials); } catch (GeneralSecurityException e) { diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java 2021-10-12 20:42:15.000000000 +0000 @@ -27,6 +27,7 @@ import java.io.IOException; import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; import java.security.GeneralSecurityException; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; @@ -37,6 +38,7 @@ import java.security.Signature; import java.security.SignatureException; import java.text.MessageFormat; +import java.util.EnumSet; import java.util.Locale; import java.util.Map; import sun.security.ssl.NamedGroup.NamedGroupSpec; @@ -215,10 +217,20 @@ } try { - sslCredentials = namedGroup.decodeCredentials( - publicPoint, handshakeContext.algorithmConstraints, - s -> chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, - "ServerKeyExchange " + namedGroup + ": " + (s))); + sslCredentials = + namedGroup.decodeCredentials(publicPoint); + if (handshakeContext.algorithmConstraints != null && + sslCredentials instanceof NamedGroupCredentials) { + NamedGroupCredentials namedGroupCredentials = + (NamedGroupCredentials) sslCredentials; + if (!handshakeContext.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroupCredentials.getPublicKey())) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "ServerKeyExchange for " + namedGroup + + " does not comply with algorithm constraints"); + } + } } catch (GeneralSecurityException ex) { throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, "Cannot decode named group: " + diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java 2021-10-12 20:42:15.000000000 +0000 @@ -175,7 +175,7 @@ byte[] target = md.digest(secret); // 32 bytes target[0] = cookie[0]; - return Arrays.equals(target, cookie); + return MessageDigest.isEqual(target, cookie); } } @@ -305,7 +305,7 @@ md.update(headerBytes); byte[] headerCookie = md.digest(secret); - if (!Arrays.equals(headerCookie, prevHeadCookie)) { + if (!MessageDigest.isEqual(headerCookie, prevHeadCookie)) { return false; } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/JsseJce.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/JsseJce.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/JsseJce.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/JsseJce.java 2021-10-12 20:42:15.000000000 +0000 @@ -130,6 +130,11 @@ static final String CIPHER_AES_GCM = "AES/GCM/NoPadding"; /** + * JCE transformation string for ChaCha20-Poly1305 + */ + static final String CIPHER_CHACHA20_POLY1305 = "ChaCha20-Poly1305"; + + /** * JCA identifier string for DSA, i.e. a DSA with SHA-1. */ static final String SIGNATURE_DSA = "DSA"; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java 2021-10-12 20:42:15.000000000 +0000 @@ -27,10 +27,12 @@ import java.io.IOException; import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; import java.security.GeneralSecurityException; import java.text.MessageFormat; import java.util.Arrays; import java.util.Collections; +import java.util.EnumSet; import java.util.LinkedList; import java.util.List; import java.util.Locale; @@ -338,7 +340,8 @@ NamedGroup ng = NamedGroup.valueOf(entry.namedGroupId); if (ng == null || !SupportedGroups.isActivatable( shc.algorithmConstraints, ng)) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { SSLLogger.fine( "Ignore unsupported named group: " + NamedGroup.nameOf(entry.namedGroupId)); @@ -348,16 +351,34 @@ try { SSLCredentials kaCred = - ng.decodeCredentials(entry.keyExchange, - shc.algorithmConstraints, - s -> SSLLogger.warning(s)); + ng.decodeCredentials(entry.keyExchange); + if (shc.algorithmConstraints != null && + kaCred instanceof NamedGroupCredentials) { + NamedGroupCredentials namedGroupCredentials = + (NamedGroupCredentials) kaCred; + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroupCredentials.getPublicKey())) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "key share entry of " + ng + " does not " + + " comply with algorithm constraints"); + } + + kaCred = null; + } + } + if (kaCred != null) { credentials.add(kaCred); } } catch (GeneralSecurityException ex) { - SSLLogger.warning( - "Cannot decode named group: " + - NamedGroup.nameOf(entry.namedGroupId)); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Cannot decode named group: " + + NamedGroup.nameOf(entry.namedGroupId)); + } } } @@ -637,9 +658,21 @@ SSLCredentials credentials = null; try { - SSLCredentials kaCred = ng.decodeCredentials( - keyShare.keyExchange, chc.algorithmConstraints, - s -> chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, s)); + SSLCredentials kaCred = + ng.decodeCredentials(keyShare.keyExchange); + if (chc.algorithmConstraints != null && + kaCred instanceof NamedGroupCredentials) { + NamedGroupCredentials namedGroupCredentials = + (NamedGroupCredentials) kaCred; + if (!chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroupCredentials.getPublicKey())) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "key share entry of " + ng + " does not " + + " comply with algorithm constraints"); + } + } + if (kaCred != null) { credentials = kaCred; } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/NamedGroup.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/NamedGroup.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/NamedGroup.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/NamedGroup.java 2021-10-12 20:42:15.000000000 +0000 @@ -410,12 +410,9 @@ return spec.encodePossessionPublicKey(namedGroupPossession); } - SSLCredentials decodeCredentials(byte[] encoded, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail) - throws IOException, GeneralSecurityException { - return spec.decodeCredentials( - this, encoded, constraints, onConstraintFail); + SSLCredentials decodeCredentials( + byte[] encoded) throws IOException, GeneralSecurityException { + return spec.decodeCredentials(this, encoded); } SSLPossession createPossession(SecureRandom random) { @@ -427,30 +424,13 @@ return spec.createKeyDerivation(hc); } - interface ExceptionSupplier { - void apply(String s) throws SSLException; - } - // A list of operations related to named groups. private interface NamedGroupScheme { - default void checkConstraints(PublicKey publicKey, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail) throws SSLException { - if (!constraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) { - onConstraintFail.apply("key share entry does not " - + "comply with algorithm constraints"); - } - } - byte[] encodePossessionPublicKey( NamedGroupPossession namedGroupPossession); - SSLCredentials decodeCredentials( - NamedGroup ng, byte[] encoded, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail - ) throws IOException, GeneralSecurityException; + SSLCredentials decodeCredentials(NamedGroup ng, + byte[] encoded) throws IOException, GeneralSecurityException; SSLPossession createPossession(NamedGroup ng, SecureRandom random); @@ -515,13 +495,10 @@ } @Override - public SSLCredentials decodeCredentials(NamedGroup ng, byte[] encoded, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail - ) throws IOException, GeneralSecurityException { + public SSLCredentials decodeCredentials(NamedGroup ng, + byte[] encoded) throws IOException, GeneralSecurityException { if (scheme != null) { - return scheme.decodeCredentials( - ng, encoded, constraints, onConstraintFail); + return scheme.decodeCredentials(ng, encoded); } return null; @@ -558,18 +535,9 @@ } @Override - public SSLCredentials decodeCredentials(NamedGroup ng, byte[] encoded, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail - ) throws IOException, GeneralSecurityException { - - DHKeyExchange.DHECredentials result - = DHKeyExchange.DHECredentials.valueOf(ng, encoded); - - checkConstraints(result.getPublicKey(), constraints, - onConstraintFail); - - return result; + public SSLCredentials decodeCredentials(NamedGroup ng, + byte[] encoded) throws IOException, GeneralSecurityException { + return DHKeyExchange.DHECredentials.valueOf(ng, encoded); } @Override @@ -596,18 +564,9 @@ } @Override - public SSLCredentials decodeCredentials(NamedGroup ng, byte[] encoded, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail - ) throws IOException, GeneralSecurityException { - - ECDHKeyExchange.ECDHECredentials result - = ECDHKeyExchange.ECDHECredentials.valueOf(ng, encoded); - - checkConstraints(result.getPublicKey(), constraints, - onConstraintFail); - - return result; + public SSLCredentials decodeCredentials(NamedGroup ng, + byte[] encoded) throws IOException, GeneralSecurityException { + return ECDHKeyExchange.ECDHECredentials.valueOf(ng, encoded); } @Override @@ -632,18 +591,9 @@ } @Override - public SSLCredentials decodeCredentials(NamedGroup ng, byte[] encoded, - AlgorithmConstraints constraints, - ExceptionSupplier onConstraintFail - ) throws IOException, GeneralSecurityException { - - XDHKeyExchange.XDHECredentials result - = XDHKeyExchange.XDHECredentials.valueOf(ng, encoded); - - checkConstraints(result.getPublicKey(), constraints, - onConstraintFail); - - return result; + public SSLCredentials decodeCredentials(NamedGroup ng, + byte[] encoded) throws IOException, GeneralSecurityException { + return XDHKeyExchange.XDHECredentials.valueOf(ng, encoded); } @Override diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java 2021-10-12 20:42:15.000000000 +0000 @@ -31,7 +31,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Locale; -import java.util.Arrays; import java.util.Objects; import java.util.Collection; import javax.crypto.Mac; @@ -541,7 +540,7 @@ SecretKey binderKey = deriveBinderKey(shc, psk, session); byte[] computedBinder = computeBinder(shc, binderKey, session, pskBinderHash); - if (!Arrays.equals(binder, computedBinder)) { + if (!MessageDigest.isEqual(binder, computedBinder)) { throw shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, "Incorect PSK binder value"); } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/RandomCookie.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/RandomCookie.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/RandomCookie.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/RandomCookie.java 2021-10-12 20:42:15.000000000 +0000 @@ -25,10 +25,12 @@ package sun.security.ssl; +import sun.security.util.ByteArrays; + import java.io.*; import java.nio.ByteBuffer; +import java.security.MessageDigest; import java.security.SecureRandom; -import java.util.Arrays; /* * RandomCookie ... SSL hands standard format random cookies (nonces) @@ -111,7 +113,7 @@ } boolean isHelloRetryRequest() { - return Arrays.equals(hrrRandomBytes, randomBytes); + return MessageDigest.isEqual(hrrRandomBytes, randomBytes); } // Used for client random validation of version downgrade protection. @@ -130,10 +132,10 @@ } private boolean isT12Downgrade() { - return Arrays.equals(randomBytes, 24, 32, t12Protection, 0, 8); + return ByteArrays.isEqual(randomBytes, 24, 32, t12Protection, 0, 8); } private boolean isT11Downgrade() { - return Arrays.equals(randomBytes, 24, 32, t11Protection, 0, 8); + return ByteArrays.isEqual(randomBytes, 24, 32, t11Protection, 0, 8); } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java 2021-10-12 20:42:15.000000000 +0000 @@ -27,6 +27,7 @@ import java.io.IOException; import java.nio.ByteBuffer; +import java.security.MessageDigest; import java.text.MessageFormat; import java.util.Arrays; import java.util.Locale; @@ -37,6 +38,7 @@ import static sun.security.ssl.SSLExtension.SH_RENEGOTIATION_INFO; import sun.security.ssl.SSLExtension.SSLExtensionSpec; import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.util.ByteArrays; /** * Pack of the "renegotiation_info" extensions [RFC 5746]. @@ -243,7 +245,7 @@ "renegotiation"); } else { // verify the client_verify_data value - if (!Arrays.equals(shc.conContext.clientVerifyData, + if (!MessageDigest.isEqual(shc.conContext.clientVerifyData, spec.renegotiatedConnection)) { throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, "Invalid renegotiation_info extension data: " + @@ -470,14 +472,14 @@ } byte[] cvd = chc.conContext.clientVerifyData; - if (!Arrays.equals(spec.renegotiatedConnection, + if (!ByteArrays.isEqual(spec.renegotiatedConnection, 0, cvd.length, cvd, 0, cvd.length)) { throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, "Invalid renegotiation_info in ServerHello: " + "unmatched client_verify_data value"); } byte[] svd = chc.conContext.serverVerifyData; - if (!Arrays.equals(spec.renegotiatedConnection, + if (!ByteArrays.isEqual(spec.renegotiatedConnection, cvd.length, infoLen, svd, 0, svd.length)) { throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, "Invalid renegotiation_info in ServerHello: " + diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SSLCipher.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLCipher.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SSLCipher.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLCipher.java 2021-10-12 20:42:15.000000000 +0000 @@ -330,6 +330,32 @@ new T13GcmWriteCipherGenerator(), ProtocolVersion.PROTOCOLS_OF_13 ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_CC20_P1305(CIPHER_CHACHA20_POLY1305, AEAD_CIPHER, 32, 32, 12, + 12, true, false, + (Map.Entry[])(new Map.Entry[] { + new SimpleImmutableEntry( + new T12CC20P1305ReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_12 + ), + new SimpleImmutableEntry( + new T13CC20P1305ReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry[])(new Map.Entry[] { + new SimpleImmutableEntry( + new T12CC20P1305WriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_12 + ), + new SimpleImmutableEntry( + new T13CC20P1305WriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_13 + ) })); // descriptive name including key size, e.g. AES/128 @@ -2098,6 +2124,549 @@ } } + private static final class T12CC20P1305ReadCipherGenerator + implements ReadCipherGenerator { + + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new CC20P1305ReadCipher(authenticator, protocolVersion, + sslCipher, algorithm, key, params, random); + } + + static final class CC20P1305ReadCipher extends SSLReadCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] iv; + private final SecureRandom random; + + CC20P1305ReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.iv = ((IvParameterSpec)params).getIV(); + this.random = random; + + // DON'T initialize the cipher for AEAD! + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + if (bb.remaining() <= tagSize) { + throw new BadPaddingException( + "Insufficient buffer remaining for AEAD cipher " + + "fragment (" + bb.remaining() + "). Needs to be " + + "more than tag size (" + tagSize + ")"); + } + + byte[] sn = sequence; + if (sn == null) { + sn = authenticator.sequenceNumber(); + } + byte[] nonce = new byte[iv.length]; + System.arraycopy(sn, 0, nonce, nonce.length - sn.length, + sn.length); + for (int i = 0; i < nonce.length; i++) { + nonce[i] ^= iv[i]; + } + + // initialize the AEAD cipher with the unique IV + AlgorithmParameterSpec spec = new IvParameterSpec(nonce); + try { + cipher.init(Cipher.DECRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in AEAD mode", ikae); + } + + // update the additional authentication data + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, bb.remaining() - tagSize, sequence); + cipher.updateAAD(aad); + + // DON'T decrypt the nonce_explicit for AEAD mode. The buffer + // position has moved out of the nonce_explicit range. + int len = bb.remaining(); + int pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode \"" + ibse.getMessage() + + " \"in JCE provider " + cipher.getProvider().getName()); + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + // reset the limit to the end of the decrypted data + bb.position(pos); + bb.limit(pos + len); + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext after DECRYPTION", bb.duplicate()); + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + return packetSize - headerSize - tagSize; + } + } + } + + private static final class T12CC20P1305WriteCipherGenerator + implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new CC20P1305WriteCipher(authenticator, protocolVersion, + sslCipher, algorithm, key, params, random); + } + + private static final class CC20P1305WriteCipher extends SSLWriteCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] iv; + private final SecureRandom random; + + CC20P1305WriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.iv = ((IvParameterSpec)params).getIV(); + this.random = random; + + keyLimitCountdown = cipherLimits.getOrDefault( + algorithm.toUpperCase() + ":" + tag[0], 0L); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("algorithm = " + algorithm.toUpperCase() + + ":" + tag[0] + "\ncountdown value = " + + keyLimitCountdown); + } + if (keyLimitCountdown > 0) { + keyLimitEnabled = true; + } + + // DON'T initialize the cipher for AEAD! + } + + @Override + public int encrypt(byte contentType, + ByteBuffer bb) { + byte[] sn = authenticator.sequenceNumber(); + byte[] nonce = new byte[iv.length]; + System.arraycopy(sn, 0, nonce, nonce.length - sn.length, + sn.length); + for (int i = 0; i < nonce.length; i++) { + nonce[i] ^= iv[i]; + } + + // initialize the AEAD cipher for the unique IV + AlgorithmParameterSpec spec = new IvParameterSpec(nonce); + try { + cipher.init(Cipher.ENCRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in AEAD mode", ikae); + } + + // Update the additional authentication data, using the + // implicit sequence number of the authenticator. + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, bb.remaining(), null); + cipher.updateAAD(aad); + + // DON'T encrypt the nonce for AEAD mode. + int len = bb.remaining(); + int pos = bb.position(); + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext before ENCRYPTION", + bb.duplicate()); + } + + ByteBuffer dup = bb.duplicate(); + int outputSize = cipher.getOutputSize(dup.remaining()); + if (outputSize > bb.remaining()) { + // Need to expand the limit of the output buffer for + // the authentication tag. + // + // DON'T worry about the buffer's capacity, we have + // reserved space for the authentication tag. + bb.limit(pos + outputSize); + } + + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException | + BadPaddingException | ShortBufferException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode in JCE provider " + + cipher.getProvider().getName(), ibse); + } + + if (len != outputSize) { + throw new RuntimeException( + "Cipher buffering error in JCE provider " + + cipher.getProvider().getName()); + } + + return len; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return 0; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + return packetLimit - headerSize - tagSize; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + return fragmentSize + headerSize + tagSize; + } + } + } + + private static final class T13CC20P1305ReadCipherGenerator + implements ReadCipherGenerator { + + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new CC20P1305ReadCipher(authenticator, protocolVersion, + sslCipher, algorithm, key, params, random); + } + + static final class CC20P1305ReadCipher extends SSLReadCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] iv; + private final SecureRandom random; + + CC20P1305ReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.iv = ((IvParameterSpec)params).getIV(); + this.random = random; + + // DON'T initialize the cipher for AEAD! + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + // An implementation may receive an unencrypted record of type + // change_cipher_spec consisting of the single byte value 0x01 + // at any time after the first ClientHello message has been + // sent or received and before the peer's Finished message has + // been received and MUST simply drop it without further + // processing. + if (contentType == ContentType.CHANGE_CIPHER_SPEC.id) { + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + if (bb.remaining() <= tagSize) { + throw new BadPaddingException( + "Insufficient buffer remaining for AEAD cipher " + + "fragment (" + bb.remaining() + "). Needs to be " + + "more than tag size (" + tagSize + ")"); + } + + byte[] sn = sequence; + if (sn == null) { + sn = authenticator.sequenceNumber(); + } + byte[] nonce = new byte[iv.length]; + System.arraycopy(sn, 0, nonce, nonce.length - sn.length, + sn.length); + for (int i = 0; i < nonce.length; i++) { + nonce[i] ^= iv[i]; + } + + // initialize the AEAD cipher with the unique IV + AlgorithmParameterSpec spec = new IvParameterSpec(nonce); + try { + cipher.init(Cipher.DECRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in AEAD mode", ikae); + } + + // Update the additional authentication data, using the + // implicit sequence number of the authenticator. + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, bb.remaining(), sn); + cipher.updateAAD(aad); + + int len = bb.remaining(); + int pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode \"" + ibse.getMessage() + + " \"in JCE provider " + cipher.getProvider().getName()); + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + // reset the limit to the end of the decrypted data + bb.position(pos); + bb.limit(pos + len); + + // remove inner plaintext padding + int i = bb.limit() - 1; + for (; i > 0 && bb.get(i) == 0; i--) { + // blank + } + if (i < (pos + 1)) { + throw new BadPaddingException( + "Incorrect inner plaintext: no content type"); + } + contentType = bb.get(i); + bb.limit(i); + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext after DECRYPTION", bb.duplicate()); + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + return packetSize - headerSize - tagSize; + } + } + } + + private static final class T13CC20P1305WriteCipherGenerator + implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new CC20P1305WriteCipher(authenticator, protocolVersion, + sslCipher, algorithm, key, params, random); + } + + private static final class CC20P1305WriteCipher extends SSLWriteCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] iv; + private final SecureRandom random; + + CC20P1305WriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.iv = ((IvParameterSpec)params).getIV(); + this.random = random; + + keyLimitCountdown = cipherLimits.getOrDefault( + algorithm.toUpperCase() + ":" + tag[0], 0L); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("algorithm = " + algorithm.toUpperCase() + + ":" + tag[0] + "\ncountdown value = " + + keyLimitCountdown); + } + if (keyLimitCountdown > 0) { + keyLimitEnabled = true; + } + + // DON'T initialize the cipher for AEAD! + } + + @Override + public int encrypt(byte contentType, + ByteBuffer bb) { + byte[] sn = authenticator.sequenceNumber(); + byte[] nonce = new byte[iv.length]; + System.arraycopy(sn, 0, nonce, nonce.length - sn.length, + sn.length); + for (int i = 0; i < nonce.length; i++) { + nonce[i] ^= iv[i]; + } + + // initialize the AEAD cipher for the unique IV + AlgorithmParameterSpec spec = new IvParameterSpec(nonce); + try { + cipher.init(Cipher.ENCRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in AEAD mode", ikae); + } + + // Update the additional authentication data, using the + // implicit sequence number of the authenticator. + int outputSize = cipher.getOutputSize(bb.remaining()); + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, outputSize, sn); + cipher.updateAAD(aad); + + int len = bb.remaining(); + int pos = bb.position(); + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext before ENCRYPTION", + bb.duplicate()); + } + + ByteBuffer dup = bb.duplicate(); + if (outputSize > bb.remaining()) { + // Need to expand the limit of the output buffer for + // the authentication tag. + // + // DON'T worry about the buffer's capacity, we have + // reserved space for the authentication tag. + bb.limit(pos + outputSize); + } + + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException | + BadPaddingException | ShortBufferException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode in JCE provider " + + cipher.getProvider().getName(), ibse); + } + + if (len != outputSize) { + throw new RuntimeException( + "Cipher buffering error in JCE provider " + + cipher.getProvider().getName()); + } + + if (keyLimitEnabled) { + keyLimitCountdown -= len; + } + return len; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return 0; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + return packetLimit - headerSize - tagSize; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + return fragmentSize + headerSize + tagSize; + } + } + } + private static void addMac(MAC signer, ByteBuffer destination, byte contentType) { if (signer.macAlg().size != 0) { @@ -2383,4 +2952,3 @@ return results; } } - diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SSLLogger.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLLogger.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SSLLogger.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLLogger.java 2021-10-12 20:42:15.000000000 +0000 @@ -179,7 +179,7 @@ } private static void log(Level level, String msg, Object... params) { - if (logger.isLoggable(level)) { + if (logger != null && logger.isLoggable(level)) { if (params == null || params.length == 0) { logger.log(level, msg); } else { diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java 2021-10-12 20:42:15.000000000 +0000 @@ -1677,6 +1677,18 @@ } if (autoClose || !isLayered()) { + // Try to clear the kernel buffer to avoid TCP connection resets. + if (conContext.inputRecord instanceof + SSLSocketInputRecord && isConnected) { + if (appInput.readLock.tryLock()) { + try { + ((SSLSocketInputRecord) (conContext.inputRecord)).deplete(false); + } finally { + appInput.readLock.unlock(); + } + } + } + super.close(); } else if (selfInitiated) { if (!conContext.isInboundClosed() && !isInputShutdown()) { diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -92,6 +92,17 @@ // clean up this consumer chc.handshakeConsumers.remove(SSLHandshake.SERVER_KEY_EXCHANGE.id); + // Any receipt/consumption of the CertificateRequest before + // ServerKeyExchange is a state machine violation. We may not + // know for sure if an early CR message is a violation though until + // we have reached this point, due to other TLS features and + // optional messages. + if (chc.receivedCertReq) { + chc.receivedCertReq = false; // Reset flag + throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ServerKeyExchange handshake message"); + } + SSLConsumer certStatCons = chc.handshakeConsumers.remove( SSLHandshake.CERTIFICATE_STATUS.id); if (certStatCons != null) { diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SessionId.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SessionId.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/SessionId.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/SessionId.java 2021-10-12 20:42:15.000000000 +0000 @@ -25,6 +25,7 @@ package sun.security.ssl; +import java.security.MessageDigest; import java.security.SecureRandom; import java.util.Arrays; import javax.net.ssl.SSLProtocolException; @@ -89,7 +90,7 @@ if (obj instanceof SessionId) { SessionId that = (SessionId)obj; - return Arrays.equals(this.sessionId, that.sessionId); + return MessageDigest.isEqual(this.sessionId, that.sessionId); } return false; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/X509Authentication.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/X509Authentication.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/ssl/X509Authentication.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/ssl/X509Authentication.java 2021-10-12 20:42:15.000000000 +0000 @@ -191,9 +191,9 @@ } } - private static final - class X509PossessionGenerator implements SSLPossessionGenerator { - private final String[] keyTypes; + static final class X509PossessionGenerator + implements SSLPossessionGenerator { + final String[] keyTypes; private X509PossessionGenerator(String[] keyTypes) { this.keyTypes = keyTypes; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/tools/keytool/CertAndKeyGen.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/tools/keytool/CertAndKeyGen.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/tools/keytool/CertAndKeyGen.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/tools/keytool/CertAndKeyGen.java 2021-10-12 20:42:15.000000000 +0000 @@ -33,7 +33,10 @@ import java.security.spec.ECGenParameterSpec; import java.security.spec.NamedParameterSpec; import java.security.spec.AlgorithmParameterSpec; +import java.util.Calendar; import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; import sun.security.pkcs10.PKCS10; import sun.security.x509.*; @@ -277,6 +280,12 @@ try { lastDate = new Date (); lastDate.setTime (firstDate.getTime () + validity * 1000); + Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); + c.setTime(lastDate); + if (c.get(Calendar.YEAR) > 9999) { + throw new CertificateException("Validity period ends at calendar year " + + c.get(Calendar.YEAR) + " which is greater than 9999"); + } CertificateValidity interval = new CertificateValidity(firstDate,lastDate); diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/tools/keytool/Main.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/tools/keytool/Main.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/tools/keytool/Main.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/tools/keytool/Main.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -1433,8 +1433,7 @@ X509CertInfo.DN_NAME); Date firstDate = getStartDate(startDate); - Date lastDate = new Date(); - lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L); + Date lastDate = getLastDate(firstDate, validity); CertificateValidity interval = new CertificateValidity(firstDate, lastDate); @@ -1493,12 +1492,39 @@ reqex = (CertificateExtensions)attr.getAttributeValue(); } } + + PublicKey subjectPubKey = req.getSubjectPublicKeyInfo(); + PublicKey issuerPubKey = signerCert.getPublicKey(); + + KeyIdentifier signerSubjectKeyId; + if (Arrays.equals(subjectPubKey.getEncoded(), issuerPubKey.getEncoded())) { + // No AKID for self-signed cert + signerSubjectKeyId = null; + } else { + X509CertImpl certImpl; + if (signerCert instanceof X509CertImpl) { + certImpl = (X509CertImpl) signerCert; + } else { + certImpl = new X509CertImpl(signerCert.getEncoded()); + } + + // To enforce compliance with RFC 5280 section 4.2.1.1: "Where a key + // identifier has been previously established, the CA SHOULD use the + // previously established identifier." + // Use issuer's SKID to establish the AKID in createV3Extensions() method. + signerSubjectKeyId = certImpl.getSubjectKeyId(); + + if (signerSubjectKeyId == null) { + signerSubjectKeyId = new KeyIdentifier(issuerPubKey); + } + } + CertificateExtensions ext = createV3Extensions( reqex, null, v3ext, - req.getSubjectPublicKeyInfo(), - signerCert.getPublicKey()); + subjectPubKey, + signerSubjectKeyId); info.set(X509CertInfo.EXTENSIONS, ext); X509CertImpl cert = new X509CertImpl(info); cert.sign(privateKey, params, sigAlgName, null); @@ -1530,12 +1556,10 @@ X509CertInfo.DN_NAME); Date firstDate = getStartDate(startDate); - Date lastDate = (Date) firstDate.clone(); - lastDate.setTime(lastDate.getTime() + validity*1000*24*60*60); + Date lastDate = getLastDate(firstDate, validity); CertificateValidity interval = new CertificateValidity(firstDate, lastDate); - PrivateKey privateKey = (PrivateKey)recoverKey(alias, storePass, keyPass).fst; if (sigAlgName == null) { @@ -2917,8 +2941,7 @@ // Extend its validity Date firstDate = getStartDate(startDate); - Date lastDate = new Date(); - lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L); + Date lastDate = getLastDate(firstDate, validity); CertificateValidity interval = new CertificateValidity(firstDate, lastDate); certInfo.set(X509CertInfo.VALIDITY, interval); @@ -4204,6 +4227,7 @@ * @param extstrs -ext values, Read keytool doc * @param pkey the public key for the certificate * @param akey the public key for the authority (issuer) + * @param aSubjectKeyId the subject key identifier for the authority (issuer) * @return the created CertificateExtensions */ private CertificateExtensions createV3Extensions( @@ -4211,7 +4235,7 @@ CertificateExtensions existingEx, List extstrs, PublicKey pkey, - PublicKey akey) throws Exception { + KeyIdentifier aSubjectKeyId) throws Exception { // By design, inside a CertificateExtensions object, all known // extensions uses name (say, "BasicConstraints") as key and @@ -4236,6 +4260,14 @@ } } try { + // always non-critical + setExt(result, new SubjectKeyIdentifierExtension( + new KeyIdentifier(pkey).getIdentifier())); + if (aSubjectKeyId != null) { + setExt(result, new AuthorityKeyIdentifierExtension(aSubjectKeyId, + null, null)); + } + // name{:critical}{=value} // Honoring requested extensions if (requestedEx != null) { @@ -4568,19 +4600,27 @@ "Unknown.extension.type.") + extstr); } } - // always non-critical - setExt(result, new SubjectKeyIdentifierExtension( - new KeyIdentifier(pkey).getIdentifier())); - if (akey != null && !pkey.equals(akey)) { - setExt(result, new AuthorityKeyIdentifierExtension( - new KeyIdentifier(akey), null, null)); - } } catch(IOException e) { throw new RuntimeException(e); } return result; } + private Date getLastDate(Date firstDate, long validity) + throws Exception { + Date lastDate = new Date(); + lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L); + + Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); + c.setTime(lastDate); + if (c.get(Calendar.YEAR) > 9999) { + throw new Exception("Validity period ends at calendar year " + + c.get(Calendar.YEAR) + " which is greater than 9999"); + } + + return lastDate; + } + private boolean isTrustedCert(Certificate cert) throws KeyStoreException { if (caks != null && caks.getCertificateAlias(cert) != null) { return true; diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/AbstractAlgorithmConstraints.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/AbstractAlgorithmConstraints.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/AbstractAlgorithmConstraints.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/AbstractAlgorithmConstraints.java 2021-10-12 20:42:15.000000000 +0000 @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.TreeSet; import java.util.List; import java.util.Set; @@ -48,7 +49,7 @@ } // Get algorithm constraints from the specified security property. - static List getAlgorithms(String propertyName) { + static Set getAlgorithms(String propertyName) { String property = AccessController.doPrivileged( new PrivilegedAction() { @Override @@ -72,38 +73,30 @@ // map the disabled algorithms if (algorithmsInProperty == null) { - return Collections.emptyList(); + return Collections.emptySet(); } - return new ArrayList<>(Arrays.asList(algorithmsInProperty)); + Set algorithmsInPropertySet = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); + algorithmsInPropertySet.addAll(Arrays.asList(algorithmsInProperty)); + return algorithmsInPropertySet; } - static boolean checkAlgorithm(List algorithms, String algorithm, + static boolean checkAlgorithm(Set algorithms, String algorithm, AlgorithmDecomposer decomposer) { if (algorithm == null || algorithm.isEmpty()) { throw new IllegalArgumentException("No algorithm name specified"); } - Set elements = null; - for (String item : algorithms) { - if (item == null || item.isEmpty()) { - continue; - } - - // check the full name - if (item.equalsIgnoreCase(algorithm)) { - return false; - } + if (algorithms.contains(algorithm)) { + return false; + } - // decompose the algorithm into sub-elements - if (elements == null) { - elements = decomposer.decompose(algorithm); - } + // decompose the algorithm into sub-elements + Set elements = decomposer.decompose(algorithm); - // check the items of the algorithm - for (String element : elements) { - if (item.equalsIgnoreCase(element)) { - return false; - } + // check the element of the elements + for (String element : elements) { + if (algorithms.contains(element)) { + return false; } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/ByteArrays.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/ByteArrays.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/ByteArrays.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/ByteArrays.java 2021-10-12 20:42:15.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.util; + +/** + * A time-instance comparison of two byte arrays. + */ +public class ByteArrays { + // See the MessageDigest.isEqual(byte[] digesta, byte[] digestb) + // implementation. This is a potential enhancement of the + // MessageDigest class. + public static boolean isEqual(byte[] a, int aFromIndex, int aToIndex, + byte[] b, int bFromIndex, int bToIndex) { + if (a == b) { + return true; + } + + if (a == null || b == null) { + return false; + } + + if (a.length == 0) { + return b.length == 0; + } + + int lenA = aToIndex - aFromIndex; + int lenB = bToIndex - bFromIndex; + + if (lenB == 0) { + return lenA == 0; + } + + int result = 0; + result |= lenA - lenB; + + // time-constant comparison + for (int indexA = 0; indexA < lenA; indexA++) { + int indexB = ((indexA - lenB) >>> 31) * indexA; + result |= a[aFromIndex + indexA] ^ b[bFromIndex + indexB]; + } + + return result == 0; + } +} diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -26,12 +26,17 @@ package sun.security.util; import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; +import java.util.Arrays; /** - * A package private utility class to convert indefinite length DER + * A package private utility class to convert indefinite length BER * encoded byte arrays to definite length DER encoded byte arrays. - * + *

      + * Note: This class only substitute indefinite length octets to definite + * length octets. It does not update the contents even if they are not DER. + *

      * This assumes that the basic data structure is "tag, length, value" * triplet. In the case where the length is "indefinite", terminating * end-of-contents bytes are expected. @@ -40,26 +45,30 @@ */ class DerIndefLenConverter { - private static final int TAG_MASK = 0x1f; // bits 5-1 - private static final int FORM_MASK = 0x20; // bits 6 - private static final int CLASS_MASK = 0xC0; // bits 8 and 7 - private static final int LEN_LONG = 0x80; // bit 8 set private static final int LEN_MASK = 0x7f; // bits 7 - 1 - private static final int SKIP_EOC_BYTES = 2; private byte[] data, newData; private int newDataPos, dataPos, dataSize, index; private int unresolved = 0; + // A list to store each indefinite length occurrence. Whenever an indef + // length is seen, the position after the 0x80 byte is appended to the + // list as an integer. Whenever its matching EOC is seen, we know the + // actual length and the position value is substituted with a calculated + // length octets. At the end, the new DER encoding is a concatenation of + // all existing tags, existing definite length octets, existing contents, + // and the newly created definte length octets in this list. private ArrayList ndefsList = new ArrayList(); + // Length of extra bytes needed to convert indefinite encoding to definite. + // For each resolved indefinite length encoding, the starting 0x80 byte + // and the ending 00 00 bytes will be removed and a new definite length + // octets will be added. This value might be positive or negative. private int numOfTotalLenBytes = 0; - private boolean isEOC(int tag) { - return (((tag & TAG_MASK) == 0x00) && // EOC - ((tag & FORM_MASK) == 0x00) && // primitive - ((tag & CLASS_MASK) == 0x00)); // universal + private static boolean isEOC(byte[] data, int pos) { + return data[pos] == 0 && data[pos + 1] == 0; } // if bit 8 is set then it implies either indefinite length or long form @@ -86,47 +95,48 @@ } /** - * Parse the tag and if it is an end-of-contents tag then - * add the current position to the eocList vector. + * Consumes the tag at {@code dataPos}. + *

      + * If it is EOC then replace the matching start position (i.e. the previous + * {@code dataPos} where an indefinite length was found by #parseLength) + * in {@code ndefsList} with a length octets for this section. */ private void parseTag() throws IOException { - if (dataPos == dataSize) - return; - try { - if (isEOC(data[dataPos]) && (data[dataPos + 1] == 0)) { - int numOfEncapsulatedLenBytes = 0; - Object elem = null; - int index; - for (index = ndefsList.size()-1; index >= 0; index--) { - // Determine the first element in the vector that does not - // have a matching EOC - elem = ndefsList.get(index); - if (elem instanceof Integer) { - break; - } else { - numOfEncapsulatedLenBytes += ((byte[])elem).length - 3; - } - } - if (index < 0) { - throw new IOException("EOC does not have matching " + - "indefinite-length tag"); + if (isEOC(data, dataPos)) { + int numOfEncapsulatedLenBytes = 0; + Object elem = null; + int index; + for (index = ndefsList.size()-1; index >= 0; index--) { + // Determine the first element in the vector that does not + // have a matching EOC + elem = ndefsList.get(index); + if (elem instanceof Integer) { + break; + } else { + // For each existing converted part, 3 bytes (80 at the + // beginning and 00 00 at the end) are removed and a + // new length octets is added. + numOfEncapsulatedLenBytes += ((byte[])elem).length - 3; } - int sectionLen = dataPos - ((Integer)elem).intValue() + - numOfEncapsulatedLenBytes; - byte[] sectionLenBytes = getLengthBytes(sectionLen); - ndefsList.set(index, sectionLenBytes); - unresolved--; - - // Add the number of bytes required to represent this section - // to the total number of length bytes, - // and subtract the indefinite-length tag (1 byte) and - // EOC bytes (2 bytes) for this section - numOfTotalLenBytes += (sectionLenBytes.length - 3); - } - dataPos++; - } catch (IndexOutOfBoundsException iobe) { - throw new IOException(iobe); + } + if (index < 0) { + throw new IOException("EOC does not have matching " + + "indefinite-length tag"); + } + int sectionLen = dataPos - ((Integer)elem).intValue() + + numOfEncapsulatedLenBytes; + byte[] sectionLenBytes = getLengthBytes(sectionLen); + ndefsList.set(index, sectionLenBytes); + assert unresolved > 0; + unresolved--; + + // Add the number of bytes required to represent this section + // to the total number of length bytes, + // and subtract the indefinite-length tag (1 byte) and + // EOC bytes (2 bytes) for this section + numOfTotalLenBytes += (sectionLenBytes.length - 3); } + dataPos++; } /** @@ -134,37 +144,48 @@ * then skip the tag and its 1 byte length of zero. */ private void writeTag() { - if (dataPos == dataSize) + if (dataPos == dataSize) { return; - int tag = data[dataPos++]; - if (isEOC(tag) && (data[dataPos] == 0)) { - dataPos++; // skip length + } + assert dataPos + 1 < dataSize; + if (isEOC(data, dataPos)) { + dataPos += 2; // skip tag and length writeTag(); - } else - newData[newDataPos++] = (byte)tag; + } else { + newData[newDataPos++] = data[dataPos++]; + } } /** - * Parse the length and if it is an indefinite length then add - * the current position to the ndefsList vector. + * Parse the length octets started at {@code dataPos}. After this method + * is called, {@code dataPos} is placed after the length octets except + * -1 is returned. + * + * @return a) the length of definite length data next + * b) -1, if it is a definite length data next but the length + * octets is not complete to determine the actual length + * c) 0, if it is an indefinite length. Also, append the current + * position to the {@code ndefsList} vector. + * @throws IOException if invalid data is read */ private int parseLength() throws IOException { - int curLen = 0; - if (dataPos == dataSize) - return curLen; + if (dataPos == dataSize) { + return 0; + } int lenByte = data[dataPos++] & 0xff; if (isIndefinite(lenByte)) { ndefsList.add(dataPos); unresolved++; - return curLen; + return 0; } + int curLen = 0; if (isLongForm(lenByte)) { lenByte &= LEN_MASK; if (lenByte > 4) { throw new IOException("Too much data"); } if ((dataSize - dataPos) < (lenByte + 1)) { - throw new IOException("Too little data"); + return -1; } for (int i = 0; i < lenByte; i++) { curLen = (curLen << 8) + (data[dataPos++] & 0xff); @@ -179,14 +200,17 @@ } /** - * Write the length and if it is an indefinite length - * then calculate the definite length from the positions - * of the indefinite length and its matching EOC terminator. - * Then, write the value. + * Write the length and value. + *

      + * If it was definite length, just re-write the length and copy the value. + * If it was an indefinite length, copy the precalculated definite octets + * from {@code ndefsList}. There is no values here because they will be + * sub-encodings of a constructed encoding. */ private void writeLengthAndValue() throws IOException { - if (dataPos == dataSize) - return; + if (dataPos == dataSize) { + return; + } int curLen = 0; int lenByte = data[dataPos++] & 0xff; if (isIndefinite(lenByte)) { @@ -194,21 +218,21 @@ System.arraycopy(lenBytes, 0, newData, newDataPos, lenBytes.length); newDataPos += lenBytes.length; - return; - } - if (isLongForm(lenByte)) { - lenByte &= LEN_MASK; - for (int i = 0; i < lenByte; i++) { - curLen = (curLen << 8) + (data[dataPos++] & 0xff); - } - if (curLen < 0) { - throw new IOException("Invalid length bytes"); - } } else { - curLen = (lenByte & LEN_MASK); + if (isLongForm(lenByte)) { + lenByte &= LEN_MASK; + for (int i = 0; i < lenByte; i++) { + curLen = (curLen << 8) + (data[dataPos++] & 0xff); + } + if (curLen < 0) { + throw new IOException("Invalid length bytes"); + } + } else { + curLen = (lenByte & LEN_MASK); + } + writeLength(curLen); + writeValue(curLen); } - writeLength(curLen); - writeValue(curLen); } private void writeLength(int curLen) { @@ -297,18 +321,12 @@ } /** - * Parse the value; - */ - private void parseValue(int curLen) { - dataPos += curLen; - } - - /** * Write the value; */ private void writeValue(int curLen) { - for (int i=0; i < curLen; i++) - newData[newDataPos++] = data[dataPos++]; + System.arraycopy(data, dataPos, newData, newDataPos, curLen); + dataPos += curLen; + newDataPos += curLen; } /** @@ -318,44 +336,100 @@ * @param indefData the byte array holding the indefinite * length encoding. * @return the byte array containing the definite length - * DER encoding. + * DER encoding, or null if there is not enough data. * @exception IOException on parsing or re-writing errors. */ - byte[] convert(byte[] indefData) throws IOException { + byte[] convertBytes(byte[] indefData) throws IOException { data = indefData; - dataPos=0; index=0; + dataPos = 0; dataSize = data.length; - int len=0; - int unused = 0; // parse and set up the vectors of all the indefinite-lengths while (dataPos < dataSize) { + if (dataPos + 2 > dataSize) { + // There should be at least one tag and one length + return null; + } parseTag(); - len = parseLength(); - parseValue(len); + int len = parseLength(); + if (len < 0) { + return null; + } + dataPos += len; + if (dataPos < 0) { + // overflow + throw new IOException("Data overflow"); + } if (unresolved == 0) { - unused = dataSize - dataPos; - dataSize = dataPos; + assert !ndefsList.isEmpty() && ndefsList.get(0) instanceof byte[]; break; } } if (unresolved != 0) { - throw new IOException("not all indef len BER resolved"); + return null; } + int unused = dataSize - dataPos; + assert unused >= 0; + dataSize = dataPos; + newData = new byte[dataSize + numOfTotalLenBytes + unused]; - dataPos=0; newDataPos=0; index=0; + dataPos = 0; newDataPos = 0; index = 0; // write out the new byte array replacing all the indefinite-lengths // and EOCs while (dataPos < dataSize) { - writeTag(); - writeLengthAndValue(); + writeTag(); + writeLengthAndValue(); } System.arraycopy(indefData, dataSize, newData, dataSize + numOfTotalLenBytes, unused); return newData; } + + /** + * Read the input stream into a DER byte array. If an indef len BER is + * not resolved this method will try to read more data until EOF is reached. + * This may block. + * + * @param in the input stream with tag and lenByte already read + * @param lenByte the length of the length field to remember + * @param tag the tag to remember + * @return a DER byte array + * @throws IOException if not all indef len BER + * can be resolved or another I/O error happens + */ + public static byte[] convertStream(InputStream in, byte lenByte, byte tag) + throws IOException { + int offset = 2; // for tag and length bytes + int readLen = in.available(); + byte[] indefData = new byte[readLen + offset]; + indefData[0] = tag; + indefData[1] = lenByte; + while (true) { + int bytesRead = in.readNBytes(indefData, offset, readLen); + if (bytesRead != readLen) { + readLen = bytesRead; + indefData = Arrays.copyOf(indefData, offset + bytesRead); + } + DerIndefLenConverter derIn = new DerIndefLenConverter(); + byte[] result = derIn.convertBytes(indefData); + if (result == null) { + int next = in.read(); // This could block, but we need more + if (next == -1) { + throw new IOException("not enough data to resolve indef len BER"); + } + int more = in.available(); + // expand array to include next and more + indefData = Arrays.copyOf(indefData, offset + readLen + 1 + more); + indefData[offset + readLen] = (byte)next; + offset = offset + readLen + 1; + readLen = more; + } else { + return result; + } + } + } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DerInputStream.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerInputStream.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DerInputStream.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerInputStream.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -27,11 +27,9 @@ import java.io.InputStream; import java.io.IOException; -import java.io.EOFException; import java.util.Date; import java.util.Vector; import java.math.BigInteger; -import java.io.DataInputStream; /** * A DER input stream, used for parsing ASN.1 DER-encoded data such as @@ -130,7 +128,12 @@ System.arraycopy(data, offset, inData, 0, len); DerIndefLenConverter derIn = new DerIndefLenConverter(); - buffer = new DerInputBuffer(derIn.convert(inData), allowBER); + byte[] result = derIn.convertBytes(inData); + if (result == null) { + throw new IOException("not all indef len BER resolved"); + } else { + buffer = new DerInputBuffer(result, allowBER); + } } } else { buffer = new DerInputBuffer(data, offset, len, allowBER); @@ -389,16 +392,9 @@ if (len == -1) { // indefinite length encoding found - int readLen = buffer.available(); - int offset = 2; // for tag and length bytes - byte[] indefData = new byte[readLen + offset]; - indefData[0] = tag; - indefData[1] = lenByte; - DataInputStream dis = new DataInputStream(buffer); - dis.readFully(indefData, offset, readLen); - dis.close(); - DerIndefLenConverter derIn = new DerIndefLenConverter(); - buffer = new DerInputBuffer(derIn.convert(indefData), buffer.allowBER); + buffer = new DerInputBuffer( + DerIndefLenConverter.convertStream(buffer, lenByte, tag), + buffer.allowBER); if (tag != buffer.read()) throw new IOException("Indefinite length encoding" + diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DerValue.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerValue.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DerValue.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DerValue.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /** - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -257,16 +257,9 @@ length = DerInputStream.getLength(lenByte, in); if (length == -1) { // indefinite length encoding found DerInputBuffer inbuf = in.dup(); - int readLen = inbuf.available(); - int offset = 2; // for tag and length bytes - byte[] indefData = new byte[readLen + offset]; - indefData[0] = tag; - indefData[1] = lenByte; - DataInputStream dis = new DataInputStream(inbuf); - dis.readFully(indefData, offset, readLen); - dis.close(); - DerIndefLenConverter derIn = new DerIndefLenConverter(); - inbuf = new DerInputBuffer(derIn.convert(indefData), in.allowBER); + inbuf = new DerInputBuffer( + DerIndefLenConverter.convertStream(inbuf, lenByte, tag), + in.allowBER); if (tag != inbuf.read()) throw new IOException ("Indefinite length encoding not supported"); @@ -277,7 +270,7 @@ // indefinite form is encoded by sending a length field with a // length of 0. - i.e. [1000|0000]. // the object is ended by sending two zero bytes. - in.skip(length + offset); + in.skip(length + 2); } else { buffer = in.dup(); @@ -389,16 +382,8 @@ byte lenByte = (byte)in.read(); length = DerInputStream.getLength(lenByte, in); if (length == -1) { // indefinite length encoding found - int readLen = in.available(); - int offset = 2; // for tag and length bytes - byte[] indefData = new byte[readLen + offset]; - indefData[0] = tag; - indefData[1] = lenByte; - DataInputStream dis = new DataInputStream(in); - dis.readFully(indefData, offset, readLen); - dis.close(); - DerIndefLenConverter derIn = new DerIndefLenConverter(); - in = new ByteArrayInputStream(derIn.convert(indefData)); + in = new ByteArrayInputStream( + DerIndefLenConverter.convertStream(in, lenByte, tag)); if (tag != in.read()) throw new IOException ("Indefinite length encoding not supported"); diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java 2021-10-12 20:42:15.000000000 +0000 @@ -85,6 +85,9 @@ private static final String PROPERTY_DISABLED_EC_CURVES = "jdk.disabled.namedCurves"; + private static final Pattern INCLUDE_PATTERN = Pattern.compile("include " + + PROPERTY_DISABLED_EC_CURVES, Pattern.CASE_INSENSITIVE); + private static class CertPathHolder { static final DisabledAlgorithmConstraints CONSTRAINTS = new DisabledAlgorithmConstraints(PROPERTY_CERTPATH_DISABLED_ALGS); @@ -95,7 +98,7 @@ new DisabledAlgorithmConstraints(PROPERTY_JAR_DISABLED_ALGS); } - private final List disabledAlgorithms; + private final Set disabledAlgorithms; private final Constraints algorithmConstraints; public static DisabledAlgorithmConstraints certPathConstraints() { @@ -130,21 +133,14 @@ disabledAlgorithms = getAlgorithms(propertyName); // Check for alias - int ecindex = -1, i = 0; for (String s : disabledAlgorithms) { - if (s.regionMatches(true, 0,"include ", 0, 8)) { - if (s.regionMatches(true, 8, PROPERTY_DISABLED_EC_CURVES, 0, - PROPERTY_DISABLED_EC_CURVES.length())) { - ecindex = i; - break; - } + Matcher matcher = INCLUDE_PATTERN.matcher(s); + if (matcher.matches()) { + disabledAlgorithms.remove(matcher.group()); + disabledAlgorithms.addAll( + getAlgorithms(PROPERTY_DISABLED_EC_CURVES)); + break; } - i++; - } - if (ecindex > -1) { - disabledAlgorithms.remove(ecindex); - disabledAlgorithms.addAll(ecindex, - getAlgorithms(PROPERTY_DISABLED_EC_CURVES)); } algorithmConstraints = new Constraints(propertyName, disabledAlgorithms); } @@ -323,8 +319,8 @@ "denyAfter\\s+(\\d{4})-(\\d{2})-(\\d{2})"); } - public Constraints(String propertyName, List constraintArray) { - for (String constraintEntry : constraintArray) { + public Constraints(String propertyName, Set constraintSet) { + for (String constraintEntry : constraintSet) { if (constraintEntry == null || constraintEntry.isEmpty()) { continue; } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java 2021-10-12 20:42:15.000000000 +0000 @@ -269,6 +269,8 @@ throw (CertificateException)e; } else if (e instanceof NoSuchAlgorithmException) { throw (NoSuchAlgorithmException)e; + } else if (e instanceof RuntimeException){ + throw (RuntimeException)e; } } } diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java 2021-10-12 20:42:15.000000000 +0000 @@ -40,7 +40,7 @@ public static final String PROPERTY_TLS_LEGACY_ALGS = "jdk.tls.legacyAlgorithms"; - private final List legacyAlgorithms; + private final Set legacyAlgorithms; public LegacyAlgorithmConstraints(String propertyName, AlgorithmDecomposer decomposer) { diff -Nru openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java --- openjdk-11-11.0.12+7/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java 2021-10-12 20:42:15.000000000 +0000 @@ -521,6 +521,10 @@ if (digest != null) { ManifestDigester.Entry mde = md.get(ManifestDigester.MF_MAIN_ATTRS, false); + if (mde == null) { + throw new SignatureException("Manifest Main Attribute check " + + "failed due to missing main attributes entry"); + } byte[] computedHash = mde.digest(digest); byte[] expectedHash = Base64.getMimeDecoder().decode((String)se.getValue()); diff -Nru openjdk-11-11.0.12+7/src/java.compiler/share/classes/javax/tools/ToolProvider.java openjdk-11-11.0.13+8/src/java.compiler/share/classes/javax/tools/ToolProvider.java --- openjdk-11-11.0.12+7/src/java.compiler/share/classes/javax/tools/ToolProvider.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.compiler/share/classes/javax/tools/ToolProvider.java 2021-10-12 20:42:15.000000000 +0000 @@ -27,7 +27,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.Iterator; +import java.util.Objects; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; @@ -116,8 +116,7 @@ try { ServiceLoader sl = ServiceLoader.load(clazz, ClassLoader.getSystemClassLoader()); - for (Iterator iter = sl.iterator(); iter.hasNext(); ) { - T tool = iter.next(); + for (T tool : sl) { if (matches(tool, moduleName)) return tool; } @@ -138,7 +137,7 @@ PrivilegedAction pa = () -> { Module toolModule = tool.getClass().getModule(); String toolModuleName = toolModule.getName(); - return toolModuleName.equals(moduleName); + return Objects.equals(toolModuleName, moduleName); }; return AccessController.doPrivileged(pa); } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java --- openjdk-11-11.0.12+7/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java 2021-10-12 20:42:15.000000000 +0000 @@ -56,31 +56,6 @@ import java.util.Enumeration; public class AquaButtonRadioUI extends AquaButtonLabeledUI { - private KeyListener keyListener = null; - - @SuppressWarnings("serial") - private class SelectPreviousBtn extends AbstractAction { - public SelectPreviousBtn() { - super("Previous"); - } - - @Override - public void actionPerformed(ActionEvent e) { - AquaButtonRadioUI.this.selectRadioButton(e, false); - } - } - - @SuppressWarnings("serial") - private class SelectNextBtn extends AbstractAction { - public SelectNextBtn() { - super("Next"); - } - - @Override - public void actionPerformed(ActionEvent e) { - AquaButtonRadioUI.this.selectRadioButton(e, true); - } - } private static final RecyclableSingleton instance = new RecyclableSingletonFromDefaultConstructor(AquaButtonRadioUI.class); private static final RecyclableSingleton sizingIcon = new RecyclableSingleton() { @@ -115,269 +90,4 @@ super(other); } } - - private KeyListener createKeyListener() { - if (keyListener == null) { - keyListener = new KeyHandler(); - } - - return keyListener; - } - - private boolean isValidRadioButtonObj(Object obj) { - return ((obj instanceof JRadioButton) && - ((JRadioButton)obj).isVisible() && - ((JRadioButton)obj).isEnabled()); - } - - @Override - protected void installListeners(AbstractButton button) { - super.installListeners(button); - - //Only for JRadioButton - if (!(button instanceof JRadioButton)) - return; - - keyListener = createKeyListener(); - button.addKeyListener(keyListener); - - button.setFocusTraversalKeysEnabled(false); - - button.getActionMap().put("Previous", new SelectPreviousBtn()); - button.getActionMap().put("Next", new SelectNextBtn()); - - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("UP"), "Previous"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("DOWN"), "Next"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("LEFT"), "Previous"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("RIGHT"), "Next"); - } - - @Override - protected void uninstallListeners(AbstractButton button) { - super.uninstallListeners(button); - - //Only for JRadioButton - if (!(button instanceof JRadioButton)) - return; - - //Unmap actions from the arrow keys. - button.getActionMap().remove("Previous"); - button.getActionMap().remove("Next"); - - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - remove(KeyStroke.getKeyStroke("UP")); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - remove(KeyStroke.getKeyStroke("DOWN")); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - remove(KeyStroke.getKeyStroke("LEFT")); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - remove(KeyStroke.getKeyStroke("RIGHT")); - - if (keyListener != null ) { - button.removeKeyListener(keyListener); - keyListener = null; - } - } - - /** - * Select radio button based on "Previous" or "Next" operation - * - * @param event, the event object. - * @param next, indicate if it's next one - */ - private void selectRadioButton(ActionEvent event, boolean next) { - Object eventSrc = event.getSource(); - - //Check whether the source is JRadioButton, if so, whether it is visible - if (!isValidRadioButtonObj(eventSrc)) - return; - - ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo((JRadioButton)eventSrc); - btnGroupInfo.selectNewButton(next); - } - - /** - * ButtonGroupInfo, used to get related info in button group - * for given radio button. - */ - private class ButtonGroupInfo { - JRadioButton activeBtn = null; - - JRadioButton firstBtn = null; - JRadioButton lastBtn = null; - - JRadioButton previousBtn = null; - JRadioButton nextBtn = null; - - HashSet btnsInGroup = null; - boolean srcFound = false; - - public ButtonGroupInfo(JRadioButton btn) { - activeBtn = btn; - btnsInGroup = new HashSet(); - } - - //Check if given object is in the button group - boolean containsInGroup(Object obj) { - return btnsInGroup.contains(obj); - } - - //Check if the next object to gain focus belongs - //to the button group or not - Component getFocusTransferBaseComponent(boolean next) { - return firstBtn; - } - - boolean getButtonGroupInfo() { - if (activeBtn == null) - return false; - - btnsInGroup.clear(); - - //Get the button model from ths source. - ButtonModel model = activeBtn.getModel(); - if (!(model instanceof DefaultButtonModel)) - return false; - - // If the button model is DefaultButtonModel, and use it, otherwise return. - DefaultButtonModel bm = (DefaultButtonModel) model; - - //get the ButtonGroup of the button from the button model - ButtonGroup group = bm.getGroup(); - if (group == null) - return false; - - Enumeration e = group.getElements(); - if (e == null) - return false; - - while (e.hasMoreElements()) { - AbstractButton curElement = e.nextElement(); - if (!isValidRadioButtonObj(curElement)) - continue; - - btnsInGroup.add((JRadioButton) curElement); - - // If firstBtn is not set yet, curElement is that first button - if (null == firstBtn) - firstBtn = (JRadioButton)curElement; - - if (activeBtn == curElement) - srcFound = true; - else if (!srcFound) { - //The source has not been yet found and the current element - // is the last previousBtn - previousBtn = (JRadioButton) curElement; - } else if (nextBtn == null) { - //The source has been found and the current element - //is the next valid button of the list - nextBtn = (JRadioButton) curElement; - } - - //Set new last "valid" JRadioButton of the list - lastBtn = (JRadioButton)curElement; - } - - return true; - } - - /** - * Find the new radio button that focus needs to be - * moved to in the group, select the button - * - * @param next, indicate if it's arrow up/left or down/right - */ - void selectNewButton(boolean next) { - if (!getButtonGroupInfo()) - return; - - if (srcFound) { - JRadioButton newSelectedBtn = null; - if (next) { - //Select Next button. Cycle to the first button if the source - //button is the last of the group. - newSelectedBtn = (null == nextBtn) ? firstBtn : nextBtn; - } else { - //Select previous button. Cycle to the last button if the source - //button is the first button of the group. - newSelectedBtn = (null == previousBtn) ? lastBtn: previousBtn; - } - if (newSelectedBtn != null && newSelectedBtn != activeBtn) { - newSelectedBtn.requestFocusInWindow(); - newSelectedBtn.setSelected(true); - } - } - } - - /** - * Find the button group the passed in JRadioButton belongs to, and - * move focus to next component of the last button in the group - * or previous compoennt of first button - * - * @param next, indicate if jump to next component or previous - */ - void jumpToNextComponent(boolean next) { - if (!getButtonGroupInfo()) { - //In case the button does not belong to any group, it needs - //to be treated as a component - if (activeBtn != null) { - lastBtn = activeBtn; - firstBtn = activeBtn; - } else - return; - } - - //If next component in the parent window is not in the button - //group, current active button will be base, otherwise, the base - // will be first or last button in the button group - Component focusBase = getFocusTransferBaseComponent(next); - if (focusBase != null) { - if (next) { - KeyboardFocusManager. - getCurrentKeyboardFocusManager().focusNextComponent(focusBase); - } else { - KeyboardFocusManager. - getCurrentKeyboardFocusManager().focusPreviousComponent(focusBase); - } - } - } - } - - /** - * Radiobutton KeyListener - */ - private class KeyHandler implements KeyListener { - //This listener checks if the key event is a focus traversal key event - // on a radio button, consume the event if so and move the focus - // to next/previous component - @Override - public void keyPressed(KeyEvent e) { - AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e); - if (stroke != null && e.getSource() instanceof JRadioButton) { - JRadioButton source = (JRadioButton) e.getSource(); - boolean next = isFocusTraversalKey(source, - KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, stroke); - if (next || isFocusTraversalKey(source, - KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, stroke)) { - e.consume(); - ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo(source); - btnGroupInfo.jumpToNextComponent(next); - } - } - } - - private boolean isFocusTraversalKey(JComponent c, int id, - AWTKeyStroke stroke) { - Set keys = c.getFocusTraversalKeys(id); - return keys != null && keys.contains(stroke); - } - - @Override public void keyReleased(KeyEvent e) {} - - @Override public void keyTyped(KeyEvent e) {} - } } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java --- openjdk-11-11.0.12+7/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java 2021-10-12 20:42:15.000000000 +0000 @@ -185,17 +185,13 @@ } protected void installListeners(final AbstractButton b) { - final AquaButtonListener listener = createButtonListener(b); + super.installListeners(b); + AquaButtonListener listener = getAquaButtonListener(b); if (listener != null) { // put the listener in the button's client properties so that // we can get at it later b.putClientProperty(this, listener); - b.addMouseListener(listener); - b.addMouseMotionListener(listener); - b.addFocusListener(listener); - b.addPropertyChangeListener(listener); - b.addChangeListener(listener); b.addAncestorListener(listener); } installHierListener(b); @@ -221,15 +217,10 @@ } protected void uninstallListeners(final AbstractButton b) { + super.uninstallListeners(b); final AquaButtonListener listener = (AquaButtonListener)b.getClientProperty(this); b.putClientProperty(this, null); if (listener != null) { - b.removeMouseListener(listener); - b.removeMouseListener(listener); - b.removeMouseMotionListener(listener); - b.removeFocusListener(listener); - b.removeChangeListener(listener); - b.removePropertyChangeListener(listener); b.removeAncestorListener(listener); } uninstallHierListener(b); @@ -246,6 +237,23 @@ return new AquaButtonListener(b); } + /** + * Returns the AquaButtonListener for the passed in Button, or null if one + * could not be found. + */ + private AquaButtonListener getAquaButtonListener(AbstractButton b) { + MouseMotionListener[] listeners = b.getMouseMotionListeners(); + + if (listeners != null) { + for (MouseMotionListener listener : listeners) { + if (listener instanceof AquaButtonListener) { + return (AquaButtonListener) listener; + } + } + } + return null; + } + // Paint Methods public void paint(final Graphics g, final JComponent c) { final AbstractButton b = (AbstractButton)c; diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java --- openjdk-11-11.0.12+7/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2021-10-12 20:42:15.000000000 +0000 @@ -254,18 +254,22 @@ } } + boolean isPrintToFile = false; + private void setPrintToFile(boolean printToFile) { + isPrintToFile = printToFile; + } + @Override public void print(PrintRequestAttributeSet attributes) throws PrinterException { // NOTE: Some of this code is copied from RasterPrinterJob. - // this code uses javax.print APIs // this will make it print directly to the printer // this will not work if the user clicks on the "Preview" button // However if the printer is a StreamPrintService, its the right path. PrintService psvc = getPrintService(); - if (psvc == null) { + if (psvc == null && !isPrintToFile) { throw new PrinterException("No print service found."); } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m --- openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -31,7 +31,6 @@ #import "JavaTextAccessibility.h" #import "JavaAccessibilityUtilities.h" #import "GeomUtilities.h" -#import "OSVersion.h" #import "ThreadUtilities.h" #import "JNIUtilities.h" @@ -56,10 +55,7 @@ //#define EXTRA_DEBUG static BOOL shouldUsePressAndHold() { - static int shouldUsePressAndHold = -1; - if (shouldUsePressAndHold != -1) return shouldUsePressAndHold; - shouldUsePressAndHold = !isSnowLeopardOrLower(); - return shouldUsePressAndHold; + return YES; } @implementation AWTView @@ -1189,8 +1185,12 @@ #ifdef IM_DEBUG fprintf(stderr, "AWTView InputMethod Selector Called : [attributedSubstringFromRange] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length); #endif // IM_DEBUG + if (!fInputMethodLOCKABLE) { + return nil; + } JNIEnv *env = [ThreadUtilities getJNIEnv]; + GET_CIM_CLASS_RETURN(nil); DECLARE_METHOD_RETURN(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;", nil); jobject theString = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length); CHECK_EXCEPTION_NULL_RETURN(theString, nil); diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m --- openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m 2021-10-12 20:42:15.000000000 +0000 @@ -358,6 +358,13 @@ DECLARE_METHOD(jm_setCopiesAttribute, sjc_CPrinterJob, "setCopiesAttribute", "(I)V"); DECLARE_METHOD(jm_setCollated, sjc_CPrinterJob, "setCollated", "(Z)V"); DECLARE_METHOD(jm_setPageRangeAttribute, sjc_CPrinterJob, "setPageRangeAttribute", "(IIZ)V"); + DECLARE_METHOD(jm_setPrintToFile, sjc_CPrinterJob, "setPrintToFile", "(Z)V"); + + if (src.jobDisposition == NSPrintSaveJob) { + (*env)->CallVoidMethod(env, dstPrinterJob, jm_setPrintToFile, true); + } else { + (*env)->CallVoidMethod(env, dstPrinterJob, jm_setPrintToFile, false); + } // get the selected printer's name, and set the appropriate PrintService on the Java side NSString *name = [[src printer] name]; diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.h openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.h --- openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.h 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// Support for detecting Mac OS X versions - -double getOSXMajorVersion(); -BOOL isSnowLeopardOrLower(); diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.m openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.m --- openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.m 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// Support for detecting Mac OS X Versions - -#include -#include -#include -#import - - -// returns 107 for Lion, 106 for SnowLeopard etc. -int getOSXMajorVersion() { - char *ver = JRSCopyOSVersion(); - if (ver == NULL) { - return 0; - } - - int len = strlen(ver); - int v = 0; - - // Third char must be a '.' - if (len >= 3 && ver[2] == '.') { - int i; - - v = (ver[0] - '0') * 10 + (ver[1] - '0'); - for (i = 3; i < len && isdigit(ver[i]); ++i) { - v = v * 10 + (ver[i] - '0'); - } - } - - free(ver); - - return v; -} - -BOOL isSnowLeopardOrLower() { - return (getOSXMajorVersion() < 107); -} diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c --- openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, 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 @@ -255,9 +255,9 @@ } -static MIDIClientRef client = (MIDIClientRef) NULL; -static MIDIPortRef inPort = (MIDIPortRef) NULL; -static MIDIPortRef outPort = (MIDIPortRef) NULL; +static MIDIClientRef client = (MIDIClientRef) 0; +static MIDIPortRef inPort = (MIDIPortRef) 0; +static MIDIPortRef outPort = (MIDIPortRef) 0; // Each MIDIPacket can contain more than one midi messages. // This function processes the packet and adds the messages to the specified message queue. @@ -463,7 +463,7 @@ midiInit(); int err = MIDI_ERROR_NONE; - MIDIEndpointRef endpoint = (MIDIEndpointRef) NULL; + MIDIEndpointRef endpoint = (MIDIEndpointRef) 0; TRACE0("MIDI_Utils_OpenDevice\n"); diff -Nru openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libosxapp/JNIUtilities.m openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libosxapp/JNIUtilities.m --- openjdk-11-11.0.12+7/src/java.desktop/macosx/native/libosxapp/JNIUtilities.m 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/macosx/native/libosxapp/JNIUtilities.m 2021-10-12 20:42:15.000000000 +0000 @@ -40,11 +40,18 @@ } jstring NSStringToJavaString(JNIEnv* env, NSString *str) { - if (str == NULL) { return NULL; } - jstring jStr = (*env)->NewStringUTF(env, [str UTF8String]); + jsize len = [str length]; + unichar *buffer = (unichar*)calloc(len, sizeof(unichar)); + if (buffer == NULL) { + return NULL; + } + NSRange crange = NSMakeRange(0, len); + [str getCharacters:buffer range:crange]; + jstring jStr = (*env)->NewString(env, buffer, len); + free(buffer); CHECK_EXCEPTION(); return jStr; } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java 2021-10-12 20:42:15.000000000 +0000 @@ -594,6 +594,13 @@ height = Math.abs(height); } + if (metadata.compression == BI_RGB) { + long imageDataSize = (width * height * (bitsPerPixel / 8)); + if (imageDataSize > (bitmapFileSize - bitmapOffset)) { + throw new IIOException(I18N.getString("BMPImageReader9")); + } + } + // Reset Image Layout so there's only one tile. //Define the color space ColorSpace colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB); diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties 2021-10-12 20:42:15.000000000 +0000 @@ -24,6 +24,7 @@ BMPImageReader6=Unable to read the image header. BMPImageReader7=Invalid bitmap offset. BMPImageReader8=Invalid bits per pixel in image header. +BMPImageReader9=Invalid width/height for BI_RGB image data. BMPImageWriter0=Output is not an ImageOutputStream. BMPImageWriter1=The image region to be encoded is empty. BMPImageWriter2=Only 1 or 3 band image is encoded. diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java 2021-10-12 20:42:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -323,7 +323,7 @@ while (bytesToRead != 0) { int sz = Math.min(bytesToRead, UNIT_SIZE); byte[] unit = new byte[sz]; - stream.readFully(unit, bytesRead, sz); + stream.readFully(unit, 0, sz); bufs.add(unit); bytesRead += sz; bytesToRead -= sz; @@ -459,7 +459,7 @@ while (shortsToRead != 0) { int sz = Math.min(shortsToRead, SSHORT_TILE_SIZE); short[] unit = new short[sz]; - stream.readFully(unit, shortsRead, sz); + stream.readFully(unit, 0, sz); bufs.add(unit); shortsRead += sz; shortsToRead -= sz; @@ -490,7 +490,7 @@ while (intsToRead != 0) { int sz = Math.min(intsToRead, INT_TILE_SIZE); int[] unit = new int[sz]; - stream.readFully(unit, intsToRead, sz); + stream.readFully(unit, 0, sz); bufs.add(unit); intsRead += sz; intsToRead -= sz; @@ -522,7 +522,7 @@ while (srationalsToRead != 0) { int sz = Math.min(srationalsToRead, SRATIONAL_TILE_SIZE); int[] unit = new int[sz * 2]; - stream.readFully(unit, (srationalsToRead * 2), (sz * 2)); + stream.readFully(unit, 0, (sz * 2)); bufs.add(unit); srationalsRead += sz; srationalsToRead -= sz; @@ -556,7 +556,7 @@ while (floatsToRead != 0) { int sz = Math.min(floatsToRead, FLOAT_TILE_SIZE); float[] unit = new float[sz]; - stream.readFully(unit, floatsToRead, sz); + stream.readFully(unit, 0, sz); bufs.add(unit); floatsRead += sz; floatsToRead -= sz; @@ -587,7 +587,7 @@ while (doublesToRead != 0) { int sz = Math.min(doublesToRead, DOUBLE_TILE_SIZE); double[] unit = new double[sz]; - stream.readFully(unit, doublesToRead, sz); + stream.readFully(unit, 0, sz); bufs.add(unit); doublesRead += sz; doublesToRead -= sz; diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/java/awt/GridBagLayout.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/java/awt/GridBagLayout.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/java/awt/GridBagLayout.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/java/awt/GridBagLayout.java 2021-10-12 20:42:15.000000000 +0000 @@ -1122,7 +1122,7 @@ } - /* Cache the current slave's size. */ + /* Cache the current child's size. */ if (sizeflag == PREFERREDSIZE) d = comp.getPreferredSize(); else @@ -1263,7 +1263,7 @@ else if (constraints.gridwidth == 0 && curCol < 0) curRow = curY + curHeight; - /* Assign the new values to the gridbag slave */ + /* Assign the new values to the gridbag child */ constraints.tempX = curX; constraints.tempY = curY; constraints.tempWidth = curWidth; @@ -1382,7 +1382,7 @@ px = constraints.tempX + constraints.tempWidth; /* right column */ /* - * Figure out if we should use this slave\'s weight. If the weight + * Figure out if we should use this child's weight. If the weight * is less than the total weight spanned by the width of the cell, * then discard the weight. Otherwise split the difference * according to the existing weights. @@ -1408,7 +1408,7 @@ /* * Calculate the minWidth array values. - * First, figure out how wide the current slave needs to be. + * First, figure out how wide the current child needs to be. * Then, see if it will fit within the current minWidth values. * If it will not fit, add the difference according to the * weightX array. @@ -1443,7 +1443,7 @@ py = constraints.tempY + constraints.tempHeight; /* bottom row */ /* - * Figure out if we should use this slave's weight. If the weight + * Figure out if we should use this child's weight. If the weight * is less than the total weight spanned by the height of the cell, * then discard the weight. Otherwise split it the difference * according to the existing weights. @@ -1469,7 +1469,7 @@ /* * Calculate the minHeight array values. - * First, figure out how tall the current slave needs to be. + * First, figure out how tall the current child needs to be. * Then, see if it will fit within the current minHeight values. * If it will not fit, add the difference according to the * weightY array. @@ -1993,7 +1993,7 @@ /** * Figures out the minimum size of the - * master based on the information from {@code getLayoutInfo}. + * parent based on the information from {@code getLayoutInfo}. * This method should only be used internally by * {@code GridBagLayout}. * @@ -2073,7 +2073,7 @@ rightToLeft = !parent.getComponentOrientation().isLeftToRight(); /* - * If the parent has no slaves anymore, then don't do anything + * If the parent has no children anymore, then don't do anything * at all: just leave the parent's size as-is. */ if (components.length == 0 && @@ -2083,7 +2083,7 @@ } /* - * Pass #1: scan all the slaves to figure out the total amount + * Pass #1: scan all the children to figure out the total amount * of space needed. */ @@ -2173,7 +2173,7 @@ */ /* - * Now do the actual layout of the slaves using the layout information + * Now do the actual layout of the children using the layout information * that has been collected. */ diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/JPasswordField.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/JPasswordField.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/JPasswordField.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/JPasswordField.java 2021-10-12 20:42:15.000000000 +0000 @@ -489,20 +489,19 @@ * @since 1.6 */ public String getAtIndex(int part, int index) { - String str = null; if (part == AccessibleText.CHARACTER) { - str = super.getAtIndex(part, index); + return getEchoString(super.getAtIndex(part, index)); } else { // Treat the text displayed in the JPasswordField // as one word and sentence. - char password[] = getPassword(); - if (password == null || - index < 0 || index >= password.length) { + int length = getDocument().getLength(); + if (index < 0 || index >= length) { return null; } - str = new String(password); + char[] password = new char[length]; + Arrays.fill(password, getEchoChar()); + return new String(password); } - return getEchoString(str); } /** @@ -523,8 +522,7 @@ */ public String getAfterIndex(int part, int index) { if (part == AccessibleText.CHARACTER) { - String str = super.getAfterIndex(part, index); - return getEchoString(str); + return getEchoString(super.getAfterIndex(part, index)); } else { // There is no word or sentence after the text // displayed in the JPasswordField. @@ -550,8 +548,7 @@ */ public String getBeforeIndex(int part, int index) { if (part == AccessibleText.CHARACTER) { - String str = super.getBeforeIndex(part, index); - return getEchoString(str); + return getEchoString(super.getBeforeIndex(part, index)); } else { // There is no word or sentence before the text // displayed in the JPasswordField. @@ -606,14 +603,14 @@ } else { // Treat the text displayed in the JPasswordField // as one word, sentence, line and attribute run - char password[] = getPassword(); - if (password == null || - index < 0 || index >= password.length) { + int length = getDocument().getLength(); + if (index < 0 || index >= length) { return null; } + char[] password = new char[length]; + Arrays.fill(password, getEchoChar()); String text = new String(password); - return new AccessibleTextSequence(0, password.length - 1, - getEchoString(text)); + return new AccessibleTextSequence(0, password.length - 1, text); } } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java 2021-10-12 20:42:15.000000000 +0000 @@ -35,6 +35,9 @@ import javax.swing.border.*; import java.awt.*; import java.awt.event.*; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; import javax.swing.plaf.ButtonUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.ComponentUI; @@ -68,6 +71,8 @@ private static final Object BASIC_BUTTON_UI_KEY = new Object(); + private KeyListener keyListener = null; + // ******************************** // Create PLAF // ******************************** @@ -156,6 +161,27 @@ b.addPropertyChangeListener(listener); b.addChangeListener(listener); } + + if (b instanceof JToggleButton) { + keyListener = createKeyListener(); + b.addKeyListener(keyListener); + + // Need to get traversal key event + b.setFocusTraversalKeysEnabled(false); + + // Map actions to the arrow keys + b.getActionMap().put("Previous", new BasicButtonUI.SelectPreviousBtn()); + b.getActionMap().put("Next", new BasicButtonUI.SelectNextBtn()); + + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). + put(KeyStroke.getKeyStroke("UP"), "Previous"); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). + put(KeyStroke.getKeyStroke("DOWN"), "Next"); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). + put(KeyStroke.getKeyStroke("LEFT"), "Previous"); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). + put(KeyStroke.getKeyStroke("RIGHT"), "Next"); + } } /** @@ -208,6 +234,24 @@ b.removeChangeListener(listener); b.removePropertyChangeListener(listener); } + if (b instanceof JToggleButton) { + // Unmap actions from the arrow keys + b.getActionMap().remove("Previous"); + b.getActionMap().remove("Next"); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) + .remove(KeyStroke.getKeyStroke("UP")); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) + .remove(KeyStroke.getKeyStroke("DOWN")); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) + .remove(KeyStroke.getKeyStroke("LEFT")); + b.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) + .remove(KeyStroke.getKeyStroke("RIGHT")); + + if (keyListener != null) { + b.removeKeyListener(keyListener); + keyListener = null; + } + } } /** @@ -566,4 +610,262 @@ return null; } + /////////////////////////// Private functions //////////////////////// + /** + * Creates the key listener to handle tab navigation in JToggleButton Group. + */ + private KeyListener createKeyListener() { + if (keyListener == null) { + keyListener = new BasicButtonUI.KeyHandler(); + } + return keyListener; + } + + + private boolean isValidToggleButtonObj(Object obj) { + return ((obj instanceof JToggleButton) && + ((JToggleButton) obj).isVisible() && + ((JToggleButton) obj).isEnabled()); + } + + /** + * Select toggle button based on "Previous" or "Next" operation + * + * @param event, the event object. + * @param next, indicate if it's next one + */ + private void selectToggleButton(ActionEvent event, boolean next) { + // Get the source of the event. + Object eventSrc = event.getSource(); + + // Check whether the source is JToggleButton, it so, whether it is visible + if (!isValidToggleButtonObj(eventSrc)) + return; + + BasicButtonUI.ButtonGroupInfo btnGroupInfo = new BasicButtonUI.ButtonGroupInfo((JToggleButton)eventSrc); + btnGroupInfo.selectNewButton(next); + } + + /////////////////////////// Inner Classes //////////////////////// + @SuppressWarnings("serial") + private class SelectPreviousBtn extends AbstractAction { + public SelectPreviousBtn() { + super("Previous"); + } + + public void actionPerformed(ActionEvent e) { + BasicButtonUI.this.selectToggleButton(e, false); + } + } + + @SuppressWarnings("serial") + private class SelectNextBtn extends AbstractAction{ + public SelectNextBtn() { + super("Next"); + } + + public void actionPerformed(ActionEvent e) { + BasicButtonUI.this.selectToggleButton(e, true); + } + } + + /** + * ButtonGroupInfo, used to get related info in button group + * for given toggle button + */ + private class ButtonGroupInfo { + + JToggleButton activeBtn = null; + + JToggleButton firstBtn = null; + JToggleButton lastBtn = null; + + JToggleButton previousBtn = null; + JToggleButton nextBtn = null; + + HashSet btnsInGroup = null; + + boolean srcFound = false; + public ButtonGroupInfo(JToggleButton btn) { + activeBtn = btn; + btnsInGroup = new HashSet(); + } + + // Check if given object is in the button group + boolean containsInGroup(Object obj){ + return btnsInGroup.contains(obj); + } + + // Check if the next object to gain focus belongs + // to the button group or not + Component getFocusTransferBaseComponent(boolean next){ + return firstBtn; + } + + boolean getButtonGroupInfo() { + if (activeBtn == null) + return false; + + btnsInGroup.clear(); + + // Get the button model from the source. + ButtonModel model = activeBtn.getModel(); + if (!(model instanceof DefaultButtonModel)) + return false; + + // If the button model is DefaultButtonModel, and use it, otherwise return. + DefaultButtonModel bm = (DefaultButtonModel) model; + + // get the ButtonGroup of the button from the button model + ButtonGroup group = bm.getGroup(); + if (group == null) + return false; + + // Get all the buttons in the group + Enumeration e = group.getElements(); + if (e == null) + return false; + + while (e.hasMoreElements()) { + AbstractButton curElement = e.nextElement(); + if (!isValidToggleButtonObj(curElement)) + continue; + + btnsInGroup.add((JToggleButton) curElement); + + // If firstBtn is not set yet, curElement is that first button + if (null == firstBtn) + firstBtn = (JToggleButton) curElement; + + if (activeBtn == curElement) + srcFound = true; + else if (!srcFound) { + // The source has not been yet found and the current element + // is the last previousBtn + previousBtn = (JToggleButton) curElement; + } else if (nextBtn == null) { + // The source has been found and the current element + // is the next valid button of the list + nextBtn = (JToggleButton) curElement; + } + + // Set new last "valid" JToggleButton of the list + lastBtn = (JToggleButton) curElement; + } + + return true; + } + + /** + * Find the new toggle button that focus needs to be + * moved to in the group, select the button + * + * @param next, indicate if it's arrow up/left or down/right + */ + void selectNewButton(boolean next) { + if (!getButtonGroupInfo()) + return; + + if (srcFound) { + JToggleButton newSelectedBtn = null; + if (next) { + // Select Next button. Cycle to the first button if the source + // button is the last of the group. + newSelectedBtn = (null == nextBtn) ? firstBtn : nextBtn; + } else { + // Select previous button. Cycle to the last button if the source + // button is the first button of the group. + newSelectedBtn = (null == previousBtn) ? lastBtn : previousBtn; + } + if (newSelectedBtn != null && + (newSelectedBtn != activeBtn)) { + ButtonModel btnModel = newSelectedBtn.getModel(); + btnModel.setPressed(true); + btnModel.setArmed(true); + newSelectedBtn.requestFocusInWindow(); + newSelectedBtn.setSelected(true); + btnModel.setPressed(false); + btnModel.setArmed(false); + } + } + } + + /** + * Find the button group the passed in JToggleButton belongs to, and + * move focus to next component of the last button in the group + * or previous component of first button + * + * @param next, indicate if jump to next component or previous + */ + void jumpToNextComponent(boolean next) { + if (!getButtonGroupInfo()){ + // In case the button does not belong to any group, it needs + // to be treated as a component + if (activeBtn != null){ + lastBtn = activeBtn; + firstBtn = activeBtn; + } + else + return; + } + + // Update the component we will use as base to transfer + // focus from + JComponent compTransferFocusFrom = activeBtn; + + // If next component in the parent window is not in + // the button group, current active button will be + // base, otherwise, the base will be first or last + // button in the button group + Component focusBase = getFocusTransferBaseComponent(next); + if (focusBase != null){ + if (next) { + KeyboardFocusManager. + getCurrentKeyboardFocusManager().focusNextComponent(focusBase); + } else { + KeyboardFocusManager. + getCurrentKeyboardFocusManager().focusPreviousComponent(focusBase); + } + } + } + } + + /** + * Togglebutton KeyListener + */ + private class KeyHandler implements KeyListener { + + // This listener checks if the key event is a focus traversal key event + // on a toggle button, consume the event if so and move the focus + // to next/previous component + public void keyPressed(KeyEvent e) { + AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e); + if (stroke != null && e.getSource() instanceof JToggleButton) { + JToggleButton source = (JToggleButton) e.getSource(); + boolean next = isFocusTraversalKey(source, + KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, + stroke); + if (next || isFocusTraversalKey(source, + KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, + stroke)) { + e.consume(); + BasicButtonUI.ButtonGroupInfo btnGroupInfo = new BasicButtonUI.ButtonGroupInfo(source); + btnGroupInfo.jumpToNextComponent(next); + } + } + } + + private boolean isFocusTraversalKey(JComponent c, int id, + AWTKeyStroke stroke) { + Set keys = c.getFocusTraversalKeys(id); + return keys != null && keys.contains(stroke); + } + + public void keyReleased(KeyEvent e) { + } + + public void keyTyped(KeyEvent e) { + } + } + } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java 2021-10-12 20:42:15.000000000 +0000 @@ -113,65 +113,6 @@ return icon; } - // ******************************** - // Install Listeners - // ******************************** - @Override - protected void installListeners(AbstractButton button) { - super.installListeners(button); - - // Only for JRadioButton - if (!(button instanceof JRadioButton)) - return; - - keyListener = createKeyListener(); - button.addKeyListener(keyListener); - - // Need to get traversal key event - button.setFocusTraversalKeysEnabled(false); - - // Map actions to the arrow keys - button.getActionMap().put("Previous", new SelectPreviousBtn()); - button.getActionMap().put("Next", new SelectNextBtn()); - - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("UP"), "Previous"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("DOWN"), "Next"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("LEFT"), "Previous"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT). - put(KeyStroke.getKeyStroke("RIGHT"), "Next"); - } - - // ******************************** - // UnInstall Listeners - // ******************************** - @Override - protected void uninstallListeners(AbstractButton button) { - super.uninstallListeners(button); - - // Only for JRadioButton - if (!(button instanceof JRadioButton)) - return; - - // Unmap actions from the arrow keys - button.getActionMap().remove("Previous"); - button.getActionMap().remove("Next"); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) - .remove(KeyStroke.getKeyStroke("UP")); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) - .remove(KeyStroke.getKeyStroke("DOWN")); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) - .remove(KeyStroke.getKeyStroke("LEFT")); - button.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) - .remove(KeyStroke.getKeyStroke("RIGHT")); - - if (keyListener != null) { - button.removeKeyListener(keyListener); - keyListener = null; - } - } /* These Dimensions/Rectangles are allocated once for all * RadioButtonUI.paint() calls. Re-using rectangles @@ -348,262 +289,4 @@ height += prefInsets.top + prefInsets.bottom; return new Dimension(width, height); } - - /////////////////////////// Private functions //////////////////////// - /** - * Creates the key listener to handle tab navigation in JRadioButton Group. - */ - private KeyListener createKeyListener() { - if (keyListener == null) { - keyListener = new KeyHandler(); - } - return keyListener; - } - - - private boolean isValidRadioButtonObj(Object obj) { - return ((obj instanceof JRadioButton) && - ((JRadioButton) obj).isVisible() && - ((JRadioButton) obj).isEnabled()); - } - - /** - * Select radio button based on "Previous" or "Next" operation - * - * @param event, the event object. - * @param next, indicate if it's next one - */ - private void selectRadioButton(ActionEvent event, boolean next) { - // Get the source of the event. - Object eventSrc = event.getSource(); - - // Check whether the source is JRadioButton, it so, whether it is visible - if (!isValidRadioButtonObj(eventSrc)) - return; - - ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo((JRadioButton)eventSrc); - btnGroupInfo.selectNewButton(next); - } - - /////////////////////////// Inner Classes //////////////////////// - @SuppressWarnings("serial") - private class SelectPreviousBtn extends AbstractAction { - public SelectPreviousBtn() { - super("Previous"); - } - - public void actionPerformed(ActionEvent e) { - BasicRadioButtonUI.this.selectRadioButton(e, false); - } - } - - @SuppressWarnings("serial") - private class SelectNextBtn extends AbstractAction{ - public SelectNextBtn() { - super("Next"); - } - - public void actionPerformed(ActionEvent e) { - BasicRadioButtonUI.this.selectRadioButton(e, true); - } - } - - /** - * ButtonGroupInfo, used to get related info in button group - * for given radio button - */ - private class ButtonGroupInfo { - - JRadioButton activeBtn = null; - - JRadioButton firstBtn = null; - JRadioButton lastBtn = null; - - JRadioButton previousBtn = null; - JRadioButton nextBtn = null; - - HashSet btnsInGroup = null; - - boolean srcFound = false; - public ButtonGroupInfo(JRadioButton btn) { - activeBtn = btn; - btnsInGroup = new HashSet(); - } - - // Check if given object is in the button group - boolean containsInGroup(Object obj){ - return btnsInGroup.contains(obj); - } - - // Check if the next object to gain focus belongs - // to the button group or not - Component getFocusTransferBaseComponent(boolean next){ - return firstBtn; - } - - boolean getButtonGroupInfo() { - if (activeBtn == null) - return false; - - btnsInGroup.clear(); - - // Get the button model from the source. - ButtonModel model = activeBtn.getModel(); - if (!(model instanceof DefaultButtonModel)) - return false; - - // If the button model is DefaultButtonModel, and use it, otherwise return. - DefaultButtonModel bm = (DefaultButtonModel) model; - - // get the ButtonGroup of the button from the button model - ButtonGroup group = bm.getGroup(); - if (group == null) - return false; - - // Get all the buttons in the group - Enumeration e = group.getElements(); - if (e == null) - return false; - - while (e.hasMoreElements()) { - AbstractButton curElement = e.nextElement(); - if (!isValidRadioButtonObj(curElement)) - continue; - - btnsInGroup.add((JRadioButton) curElement); - - // If firstBtn is not set yet, curElement is that first button - if (null == firstBtn) - firstBtn = (JRadioButton) curElement; - - if (activeBtn == curElement) - srcFound = true; - else if (!srcFound) { - // The source has not been yet found and the current element - // is the last previousBtn - previousBtn = (JRadioButton) curElement; - } else if (nextBtn == null) { - // The source has been found and the current element - // is the next valid button of the list - nextBtn = (JRadioButton) curElement; - } - - // Set new last "valid" JRadioButton of the list - lastBtn = (JRadioButton) curElement; - } - - return true; - } - - /** - * Find the new radio button that focus needs to be - * moved to in the group, select the button - * - * @param next, indicate if it's arrow up/left or down/right - */ - void selectNewButton(boolean next) { - if (!getButtonGroupInfo()) - return; - - if (srcFound) { - JRadioButton newSelectedBtn = null; - if (next) { - // Select Next button. Cycle to the first button if the source - // button is the last of the group. - newSelectedBtn = (null == nextBtn) ? firstBtn : nextBtn; - } else { - // Select previous button. Cycle to the last button if the source - // button is the first button of the group. - newSelectedBtn = (null == previousBtn) ? lastBtn : previousBtn; - } - if (newSelectedBtn != null && - (newSelectedBtn != activeBtn)) { - ButtonModel btnModel = newSelectedBtn.getModel(); - btnModel.setPressed(true); - btnModel.setArmed(true); - newSelectedBtn.requestFocusInWindow(); - newSelectedBtn.setSelected(true); - btnModel.setPressed(false); - btnModel.setArmed(false); - } - } - } - - /** - * Find the button group the passed in JRadioButton belongs to, and - * move focus to next component of the last button in the group - * or previous component of first button - * - * @param next, indicate if jump to next component or previous - */ - void jumpToNextComponent(boolean next) { - if (!getButtonGroupInfo()){ - // In case the button does not belong to any group, it needs - // to be treated as a component - if (activeBtn != null){ - lastBtn = activeBtn; - firstBtn = activeBtn; - } - else - return; - } - - // Update the component we will use as base to transfer - // focus from - JComponent compTransferFocusFrom = activeBtn; - - // If next component in the parent window is not in - // the button group, current active button will be - // base, otherwise, the base will be first or last - // button in the button group - Component focusBase = getFocusTransferBaseComponent(next); - if (focusBase != null){ - if (next) { - KeyboardFocusManager. - getCurrentKeyboardFocusManager().focusNextComponent(focusBase); - } else { - KeyboardFocusManager. - getCurrentKeyboardFocusManager().focusPreviousComponent(focusBase); - } - } - } - } - - /** - * Radiobutton KeyListener - */ - private class KeyHandler implements KeyListener { - - // This listener checks if the key event is a focus traversal key event - // on a radio button, consume the event if so and move the focus - // to next/previous component - public void keyPressed(KeyEvent e) { - AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e); - if (stroke != null && e.getSource() instanceof JRadioButton) { - JRadioButton source = (JRadioButton) e.getSource(); - boolean next = isFocusTraversalKey(source, - KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, - stroke); - if (next || isFocusTraversalKey(source, - KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, - stroke)) { - e.consume(); - ButtonGroupInfo btnGroupInfo = new ButtonGroupInfo(source); - btnGroupInfo.jumpToNextComponent(next); - } - } - } - - private boolean isFocusTraversalKey(JComponent c, int id, - AWTKeyStroke stroke) { - Set keys = c.getFocusTraversalKeys(id); - return keys != null && keys.contains(stroke); - } - - public void keyReleased(KeyEvent e) { - } - - public void keyTyped(KeyEvent e) { - } - } } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java 2021-10-12 20:42:15.000000000 +0000 @@ -176,8 +176,7 @@ Segment text = v.getText(p0, p1); int[] justificationData = getJustificationData(v); int offs = Utilities.getTabbedTextOffset(v, text, metrics, - alloc.x, (int) x, expander, p0, - justificationData); + (float)alloc.x, x, expander, p0, justificationData); SegmentCache.releaseSharedSegment(text); int retValue = p0 + offs; if(retValue == p1) { diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/Utilities.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/Utilities.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/Utilities.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/Utilities.java 2021-10-12 20:42:15.000000000 +0000 @@ -398,6 +398,14 @@ justificationData, false); } + static final int getTabbedTextOffset(View view, Segment s, FontMetrics metrics, + float x0, float x, TabExpander e, + int startOffset, + int[] justificationData) { + return getTabbedTextOffset(view, s, metrics, x0, x, e, startOffset, true, + justificationData, true); + } + /** * Determines the relative offset into the given text that * best represents the given span in the view coordinate diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java 2021-10-12 20:42:15.000000000 +0000 @@ -233,25 +233,52 @@ currentCharacters.append(ch); } else { /* TODO: Test correct behavior of \bin keyword */ + if (pendingKeyword.equals("bin")) { /* magic layer-breaking kwd */ - long parameter = Long.parseLong(currentCharacters.toString()); + long parameter = 0L; + try { + parameter = Long.parseLong(currentCharacters.toString()); + } catch (NumberFormatException e) { + warning("Illegal number format " + currentCharacters.toString() + + " in \bin tag"); + pendingKeyword = null; + currentCharacters = new StringBuffer(); + state = S_text; + // Delimiters here are interpreted as text too + if (!Character.isWhitespace(ch)) + write(ch); + break; + } pendingKeyword = null; state = S_inblob; + int maxBytes = 4 * 1024 * 1024; binaryBytesLeft = parameter; - if (binaryBytesLeft > Integer.MAX_VALUE) - binaryBuf = new ByteArrayOutputStream(Integer.MAX_VALUE); - else - binaryBuf = new ByteArrayOutputStream((int)binaryBytesLeft); + + if (binaryBytesLeft > maxBytes) { + binaryBuf = new ByteArrayOutputStream(maxBytes); + } else if (binaryBytesLeft < 0) { + binaryBytesLeft = 0; + binaryBuf = new ByteArrayOutputStream((int)binaryBytesLeft); + } else { + binaryBuf = new ByteArrayOutputStream((int) binaryBytesLeft); + } savedSpecials = specialsTable; specialsTable = allSpecialsTable; break; } - int parameter = Integer.parseInt(currentCharacters.toString()); - ok = handleKeyword(pendingKeyword, parameter); - if (!ok) - warning("Unknown keyword: " + pendingKeyword + - " (param " + currentCharacters + ")"); + int parameter = 0; + try { + parameter = Integer.parseInt(currentCharacters.toString()); + ok = handleKeyword(pendingKeyword, parameter); + if (!ok) { + warning("Unknown keyword: " + pendingKeyword + + " (param " + currentCharacters + ")"); + } + } catch (NumberFormatException e) { + warning("Illegal number format " + currentCharacters.toString() + + " in " + pendingKeyword + " tag"); + } pendingKeyword = null; currentCharacters = new StringBuffer(); state = S_text; @@ -280,14 +307,16 @@ } break; case S_inblob: - binaryBuf.write(ch); - binaryBytesLeft --; + if (binaryBytesLeft > 0) { + binaryBuf.write(ch); + binaryBytesLeft--; + } if (binaryBytesLeft == 0) { - state = S_text; - specialsTable = savedSpecials; - savedSpecials = null; - handleBinaryBlob(binaryBuf.toByteArray()); - binaryBuf = null; + state = S_text; + specialsTable = savedSpecials; + savedSpecials = null; + handleBinaryBlob(binaryBuf.toByteArray()); + binaryBuf = null; } } } diff -Nru openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java --- openjdk-11-11.0.12+7/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java 2021-04-09 09:36:58.000000000 +0000 +++ openjdk-11-11.0.13+8/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java 2021-10-12 20:42:15.000000000 +0000 @@ -66,12 +66,12 @@ Dictionary fontTable; /** This array maps color indices to Color objects. */ Color[] colorTable; - /** This array maps character style numbers to Style objects. */ - Style[] characterStyles; - /** This array maps paragraph style numbers to Style objects. */ - Style[] paragraphStyles; - /** This array maps section style numbers to Style objects. */ - Style[] sectionStyles; + /** This Map maps character style numbers to Style objects. */ + Map characterStyles; + /** This Map maps paragraph style numbers to Style objects. */ + Map paragraphStyles; + /** This Map maps section style numbers to Style objects. */ + Map sectionStyles; /** This is the RTF version number, extracted from the \rtf keyword. * The version information is currently not used. */ @@ -835,9 +835,9 @@ public void close() { - Vector